Skip to content

Generated AlloyDB types excluded connection_pool_config.pooler_count field #5753

@nancynh

Description

@nancynh

Checklist

Bug Description

Following up on #5611 (comment), filing a bug for the connection_pool_config.pooler_count field not being included when re-generating the AlloyDB instance types but the other fields like connection_pool_config.enabled and connection_pool_config.flags were. I'm not sure if this is because connection_pool_config.pooler_count is an output only field.

Additional Diagnostic Information

I followed the guide for adding a new field and when I ran:

go run . update-types insert  --parent "google.cloud.alloydb.v1beta.Instance"  --field "connection_pool_config"     --api-dir ${REPO_ROOT}/apis/alloydb/v1beta1

I saw that the types.generated.go file added this:

// +kcc:proto=google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig
type Instance_ConnectionPoolConfig struct {
	// Optional. Whether to enable Managed Connection Pool (MCP).
	// +kcc:proto:field=google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.enabled
	Enabled *bool `json:"enabled,omitempty"`

	// Optional. Connection Pool flags, as a list of "key": "value" pairs.
	// +kcc:proto:field=google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.flags
	Flags map[string]string `json:"flags,omitempty"`
}

But I expected it to be something like this:

// +kcc:proto=google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig
type Instance_ConnectionPoolConfig struct {
	// Optional. Whether to enable Managed Connection Pool (MCP).
	// +kcc:proto:field=google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.enabled
	Enabled *bool `json:"enabled,omitempty"`

	// Optional. Connection Pool flags, as a list of "key": "value" pairs.
	// +kcc:proto:field=google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.flags
	Flags map[string]string `json:"flags,omitempty"`

	// Output only. The number of running poolers per instance.
	// +kcc:proto:field=google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.pooler_count
	PoolerCount *int32 `json:"pooler_count,omitempty"`
}

Kubernetes Cluster Version

Client Version: v1.16.4 Server Version: v1.33.5-gke.1201000

Config Connector Version

0.0.0-dev

Config Connector Mode

namespaced mode (default)

Log Output

The update types command outputted this:

$ go run . update-types insert     --parent "google.cloud.alloydb.v1beta.Instance"     --field "connection_pool_config"     --api-dir ${REPO_ROOT}/apis/alloydb/v1beta1
I1203 21:41:38.255011   40845 fieldinserter.go:188] generate Go code for field connection_pool_config
I1203 21:41:38.255603   40845 fieldinserter.go:194] generate Go code for messge google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig
I1203 21:41:38.255671   40845 insertfield-ast.go:52] inserting the generated Go code for field connection_pool_config
I1203 21:41:38.262650   40845 insertmessage-ast.go:133] inserted the generated Go struct for proto message google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig

Steps to reproduce the issue

  1. Run REPO_ROOT="$(git rev-parse --show-toplevel)"
  2. Run cd $REPO_ROOT/dev/tools/controllerbuilder
  3. Run go run . update-types insert --parent "google.cloud.alloydb.v1beta.Instance" --field "connection_pool_config" --api-dir ${REPO_ROOT}/apis/alloydb/v1beta1

YAML snippets

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions