Skip to content

Commit

Permalink
manually fix stream proto bugs and edgecase handling
Browse files Browse the repository at this point in the history
  • Loading branch information
yuwenma committed Feb 4, 2025
1 parent 99159b7 commit 1f164a3
Show file tree
Hide file tree
Showing 7 changed files with 355 additions and 78 deletions.
30 changes: 16 additions & 14 deletions apis/datastream/v1alpha1/stream_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,29 @@ type DatastreamStreamSpec struct {
// The DatastreamStream name. If not given, the metadata.name will be used.
ResourceID *string `json:"resourceID,omitempty"`

// +required
/* Immutable. A reference to the project */
ProjectRef refs.ProjectRef `json:"projectRef"`

// +required
// Immutable. The name of the location this stream.
Location string `json:"location"`

// The source connection profile configuration.
// +required
// Immutable. The source connection profile configuration.
SourceConfig *SourceConfigSpec `json:"sourceConfig,omitempty"`

// The destination connection profile configuration.
// +required
// Immutable. The destination connection profile configuration.
DestinationConfig *DestinationConfig `json:"destinationConfig,omitempty"`

// Display name.
DisplayName *string `json:"displayName,omitempty"`

// Labels.
Labels map[string]string `json:"labels,omitempty"`

// The customer-managed encryption key's resource name, if the
// stream is encrypted with customer-managed encryption key.
CustomerManagedEncryptionKeyRef *refs.KMSCryptoKeyRef `json:"customerManagedEncryptionKey,omitempty"`

// Backfill strategy.
BackfillAll *Stream_BackfillAllStrategy `json:"backfillAll,omitempty"`
BackfillNone *Stream_BackfillNoneStrategy `json:"backfillNone,omitempty"`
Expand All @@ -71,9 +76,6 @@ type DatastreamStreamStatus struct {
// +kcc:proto=google.cloud.datastream.v1.Stream
// DatastreamStreamObservedState is the state of the DatastreamStream resource as most recently observed in GCP.
type DatastreamStreamObservedState struct {
// Output only. The stream's name.
Name *string `json:"name,omitempty"`

// Output only. Create time.
CreateTime *string `json:"createTime,omitempty"`

Expand All @@ -85,15 +87,13 @@ type DatastreamStreamObservedState struct {

// Output only. A list of errors that occurred on the stream.
Errors []Error `json:"errors,omitempty"`

// Output only. The customer-managed encryption key's resource name, if the
// stream is encrypted with customer-managed encryption key.
CustomerManagedEncryptionKey *string `json:"customerManagedEncryptionKey,omitempty"`
}

// +kcc:proto=google.cloud.datastream.v1.SourceConfig
type SourceConfigSpec struct {
// Required. Source connection profile resoource.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="the field is immutable"
// +required
// Source connection profile resoource.
// Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
// +kcc:proto:field=google.cloud.datastream.v1.SourceConfig.source_connection_profile
SourceConnectionProfileRef *ConnectionProfileRef `json:"sourceConnectionProfileRef,omitempty"`
Expand All @@ -118,7 +118,9 @@ type SourceConfigSpec struct {

// +kcc:proto=google.cloud.datastream.v1.DestinationConfig
type DestinationConfig struct {
// Required. Destination connection profile resource.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="the field is immutable"
// +required
// Destination connection profile resource.
// Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
// +kcc:proto:field=google.cloud.datastream.v1.DestinationConfig.destination_connection_profile
DestinationConnectionProfileRef *ConnectionProfileRef `json:"destinationConnectionProfileRef,omitempty"`
Expand Down
30 changes: 15 additions & 15 deletions apis/datastream/v1alpha1/zz_generated.deepcopy.go

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

Loading

0 comments on commit 1f164a3

Please sign in to comment.