Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tool: improve types generator #3667

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 62 additions & 1 deletion apis/alloydb/v1beta1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,68 @@ import (

var AlloyDBClusterGVK = GroupVersion.WithKind("AlloyDBCluster")

// +kcc:proto=google.cloud.alloydb.v1beta.Cluster.PscConfig
type Cluster_PSCConfig struct {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, I assume the change is made because of the acronym capitalization issue? Can I get an /lgtm for #3624? With this change, you shouldn't need to do manual modifications.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. I'm not sure if we reached a consensus on which acronym to include in that PR, so I manually moved the Go structs in this PR to unblock the fix.

// Optional. Create an instance that allows connections from Private Service
// Connect endpoints to the instance.
// +kcc:proto:field=google.cloud.alloydb.v1beta.Cluster.PscConfig.psc_enabled
PSCEnabled *bool `json:"pscEnabled,omitempty"`
}

// +kcc:proto=google.cloud.alloydb.v1beta.Instance.MachineConfig
type Instance_MachineConfig struct {
// The number of CPU's in the VM instance.
// +kcc:proto:field=google.cloud.alloydb.v1beta.Instance.MachineConfig.cpu_count
CPUCount *int32 `json:"cpuCount,omitempty"`
}

// +kcc:proto=google.cloud.alloydb.v1beta.Instance.PscInstanceConfig
type Instance_PSCInstanceConfig struct {
// Optional. List of consumer projects that are allowed to create
// PSC endpoints to service-attachments to this instance.
// +kcc:proto:field=google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.allowed_consumer_projects
AllowedConsumerProjects []string `json:"allowedConsumerProjects,omitempty"`
}

// +kcc:proto=google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig
type Instance_ClientConnectionConfig struct {
// Optional. Configuration to enforce connectors only (ex: AuthProxy)
// connections to the database.
// +kcc:proto:field=google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.require_connectors
RequireConnectors *bool `json:"requireConnectors,omitempty"`

// Optional. SSL configuration option for this instance.
// +kcc:proto:field=google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.ssl_config
SSLConfig *SSLConfig `json:"sslConfig,omitempty"`
}

// +kcc:proto=google.cloud.alloydb.v1beta.SslConfig
type SSLConfig struct {
// Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
// +kcc:proto:field=google.cloud.alloydb.v1beta.SslConfig.ssl_mode
SSLMode *string `json:"sslMode,omitempty"`

// Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
// supported currently, and is the default value.
// +kcc:proto:field=google.cloud.alloydb.v1beta.SslConfig.ca_source
CASource *string `json:"caSource,omitempty"`
}

// +kcc:proto=google.cloud.alloydb.v1beta.Instance.PscInstanceConfig
type Instance_PSCInstanceConfigObservedState struct {
// Output only. The service attachment created when Private
// Service Connect (PSC) is enabled for the instance.
// The name of the resource will be in the format of
// `projects/<alloydb-tenant-project-number>/regions/<region-name>/serviceAttachments/<service-attachment-name>`
// +kcc:proto:field=google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.service_attachment_link
ServiceAttachmentLink *string `json:"serviceAttachmentLink,omitempty"`

// Output only. The DNS name of the instance for PSC connectivity.
// Name convention: <uid>.<uid>.<region>.alloydb-psc.goog
// +kcc:proto:field=google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.psc_dns_name
PSCDNSName *string `json:"pscDNSName,omitempty"`
}

// AlloyDBClusterSpec defines the desired state of AlloyDBCluster
// +kcc:proto=google.cloud.alloydb.v1beta.Cluster
type AlloyDBClusterSpec struct {
Expand Down Expand Up @@ -275,7 +337,6 @@ type Cluster_NetworkConfig struct {

// +kcc:proto=google.cloud.alloydb.v1beta.BackupSource
type BackupSource struct {

// Required. The name of the backup resource with the format:
// * projects/{project}/locations/{region}/backups/{backup_id}
// +kcc:proto:field=google.cloud.alloydb.v1beta.BackupSource.backup_name
Expand Down
91 changes: 0 additions & 91 deletions apis/alloydb/v1beta1/types.generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

105 changes: 0 additions & 105 deletions apis/alloydb/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading