Update postgresql_type.go #1022
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
when we use client-go create
PostgreSQL
, get the below error message.2020-06-16T23:01:13.763+0800 ERROR controller-runtime.controller Reconciler error {"controller": "harborcluster", "request": "pg/harborcluster-sample", "error": "postgresql.acid.zalan.do \"harbor-postgre-cluster\" is invalid: []: Invalid value: map[string]interface {}{\"apiVersion\":\"acid.zalan.do/v1\", \"kind\":\"postgresql\", \"metadata\":map[string]interface {}{\"creationTimestamp\":\"2020-06-16T15:01:13Z\", \"generation\":1, \"name\":\"harbor-postgre-cluster\", \"namespace\":\"pg\", \"ownerReferences\":[]interface {}{map[string]interface {}{\"apiVersion\":\"cluster.goharbor.io/v1\", \"blockOwnerDeletion\":true, \"controller\":true, \"kind\":\"HarborCluster\", \"name\":\"harborcluster-sample\", \"uid\":\"fbcd8e4a-afe1-11ea-b2c3-00163f003dea\"}}, \"uid\":\"38b840ad-afe2-11ea-a750-00163e0dc939\"}, \"spec\":map[string]interface {}{\"allowedSourceRanges\":interface {}(nil), \"clone\":map[string]interface {}{}, \"databases\":map[string]interface {}{\"foo\":\"zalando\"}, \"dockerImage\":\"harbor.ymmoa.com/monitoring/postgresql:12\", \"numberOfInstances\":3, \"patroni\":map[string]interface {}{\"initdb\":interface {}(nil), \"loop_wait\":0, \"maximum_lag_on_failover\":0, \"pg_hba\":interface {}(nil), \"retry_timeout\":0, \"slots\":interface {}(nil), \"synchronous_mode\":false, \"synchronous_mode_strict\":false, \"ttl\":0}, \"podAnnotations\":interface {}(nil), \"postgresql\":map[string]interface {}{\"parameters\":map[string]interface {}{}, \"version\":\"12\"}, \"resources\":map[string]interface {}{\"limits\":map[string]interface {}{\"cpu\":\"0\", \"memory\":\"0\"}, \"requests\":map[string]interface {}{\"cpu\":\"0\", \"memory\":\"0\"}}, \"serviceAnnotations\":interface {}(nil), \"standby\":interface {}(nil), \"teamId\":\"harbor\", \"tls\":interface {}(nil), \"users\":map[string]interface {}{\"foo_user\":[]interface {}{}, \"zalando\":[]interface {}{\"superuser\", \"createdb\"}}, \"volume\":map[string]interface {}{\"size\":\"1Gi\", \"storageClass\":\"\"}}}: validation failure list:\nspec.serviceAnnotations in body must be of type object: \"null\"\nspec.clone.cluster in body is required\nspec.tls in body must be of type object: \"null\"\nspec.patroni.slots in body must be of type object: \"null\"\nspec.patroni.pg_hba in body must be of type array: \"null\"\nspec.patroni.initdb in body must be of type object: \"null\"\nspec.standby in body must be of type object: \"null\"\nspec.podAnnotations in body must be of type object: \"null\""}