c/b/b/reflection: support bigint OSInstallationRequest
Change-Id: Id677ec97f2acd8102bb0e8a5366d54db8dd53d13
Reviewed-on: https://review.monogon.dev/c/monogon/+/1604
Tested-by: Jenkins CI
Reviewed-by: Serge Bazanski <serge@monogon.tech>
diff --git a/cloud/bmaas/bmdb/reflection/reflection.go b/cloud/bmaas/bmdb/reflection/reflection.go
index 3f1b69a..5942a30 100644
--- a/cloud/bmaas/bmdb/reflection/reflection.go
+++ b/cloud/bmaas/bmdb/reflection/reflection.go
@@ -423,6 +423,13 @@
return fmt.Errorf("SQL type %q, but got %+v", r.Type.NativeType, src)
}
r.time = &src2
+ case "bigint":
+ src2, ok := src.(int64)
+ if !ok {
+ return fmt.Errorf("SQL type %q, but got %+v", r.Type.NativeType, src)
+ }
+ src3 := fmt.Sprintf("%d", src2)
+ r.text = &src3
default:
return fmt.Errorf("unimplemented SQL type %q", r.Type.NativeType)
}
diff --git a/cloud/bmaas/bmdb/reflection/schema.go b/cloud/bmaas/bmdb/reflection/schema.go
index b869f8a..30ce6c4 100644
--- a/cloud/bmaas/bmdb/reflection/schema.go
+++ b/cloud/bmaas/bmdb/reflection/schema.go
@@ -76,7 +76,8 @@
// Just mapping from column name is fine enough for now as we have mostly unique
// column names, and these column names uniquely map to a single type.
var knownProtoFields = map[string]proto.Message{
- "hardware_report_raw": &api.AgentHardwareReport{},
+ "hardware_report_raw": &api.AgentHardwareReport{},
+ "os_installation_request_raw": &api.OSInstallationRequest{},
}
// HumanType returns a human-readable representation of the field's type. This is
@@ -92,6 +93,8 @@
return "timestamp"
case "bytea":
return "bytes"
+ case "bigint":
+ return "int"
default:
return r.NativeType
}