Skip to content

Commit

Permalink
chore: fixed default programmed condition
Browse files Browse the repository at this point in the history
Signed-off-by: Mattia Lavacca <[email protected]>
  • Loading branch information
mlavacca committed Aug 27, 2024
1 parent bf0381f commit 53446b8
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 40 deletions.
2 changes: 1 addition & 1 deletion api/configuration/v1/kongconsumer_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ type KongConsumer struct {
Spec KongConsumerSpec `json:"spec,omitempty"`

// Status represents the current status of the KongConsumer resource.
// +kubebuilder:default={conditions: {{type: "Accepted", status: "Unknown", reason:"Pending", message:"Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"},{type: "Programmed", status: "Unknown", reason:"Pending", message:"Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"}}}
Status KongConsumerStatus `json:"status,omitempty"`
}

Expand Down Expand Up @@ -153,7 +154,6 @@ type KongConsumerStatus struct {
// +listType=map
// +listMapKey=type
// +kubebuilder:validation:MaxItems=8
// +kubebuilder:default={{type: "Programmed", status: "Unknown", reason:"Pending", message:"Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"}}
Conditions []metav1.Condition `json:"conditions,omitempty"`
}

Expand Down
5 changes: 3 additions & 2 deletions api/configuration/v1alpha1/kongpluginbinding_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ type KongPluginBinding struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec KongPluginBindingSpec `json:"spec"`
Spec KongPluginBindingSpec `json:"spec"`

// +kubebuilder:default={conditions: {{type: "Accepted", status: "Unknown", reason:"Pending", message:"Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"},{type: "Programmed", status: "Unknown", reason:"Pending", message:"Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"}}}
Status KongPluginBindingStatus `json:"status,omitempty"`
}

Expand Down Expand Up @@ -209,7 +211,6 @@ type KongPluginBindingStatus struct {
// +listMapKey=type
// +kubebuilder:validation:MinItems=1
// +kubebuilder:validation:MaxItems=8
// +kubebuilder:default={{type: "Programmed", status: "Unknown", reason:"Pending", message:"Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"}}
Conditions []metav1.Condition `json:"conditions,omitempty"`
}

Expand Down
5 changes: 3 additions & 2 deletions api/configuration/v1alpha1/kongroute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ type KongRoute struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec KongRouteSpec `json:"spec"`
Spec KongRouteSpec `json:"spec"`

// +kubebuilder:default={conditions: {{type: "Accepted", status: "Unknown", reason:"Pending", message:"Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"},{type: "Programmed", status: "Unknown", reason:"Pending", message:"Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"}}}
Status KongRouteStatus `json:"status,omitempty"`
}

Expand Down Expand Up @@ -165,7 +167,6 @@ type KongRouteStatus struct {
// +listMapKey=type
// +kubebuilder:validation:MinItems=1
// +kubebuilder:validation:MaxItems=8
// +kubebuilder:default={{type: "Programmed", status: "Unknown", reason:"Pending", message:"Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"}}
Conditions []metav1.Condition `json:"conditions,omitempty"`
}

Expand Down
5 changes: 3 additions & 2 deletions api/configuration/v1alpha1/kongservice_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ type KongService struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec KongServiceSpec `json:"spec"`
Spec KongServiceSpec `json:"spec"`

// +kubebuilder:default={conditions: {{type: "Accepted", status: "Unknown", reason:"Pending", message:"Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"},{type: "Programmed", status: "Unknown", reason:"Pending", message:"Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"}}}
Status KongServiceStatus `json:"status,omitempty"`
}

Expand Down Expand Up @@ -168,7 +170,6 @@ type KongServiceStatus struct {
// +listMapKey=type
// +kubebuilder:validation:MinItems=1
// +kubebuilder:validation:MaxItems=8
// +kubebuilder:default={{type: "Programmed", status: "Unknown", reason:"Pending", message:"Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"}}
Conditions []metav1.Condition `json:"conditions,omitempty"`
}

Expand Down
2 changes: 1 addition & 1 deletion api/configuration/v1beta1/kongconsumergroup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type KongConsumerGroup struct {
Spec KongConsumerGroupSpec `json:"spec,omitempty"`

// Status represents the current status of the KongConsumerGroup resource.
// +kubebuilder:default={conditions: {{type: "Accepted", status: "Unknown", reason:"Pending", message:"Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"},{type: "Programmed", status: "Unknown", reason:"Pending", message:"Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"}}}
Status KongConsumerGroupStatus `json:"status,omitempty"`
}

Expand Down Expand Up @@ -129,7 +130,6 @@ type KongConsumerGroupStatus struct {
// +listType=map
// +listMapKey=type
// +kubebuilder:validation:MaxItems=8
// +kubebuilder:default={{type: "Programmed", status: "Unknown", reason:"Pending", message:"Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"}}
Conditions []metav1.Condition `json:"conditions,omitempty"`
}

Expand Down
18 changes: 12 additions & 6 deletions config/crd/bases/configuration.konghq.com_kongconsumergroups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,22 @@ spec:
type: string
type: object
status:
default:
conditions:
- lastTransitionTime: "1970-01-01T00:00:00Z"
message: Waiting for controller
reason: Pending
status: Unknown
type: Accepted
- lastTransitionTime: "1970-01-01T00:00:00Z"
message: Waiting for controller
reason: Pending
status: Unknown
type: Programmed
description: Status represents the current status of the KongConsumerGroup
resource.
properties:
conditions:
default:
- lastTransitionTime: "1970-01-01T00:00:00Z"
message: Waiting for controller
reason: Pending
status: Unknown
type: Programmed
description: |-
Conditions describe the current conditions of the KongConsumerGroup.
Expand Down
18 changes: 12 additions & 6 deletions config/crd/bases/configuration.konghq.com_kongconsumers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,22 @@ spec:
rule: 'self.type == ''konnectID'' ? has(self.konnectID) : true'
type: object
status:
default:
conditions:
- lastTransitionTime: "1970-01-01T00:00:00Z"
message: Waiting for controller
reason: Pending
status: Unknown
type: Accepted
- lastTransitionTime: "1970-01-01T00:00:00Z"
message: Waiting for controller
reason: Pending
status: Unknown
type: Programmed
description: Status represents the current status of the KongConsumer
resource.
properties:
conditions:
default:
- lastTransitionTime: "1970-01-01T00:00:00Z"
message: Waiting for controller
reason: Pending
status: Unknown
type: Programmed
description: |-
Conditions describe the current conditions of the KongConsumer.
Expand Down
22 changes: 14 additions & 8 deletions config/crd/bases/configuration.konghq.com_kongpluginbindings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ spec:
versions:
- additionalPrinterColumns:
- description: Kind of the plugin
jsonPath: .spec.pluginReference.kind
jsonPath: .spec.pluginRef.kind
name: Plugin-kind
type: string
- description: Name of the plugin
jsonPath: .spec.pluginReference.name
jsonPath: .spec.pluginRef.name
name: Plugin-name
type: string
- description: The Resource is Programmed
Expand Down Expand Up @@ -251,16 +251,22 @@ spec:
- targets
type: object
status:
default:
conditions:
- lastTransitionTime: "1970-01-01T00:00:00Z"
message: Waiting for controller
reason: Pending
status: Unknown
type: Accepted
- lastTransitionTime: "1970-01-01T00:00:00Z"
message: Waiting for controller
reason: Pending
status: Unknown
type: Programmed
description: KongPluginBindingStatus represents the current status of
the KongBinding resource.
properties:
conditions:
default:
- lastTransitionTime: "1970-01-01T00:00:00Z"
message: Waiting for controller
reason: Pending
status: Unknown
type: Programmed
description: Conditions describe the status of the Konnect entity.
items:
description: Condition contains details for one aspect of the current
Expand Down
18 changes: 12 additions & 6 deletions config/crd/bases/configuration.konghq.com_kongroutes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,22 @@ spec:
type: array
type: object
status:
default:
conditions:
- lastTransitionTime: "1970-01-01T00:00:00Z"
message: Waiting for controller
reason: Pending
status: Unknown
type: Accepted
- lastTransitionTime: "1970-01-01T00:00:00Z"
message: Waiting for controller
reason: Pending
status: Unknown
type: Programmed
description: KongRouteStatus represents the current status of the Kong
Route resource.
properties:
conditions:
default:
- lastTransitionTime: "1970-01-01T00:00:00Z"
message: Waiting for controller
reason: Pending
status: Unknown
type: Programmed
description: Conditions describe the status of the Konnect entity.
items:
description: Condition contains details for one aspect of the current
Expand Down
18 changes: 12 additions & 6 deletions config/crd/bases/configuration.konghq.com_kongservices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,22 @@ spec:
- host
type: object
status:
default:
conditions:
- lastTransitionTime: "1970-01-01T00:00:00Z"
message: Waiting for controller
reason: Pending
status: Unknown
type: Accepted
- lastTransitionTime: "1970-01-01T00:00:00Z"
message: Waiting for controller
reason: Pending
status: Unknown
type: Programmed
description: KongServiceStatus represents the current status of the Kong
Service resource.
properties:
conditions:
default:
- lastTransitionTime: "1970-01-01T00:00:00Z"
message: Waiting for controller
reason: Pending
status: Unknown
type: Programmed
description: Conditions describe the status of the Konnect entity.
items:
description: Condition contains details for one aspect of the current
Expand Down

0 comments on commit 53446b8

Please sign in to comment.