Skip to content

Commit

Permalink
Rename BigQueryConfig to BigqueryConfig
Browse files Browse the repository at this point in the history
to avoid undesired underscores on CamelCase to snale_case conversion
  • Loading branch information
POD666 committed Oct 17, 2022
1 parent e03ae44 commit ac93b49
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 29 deletions.
8 changes: 4 additions & 4 deletions apis/pubsub/v1alpha1/subscription_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ type SubscriptionParameters struct {
// +optional
PushConfig *PushConfig `json:"pushConfig,omitempty"`

// BigQueryConfig is a parameter which configures bigquery delivery.
// BigqueryConfig is a parameter which configures bigquery delivery.
// +optional
BigQueryConfig *BigQueryConfig `json:"bigQueryConfig,omitempty"`
BigqueryConfig *BigqueryConfig `json:"bigqueryConfig,omitempty"`

// RetainAckedMessages is a message which indicates whether to retain acknowledged
// messages. If true, then messages are not expunged from the
Expand Down Expand Up @@ -147,8 +147,8 @@ type PushConfig struct {
PushEndpoint string `json:"pushEndpoint,omitempty"`
}

// BigQueryConfig contains configuration for a bigquery delivery endpoint.
type BigQueryConfig struct {
// BigqueryConfig contains configuration for a bigquery delivery endpoint.
type BigqueryConfig struct {
// Bigquery table to deliver messages to.
Table string `json:"table,omitempty"`

Expand Down
14 changes: 7 additions & 7 deletions apis/pubsub/v1alpha1/zz_generated.deepcopy.go

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

4 changes: 2 additions & 2 deletions package/crds/pubsub.gcp.crossplane.io_subscriptions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ spec:
value of 10 seconds is used.
format: int64
type: integer
bigQueryConfig:
description: BigQueryConfig is a parameter which configures bigquery
bigqueryConfig:
description: BigqueryConfig is a parameter which configures bigquery
delivery.
properties:
dropUnknownFields:
Expand Down
26 changes: 13 additions & 13 deletions pkg/clients/subscription/subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func GenerateSubscription(projectID, name string, p v1alpha1.SubscriptionParamet
setDeadLetterPolicy(projectID, p, s)
setExpirationPolicy(p, s)
setPushConfig(p, s)
setBigQueryConfig(p, s)
setBigqueryConfig(p, s)
setRetryPolicy(p, s)

return s
Expand Down Expand Up @@ -86,14 +86,14 @@ func setPushConfig(p v1alpha1.SubscriptionParameters, s *pubsub.Subscription) {
}
}

// setBigQueryConfig sets BigQueryConfig of subscription based on SubscriptionParameters.
func setBigQueryConfig(p v1alpha1.SubscriptionParameters, s *pubsub.Subscription) {
if p.BigQueryConfig != nil {
// setBigqueryConfig sets BigqueryConfig of subscription based on SubscriptionParameters.
func setBigqueryConfig(p v1alpha1.SubscriptionParameters, s *pubsub.Subscription) {
if p.BigqueryConfig != nil {
s.BigqueryConfig = &pubsub.BigQueryConfig{
Table: p.BigQueryConfig.Table,
UseTopicSchema: p.BigQueryConfig.UseTopicSchema,
WriteMetadata: p.BigQueryConfig.WriteMetadata,
DropUnknownFields: p.BigQueryConfig.DropUnknownFields,
Table: p.BigqueryConfig.Table,
UseTopicSchema: p.BigqueryConfig.UseTopicSchema,
WriteMetadata: p.BigqueryConfig.WriteMetadata,
DropUnknownFields: p.BigqueryConfig.DropUnknownFields,
}
}
}
Expand Down Expand Up @@ -182,8 +182,8 @@ func LateInitialize(p *v1alpha1.SubscriptionParameters, s pubsub.Subscription) {
}
}

if p.BigQueryConfig == nil && s.BigqueryConfig != nil {
p.BigQueryConfig = &v1alpha1.BigQueryConfig{
if p.BigqueryConfig == nil && s.BigqueryConfig != nil {
p.BigqueryConfig = &v1alpha1.BigqueryConfig{
Table: s.BigqueryConfig.Table,
DropUnknownFields: s.BigqueryConfig.DropUnknownFields,
UseTopicSchema: s.BigqueryConfig.UseTopicSchema,
Expand Down Expand Up @@ -267,9 +267,9 @@ func GenerateUpdateRequest(name string, p v1alpha1.SubscriptionParameters, s pub
setPushConfig(p, us.Subscription)
}

if !cmp.Equal(p.BigQueryConfig, observed.BigQueryConfig) {
mask = append(mask, "bigQueryConfig")
setBigQueryConfig(p, us.Subscription)
if !cmp.Equal(p.BigqueryConfig, observed.BigqueryConfig) {
mask = append(mask, "bigqueryConfig")
setBigqueryConfig(p, us.Subscription)
}

if !cmp.Equal(p.RetryPolicy, observed.RetryPolicy) {
Expand Down
6 changes: 3 additions & 3 deletions pkg/clients/subscription/subscription_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func bigqueryParams() *v1alpha1.SubscriptionParameters {
Labels: map[string]string{"example": "true"},
MessageRetentionDuration: "864000s",
PushConfig: nil,
BigQueryConfig: &v1alpha1.BigQueryConfig{
BigqueryConfig: &v1alpha1.BigqueryConfig{
Table: "projects/my-project/subscriptions/my-bigquery-subscription",
UseTopicSchema: true,
WriteMetadata: true,
Expand Down Expand Up @@ -295,7 +295,7 @@ func TestLateInitializeBigquery(t *testing.T) {
Labels: map[string]string{"example": "true"},
MessageRetentionDuration: "864000s",
PushConfig: nil,
BigQueryConfig: &v1alpha1.BigQueryConfig{
BigqueryConfig: &v1alpha1.BigqueryConfig{
Table: "projects/my-project/subscriptions/my-bigquery-subscription",
UseTopicSchema: true,
WriteMetadata: true,
Expand Down Expand Up @@ -466,7 +466,7 @@ func TestGenerateUpdateRequestBigquery(t *testing.T) {
},
result: &pubsub.UpdateSubscriptionRequest{
Subscription: mutableSubscription,
UpdateMask: "ackDeadlineSeconds,detached,filter,labels,messageRetentionDuration,retainAckedMessages,expirationPolicy,bigQueryConfig,retryPolicy",
UpdateMask: "ackDeadlineSeconds,detached,filter,labels,messageRetentionDuration,retainAckedMessages,expirationPolicy,bigqueryConfig,retryPolicy",
},
},
}
Expand Down

0 comments on commit ac93b49

Please sign in to comment.