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

feat: DataPlaneKonnectExtension renamed to KonnectExtension #736

Merged
merged 2 commits into from
Oct 11, 2024
Merged
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
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@
[#657](https://github.com/Kong/gateway-operator/pull/657)
- Add `KongDataPlaneClientCertificate` reconciler for Konnect DataPlaneClientCertificates.
[#694](https://github.com/Kong/gateway-operator/pull/694)
- The `DataPlaneKonnectExtension` CRD has been introduced. Such a CRD can be attached
- The `KonnectExtension` CRD has been introduced. Such a CRD can be attached
to a `DataPlane` via the extensions field to have a konnect-flavored `DataPlane`.
[#453](https://github.com/Kong/gateway-operator/pull/453), [#578](https://github.com/Kong/gateway-operator/pull/578)
[#453](https://github.com/Kong/gateway-operator/pull/453),
[#578](https://github.com/Kong/gateway-operator/pull/578),
[#736](https://github.com/Kong/gateway-operator/pull/736)
- Entities created in Konnect are now labeled (or tagged for those that does not
support labels) with origin Kubernetes object's metadata: `k8s-name`, `k8s-namespace`,
`k8s-uid`, `k8s-generation`, `k8s-kind`, `k8s-group`, `k8s-version`.
Expand Down Expand Up @@ -101,7 +103,7 @@
[#669](https://github.com/Kong/gateway-operator/pull/669)
- Allow setting `KonnectGatewayControlPlane`s group membership
[#697](https://github.com/Kong/gateway-operator/pull/697)
- Apply Konnect-related customizations to `DataPlane`s that properly reference `DataPlaneKonnectExtension`
- Apply Konnect-related customizations to `DataPlane`s that properly reference `KonnectExtension`
resources.
[#714](https://github.com/Kong/gateway-operator/pull/714)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ import (
)

func init() {
SchemeBuilder.Register(&DataPlaneKonnectExtension{}, &DataPlaneKonnectExtensionList{})
SchemeBuilder.Register(&KonnectExtension{}, &KonnectExtensionList{})
}

const (
// DataPlaneKonnectExtensionKind holds the kind for the DataPlaneKonnectExtension.
DataPlaneKonnectExtensionKind = "DataPlaneKonnectExtension"
// KonnectExtensionKind holds the kind for the KonnectExtension.
KonnectExtensionKind = "KonnectExtension"
)

// +genclient
Expand All @@ -34,36 +34,36 @@ const (
// +kubebuilder:resource:categories=kong;all
// +kubebuilder:subresource:status

// DataPlaneKonnectExtension is the Schema for the dataplanekonnectextension API,
// KonnectExtension is the Schema for the KonnectExtension API,
// and is intended to be referenced as extension by the dataplane API.
// If a DataPlane successfully refers a DataPlaneKonnectExtension, the DataPlane
// If a DataPlane successfully refers a KonnectExtension, the DataPlane
// deployment spec gets customized to include the konnect-related configuration.
// +kubebuilder:validation:XValidation:rule="oldSelf.spec.controlPlaneRef == self.spec.controlPlaneRef", message="spec.controlPlaneRef is immutable."
// +apireference:kgo:include
type DataPlaneKonnectExtension struct {
type KonnectExtension struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

// Spec is the specification of the DataPlaneKonnectExtension resource.
Spec DataPlaneKonnectExtensionSpec `json:"spec,omitempty"`
// Status is the status of the DataPlaneKonnectExtension resource.
Status DataPlaneKonnectExtensionStatus `json:"status,omitempty"`
// Spec is the specification of the KonnectExtension resource.
Spec KonnectExtensionSpec `json:"spec,omitempty"`
// Status is the status of the KonnectExtension resource.
Status KonnectExtensionStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true

// DataPlaneKonnectExtensionList contains a list of DataPlaneKonnectExtension.
// KonnectExtensionList contains a list of KonnectExtension.
// +apireference:kgo:include
type DataPlaneKonnectExtensionList struct {
type KonnectExtensionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []DataPlaneKonnectExtension `json:"items"`
Items []KonnectExtension `json:"items"`
}

// DataPlaneKonnectExtensionSpec defines the desired state of DataPlaneKonnectExtension.
// KonnectExtensionSpec defines the desired state of KonnectExtension.
// +apireference:kgo:include
type DataPlaneKonnectExtensionSpec struct {
// ControlPlaneRef is a reference to a ControlPlane this DataPlaneKonnectExtension is associated with.
type KonnectExtensionSpec struct {
// ControlPlaneRef is a reference to a ControlPlane this KonnectExtension is associated with.
// +kubebuilder:validation:Required
// +kubebuilder:validation:XValidation:rule="self.type == 'konnectID'", message="Only konnectID type currently supported as controlPlaneRef."
ControlPlaneRef configurationv1alpha1.ControlPlaneRef `json:"controlPlaneRef"`
Expand Down Expand Up @@ -113,9 +113,9 @@ type ClusterCertificateSecretRef struct {
Name string `json:"name"`
}

// DataPlaneKonnectExtensionStatus defines the observed state of DataPlaneKonnectExtension.
// KonnectExtensionStatus defines the observed state of KonnectExtension.
// +apireference:kgo:include
type DataPlaneKonnectExtensionStatus struct {
type KonnectExtensionStatus struct {
// DataPlaneRefs is the array of DataPlane references this is associated with.
// A new reference is set by the operator when this extension is associated with
// a DataPlane through its extensions spec.
Expand Down
210 changes: 105 additions & 105 deletions api/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 api/v1beta1/dataplane_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func init() {
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:shortName=kodp,categories=kong;all
// +kubebuilder:validation:XValidation:message="Extension not allowed for DataPlane",rule="has(self.spec.extensions) ? self.spec.extensions.all(e, e.group == 'gateway-operator.konghq.com' && e.kind == 'DataPlaneKonnectExtension') : true"
// +kubebuilder:validation:XValidation:message="Extension not allowed for DataPlane",rule="has(self.spec.extensions) ? self.spec.extensions.all(e, e.group == 'gateway-operator.konghq.com' && e.kind == 'KonnectExtension') : true"
// +kubebuilder:printcolumn:name="Ready",description="The Resource is ready",type=string,JSONPath=`.status.conditions[?(@.type=='Ready')].status`

// DataPlane is the Schema for the dataplanes API
Expand Down Expand Up @@ -78,7 +78,7 @@ type DataPlaneOptions struct {

// Extensions provide additional or replacement features for the DataPlane
// resources to influence or enhance functionality.
// NOTE: since we have one extension only (DataPlaneKonnectExtension), we limit the amount of extensions to 1.
// NOTE: since we have one extension only (KonnectExtension), we limit the amount of extensions to 1.
//
// +optional
// +kubebuilder:validation:MinItems=0
Expand Down
4 changes: 2 additions & 2 deletions api/v1beta1/gatewayconfiguration_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func init() {
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:shortName=kogc,categories=kong;all
// +kubebuilder:validation:XValidation:message="Extension not allowed for DataPlane config options",rule="has(self.spec.dataPlaneOptions.extensions) ? self.spec.dataPlaneOptions.extensions.all(e, e.group == 'gateway-operator.konghq.com' && e.kind == 'DataPlaneKonnectExtension') : true"
// +kubebuilder:validation:XValidation:message="Extension not allowed for DataPlane config options",rule="has(self.spec.dataPlaneOptions.extensions) ? self.spec.dataPlaneOptions.extensions.all(e, e.group == 'gateway-operator.konghq.com' && e.kind == 'KonnectExtension') : true"

// GatewayConfiguration is the Schema for the gatewayconfigurations API
// +apireference:kgo:include
Expand Down Expand Up @@ -70,7 +70,7 @@ type GatewayConfigDataPlaneOptions struct {

// Extensions provide additional or replacement features for the DataPlane
// resources to influence or enhance functionality.
// NOTE: since we have one extension only (DataPlaneKonnectExtension), we limit the amount of extensions to 1.
// NOTE: since we have one extension only (KonnectExtension), we limit the amount of extensions to 1.
//
// +optional
// +kubebuilder:validation:MinItems=0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8773,7 +8773,7 @@ spec:
description: |-
Extensions provide additional or replacement features for the DataPlane
resources to influence or enhance functionality.
NOTE: since we have one extension only (DataPlaneKonnectExtension), we limit the amount of extensions to 1.
NOTE: since we have one extension only (KonnectExtension), we limit the amount of extensions to 1.
items:
description: |-
ExtensionRef corresponds to another resource in the Kubernetes cluster which
Expand Down Expand Up @@ -9329,8 +9329,7 @@ spec:
x-kubernetes-validations:
- message: Extension not allowed for DataPlane
rule: 'has(self.spec.extensions) ? self.spec.extensions.all(e, e.group ==
''gateway-operator.konghq.com'' && e.kind == ''DataPlaneKonnectExtension'')
: true'
''gateway-operator.konghq.com'' && e.kind == ''KonnectExtension'') : true'
served: true
storage: true
subresources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17066,7 +17066,7 @@ spec:
description: |-
Extensions provide additional or replacement features for the DataPlane
resources to influence or enhance functionality.
NOTE: since we have one extension only (DataPlaneKonnectExtension), we limit the amount of extensions to 1.
NOTE: since we have one extension only (KonnectExtension), we limit the amount of extensions to 1.
items:
description: |-
ExtensionRef corresponds to another resource in the Kubernetes cluster which
Expand Down Expand Up @@ -17263,7 +17263,7 @@ spec:
x-kubernetes-validations:
- message: Extension not allowed for DataPlane config options
rule: 'has(self.spec.dataPlaneOptions.extensions) ? self.spec.dataPlaneOptions.extensions.all(e,
e.group == ''gateway-operator.konghq.com'' && e.kind == ''DataPlaneKonnectExtension'')
e.group == ''gateway-operator.konghq.com'' && e.kind == ''KonnectExtension'')
: true'
served: true
storage: true
Expand Down
Loading
Loading