Repository: Kong/gateway-operator
Pull request #1326: Fix conflict for "deps: bump kubernetes-configuration to include last KonnectExtension schema changes"
Author: login: randmonkey
Labels: name: area/konnect-DPs
Created: 2025-03-11T07:44:29Z | Merged: 2025-03-11T09:05:53Z

**What this PR does / why we need it**:
Follow up of #1319. Fixed the conflict in that PR.
**Which issue this PR fixes**

Fixes #

**Special notes for your reviewer**:

**PR Readiness Checklist**:

Complete these before marking the PR as `ready to review`:

- [ ] the `CHANGELOG.md` release notes have been updated to reflect significant changes



Diff:
diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml
index 12b43360fb..34b1ddc4bb 100644
--- a/config/crd/kustomization.yaml
+++ b/config/crd/kustomization.yaml
@@ -2,4 +2,4 @@
 apiVersion: kustomize.config.k8s.io/v1beta1
 kind: Kustomization
 resources:
-  - https://github.com/kong/kubernetes-configuration/config/crd/gateway-operator?ref=b306019a0fb04e04f610c673a000725faab95b4b # Version is auto-updated by the generating script.
+  - https://github.com/kong/kubernetes-configuration/config/crd/gateway-operator?ref=da21a286cd79d5c7decf1e64c8f801567fb57d0b # Version is auto-updated by the generating script.
diff --git a/config/samples/controlplane-konnect-extension.yaml b/config/samples/controlplane-konnect-extension.yaml
index 3cd88eac66..79b2fb9fcd 100644
--- a/config/samples/controlplane-konnect-extension.yaml
+++ b/config/samples/controlplane-konnect-extension.yaml
@@ -37,18 +37,19 @@ metadata:
   annotations:
     konghq.com/override: "true"
 spec:
-  konnectControlPlane:
-    controlPlaneRef:
-      type: konnectID
-      konnectID: c846c30c-77da-40e6-b0c8-66ed7e16c497
-  dataPlaneClientAuth:
+  konnect:
+    controlPlane:
+      ref:
+        type: konnectID
+        konnectID: c846c30c-77da-40e6-b0c8-66ed7e16c497
+    configuration:
+      authRef:
+        name: konnect-api-auth-dev-1
+  clientAuth:
     certificateSecret:
       provisioning: Manual
       secretRef:
-        name: konnect-client-tls
-  konnect:
-    authRef:
-      name: konnect-api-auth-dev-1
+        name: konnect-client-tls    
 ---
 apiVersion: gateway-operator.konghq.com/v1beta1
 kind: ControlPlane
diff --git a/config/samples/dataplane-konnect-extension.yaml b/config/samples/dataplane-konnect-extension.yaml
index 574460540e..9fddfa1824 100644
--- a/config/samples/dataplane-konnect-extension.yaml
+++ b/config/samples/dataplane-konnect-extension.yaml
@@ -31,18 +31,19 @@ metadata:
   name: my-konnect-config
   namespace: default
 spec:
-  konnectControlPlane:
-    controlPlaneRef:
-      type: konnectID
-      konnectID: a6554c4c-79a6-4db7-b7a4-201c0cf746ba 
-  dataPlaneClientAuth:
+  konnect:
+    controlPlane:
+      ref:
+        type: konnectID
+        konnectID: a6554c4c-79a6-4db7-b7a4-201c0cf746ba
+    configuration:
+      authRef:
+        name: konnect-api-auth-dev-1
+  clientAuth:
     certificateSecret:
       provisioning: Manual
       secretRef:
-        name: konnect-client-tls
-  konnect:
-    authRef:
-      name: konnect-api-auth-dev-1
+        name: konnect-client-tls    
 ---
 apiVersion: gateway-operator.konghq.com/v1beta1
 kind: DataPlane
diff --git a/controller/konnect/index_konnectextension.go b/controller/konnect/index_konnectextension.go
index df747c42fb..1ac3a80eea 100644
--- a/controller/konnect/index_konnectextension.go
+++ b/controller/konnect/index_konnectextension.go
@@ -43,11 +43,11 @@ func konnectExtensionAPIAuthConfigurationRef(object client.Object) []string {
 		return nil
 	}
 
-	if ext.Spec.KonnectConfiguration == nil {
+	if ext.Spec.Konnect.Configuration == nil {
 		return nil
 	}
 
-	return []string{ext.Spec.KonnectConfiguration.APIAuthConfigurationRef.Name}
+	return []string{ext.Spec.Konnect.Configuration.APIAuthConfigurationRef.Name}
 }
 
 func konnectExtensionSecretRef(obj client.Object) []string {
@@ -56,12 +56,12 @@ func konnectExtensionSecretRef(obj client.Object) []string {
 		return nil
 	}
 
-	if ext.Spec.DataPlaneClientAuth == nil ||
-		ext.Spec.DataPlaneClientAuth.CertificateSecret.CertificateSecretRef == nil {
+	if ext.Spec.ClientAuth == nil ||
+		ext.Spec.ClientAuth.CertificateSecret.CertificateSecretRef == nil {
 		return nil
 	}
 
-	return []string{ext.Spec.DataPlaneClientAuth.CertificateSecret.CertificateSecretRef.Name}
+	return []string{ext.Spec.ClientAuth.CertificateSecret.CertificateSecretRef.Name}
 }
 
 func konnectExtensionControlPlaneRef(obj client.Object) []string {
@@ -70,9 +70,9 @@ func konnectExtensionControlPlaneRef(obj client.Object) []string {
 		return nil
 	}
 
-	if ext.Spec.KonnectControlPlane.ControlPlaneRef.Type != commonv1alpha1.ControlPlaneRefKonnectNamespacedRef {
+	if ext.Spec.Konnect.ControlPlane.Ref.Type != commonv1alpha1.ControlPlaneRefKonnectNamespacedRef {
 		return nil
 	}
 	// TODO: add namespace to index when cross namespace reference is supported.
-	return []string{ext.Spec.KonnectControlPlane.ControlPlaneRef.KonnectNamespacedRef.Name}
+	return []string{ext.Spec.Konnect.ControlPlane.Ref.KonnectNamespacedRef.Name}
 }
diff --git a/controller/konnect/konnectextension_controller.go b/controller/konnect/konnectextension_controller.go
index c65834ebc7..006a99afe7 100644
--- a/controller/konnect/konnectextension_controller.go
+++ b/controller/konnect/konnectextension_controller.go
@@ -455,7 +455,7 @@ func (r *KonnectExtensionReconciler) Reconcile(ctx context.Context, req ctrl.Req
 			dpCert := konnectresource.GenerateKongDataPlaneClientCertificate(
 				certificateSecret.Name,
 				certificateSecret.Namespace,
-				&ext.Spec.KonnectControlPlane.ControlPlaneRef,
+				&ext.Spec.Konnect.ControlPlane.Ref,
 				string(certificateSecret.Data[consts.TLSCRT]),
 				func(dpCert *configurationv1alpha1.KongDataPlaneClientCertificate) {
 					dpCert.Status.Konnect = &konnectv1alpha1.KonnectEntityStatusWithControlPlaneRef{
@@ -500,7 +500,7 @@ func (r *KonnectExtensionReconciler) Reconcile(ctx context.Context, req ctrl.Req
 			dpCert := konnectresource.GenerateKongDataPlaneClientCertificate(
 				certificateSecret.Name,
 				certificateSecret.Namespace,
-				&ext.Spec.KonnectControlPlane.ControlPlaneRef,
+				&ext.Spec.Konnect.ControlPlane.Ref,
 				string(certificateSecret.Data[consts.TLSCRT]),
 				func(dpCert *configurationv1alpha1.KongDataPlaneClientCertificate) {
 					dpCert.Status.Konnect = &konnectv1alpha1.KonnectEntityStatusWithControlPlaneRef{
diff --git a/controller/konnect/konnectextension_controller_secrets.go b/controller/konnect/konnectextension_controller_secrets.go
index 3bd94d529f..300dda1d0e 100644
--- a/controller/konnect/konnectextension_controller_secrets.go
+++ b/controller/konnect/konnectextension_controller_secrets.go
@@ -47,9 +47,9 @@ func enqueueKonnectExtensionsForSecret(cl client.Client) func(context.Context, c
 
 		reqs := make([]reconcile.Request, 0, len(konnectExtensions))
 		for _, ke := range konnectExtensions {
-			if ke.Spec.DataPlaneClientAuth != nil &&
-				ke.Spec.DataPlaneClientAuth.CertificateSecret.CertificateSecretRef != nil &&
-				ke.Spec.DataPlaneClientAuth.CertificateSecret.CertificateSecretRef.Name == obj.GetName() {
+			if ke.Spec.ClientAuth != nil &&
+				ke.Spec.ClientAuth.CertificateSecret.CertificateSecretRef != nil &&
+				ke.Spec.ClientAuth.CertificateSecret.CertificateSecretRef.Name == obj.GetName() {
 				reqs = append(reqs, reconcile.Request{
 					NamespacedName: k8stypes.NamespacedName{
 						Namespace: ke.Namespace,
diff --git a/controller/konnect/konnectextension_controller_utils.go b/controller/konnect/konnectextension_controller_utils.go
index b445702b3b..3a110f166a 100644
--- a/controller/konnect/konnectextension_controller_utils.go
+++ b/controller/konnect/konnectextension_controller_utils.go
@@ -55,11 +55,11 @@ func (r *KonnectExtensionReconciler) getKonnectControlPlane(
 		}
 	)
 
-	switch ext.Spec.KonnectControlPlane.ControlPlaneRef.Type {
+	switch ext.Spec.Konnect.ControlPlane.Ref.Type {
 	case commonv1alpha1.ControlPlaneRefKonnectNamespacedRef:
 		// in case the ControlPlaneRef is a KonnectNamespacedRef, we fetch the KonnectGatewayControlPlane
 		// and get the KonnectID from `status.konnectID`.
-		cpRef := ext.Spec.KonnectControlPlane.ControlPlaneRef.KonnectNamespacedRef
+		cpRef := ext.Spec.Konnect.ControlPlane.Ref.KonnectNamespacedRef
 		cpNamepace := ext.Namespace
 		// TODO: get namespace from cpRef.Namespace when allowed to reference CP from another namespace.
 		kgcp := &konnectv1alpha1.KonnectGatewayControlPlane{}
@@ -105,7 +105,7 @@ func (r *KonnectExtensionReconciler) getKonnectControlPlane(
 		konnectCPID = kgcp.GetKonnectID()
 	case commonv1alpha1.ControlPlaneRefKonnectID:
 		// in case the ControlPlaneRef is a KonnectID, we use it directly.
-		konnectCPID = *ext.Spec.KonnectControlPlane.ControlPlaneRef.KonnectID
+		konnectCPID = *ext.Spec.Konnect.ControlPlane.Ref.KonnectID
 	}
 
 	// get the Konnect Control Plane from Konnect
@@ -213,11 +213,11 @@ func (r *KonnectExtensionReconciler) ensureExtendablesReferencesInStatus(
 }
 
 func getKonnectAPIAuthRefNN(ctx context.Context, cl client.Client, ext *konnectv1alpha1.KonnectExtension) (types.NamespacedName, error) {
-	if ext.Spec.KonnectConfiguration != nil {
+	if ext.Spec.Konnect.Configuration != nil {
 		// TODO: handle cross namespace refs when supported.
 		return types.NamespacedName{
 			Namespace: ext.Namespace,
-			Name:      ext.Spec.KonnectConfiguration.APIAuthConfigurationRef.Name,
+			Name:      ext.Spec.Konnect.Configuration.APIAuthConfigurationRef.Name,
 		}, nil
 	}
 
@@ -225,7 +225,7 @@ func getKonnectAPIAuthRefNN(ctx context.Context, cl client.Client, ext *konnectv
 	// and get the KonnectConfiguration from `spec.konnectControlPlane.controlPlane.konnectNamespacedRef`.
 	// KonnectGatewayControlPlane reference and KonnectConfiguration
 	// are mutually exclusive in the KonnectExtension API.
-	cpRef := ext.Spec.KonnectControlPlane.ControlPlaneRef.KonnectNamespacedRef
+	cpRef := ext.Spec.Konnect.ControlPlane.Ref.KonnectNamespacedRef
 	kgcp := &konnectv1alpha1.KonnectGatewayControlPlane{}
 	err := cl.Get(ctx, client.ObjectKey{
 		// TODO: handle cross namespace refs to KonnectGatewayControlPlane when referencing CP from another namespace is supported.
@@ -243,12 +243,12 @@ func getKonnectAPIAuthRefNN(ctx context.Context, cl client.Client, ext *konnectv
 
 func getCertificateSecret(ctx context.Context, cl client.Client, ext konnectv1alpha1.KonnectExtension) (*corev1.Secret, error) {
 	var certificateSecret corev1.Secret
-	switch *ext.Spec.DataPlaneClientAuth.CertificateSecret.Provisioning {
+	switch *ext.Spec.ClientAuth.CertificateSecret.Provisioning {
 	case konnectv1alpha1.ManualSecretProvisioning:
 		// No need to check CertificateSecretRef is nil, as it is enforced at the CRD level.
 		if err := cl.Get(ctx, types.NamespacedName{
 			Namespace: ext.Namespace,
-			Name:      ext.Spec.DataPlaneClientAuth.CertificateSecret.CertificateSecretRef.Name,
+			Name:      ext.Spec.ClientAuth.CertificateSecret.CertificateSecretRef.Name,
 		}, &certificateSecret); err != nil {
 			return nil, err
 		}
diff --git a/controller/pkg/extensions/konnect/dataplane.go b/controller/pkg/extensions/konnect/dataplane.go
index b562d4b6dc..6689cfa04c 100644
--- a/controller/pkg/extensions/konnect/dataplane.go
+++ b/controller/pkg/extensions/konnect/dataplane.go
@@ -56,7 +56,11 @@ func ApplyDataPlaneKonnectExtension(ctx context.Context, cl client.Client, dataP
 	d.WithVolumeMount(kongInKonnectClusterVolumeMount(), consts.DataPlaneProxyContainerName)
 
 	// KonnectID is the only supported type for now, and its presence is guaranteed by a proper CEL rule.
-	envSet := config.KongInKonnectDefaults(konnectExtension.Spec.DataPlaneLabels, konnectExtension.Status)
+	var dataplaneLabels map[string]konnectv1alpha1.DataPlaneLabelValue
+	if konnectExtension.Spec.Konnect.DataPlane != nil {
+		dataplaneLabels = konnectExtension.Spec.Konnect.DataPlane.Labels
+	}
+	envSet := config.KongInKonnectDefaults(dataplaneLabels, konnectExtension.Status)
 
 	config.FillContainerEnvs(nil, &d.Spec.Template, consts.DataPlaneProxyContainerName, config.EnvVarMapToSlice(envSet))
 	dataPlane.Spec.Deployment.PodTemplateSpec = &d.Spec.Template
diff --git a/controller/pkg/extensions/konnect/konnectextension_test.go b/controller/pkg/extensions/konnect/konnectextension_test.go
index 537372cd2a..680f5fbe6b 100644
--- a/controller/pkg/extensions/konnect/konnectextension_test.go
+++ b/controller/pkg/extensions/konnect/konnectextension_test.go
@@ -297,9 +297,13 @@ func TestApplyDataPlaneKonnectExtension(t *testing.T) {
 					Namespace: "default",
 				},
 				Spec: konnectv1alpha1.KonnectExtensionSpec{
-					DataPlaneLabels: map[string]konnectv1alpha1.DataPlaneLabelValue{
-						"environment": "prod",
-						"region":      "us-west",
+					Konnect: konnectv1alpha1.KonnectExtensionKonnectSpec{
+						DataPlane: &konnectv1alpha1.KonnectExtensionDataPlane{
+							Labels: map[string]konnectv1alpha1.DataPlaneLabelValue{
+								"environment": "prod",
+								"region":      "us-west",
+							},
+						},
 					},
 				},
 				Status: konnectExtensionStatus,
@@ -407,11 +411,16 @@ func getKongInKonnectEnvVars(
 	konnectExt konnectv1alpha1.KonnectExtension,
 ) []corev1.EnvVar {
 	envSet := []corev1.EnvVar{}
-	for k, v := range config.KongInKonnectDefaults(konnectExt.Spec.DataPlaneLabels, konnectExt.Status) {
+	var dataplaneLabels map[string]konnectv1alpha1.DataPlaneLabelValue
+	if konnectExt.Spec.Konnect.DataPlane != nil {
+		dataplaneLabels = konnectExt.Spec.Konnect.DataPlane.Labels
+	}
+	for k, v := range config.KongInKonnectDefaults(dataplaneLabels, konnectExt.Status) {
 		envSet = append(envSet, corev1.EnvVar{
 			Name:  k,
 			Value: v,
 		})
 	}
+
 	return envSet
 }
diff --git a/go.mod b/go.mod
index 7d8ffcf9d3..cfef7ff8ee 100644
--- a/go.mod
+++ b/go.mod
@@ -19,7 +19,7 @@ require (
 	github.com/google/go-containerregistry v0.20.3
 	github.com/google/uuid v1.6.0
 	github.com/gruntwork-io/terratest v0.48.2
-	github.com/kong/kubernetes-configuration v1.2.0-rc.1.0.20250307064319-b306019a0fb0
+	github.com/kong/kubernetes-configuration v1.2.0-rc.1.0.20250307130251-da21a286cd79
 	github.com/kong/kubernetes-telemetry v0.1.9
 	github.com/kong/kubernetes-testing-framework v0.47.2
 	github.com/kong/semver/v4 v4.0.1
diff --git a/go.sum b/go.sum
index 002bdc28a0..8f483de3d5 100644
--- a/go.sum
+++ b/go.sum
@@ -309,8 +309,8 @@ github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IX
 github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
 github.com/kong/go-kong v0.63.0 h1:8ECLgkgDqON61qCMq/M0gTwZKYxg55Oy692dRDOOBiU=
 github.com/kong/go-kong v0.63.0/go.mod h1:ma9GWnhkxtrXZlLFfED955HjVzmUojYEHet3lm+PDik=
-github.com/kong/kubernetes-configuration v1.2.0-rc.1.0.20250307064319-b306019a0fb0 h1:FTwYOmCf9T7hCpPrPikyMHOd9QDHWnH5/wcUm/BdiyA=
-github.com/kong/kubernetes-configuration v1.2.0-rc.1.0.20250307064319-b306019a0fb0/go.mod h1:cuTkt7TTyMpufn7aPHO1LsTCYTmJsuLegc1/Ir16jBE=
+github.com/kong/kubernetes-configuration v1.2.0-rc.1.0.20250307130251-da21a286cd79 h1:tj+zlNrJJdOjxi4PwqbCDfzUo32qplFArQTFGP4WbN8=
+github.com/kong/kubernetes-configuration v1.2.0-rc.1.0.20250307130251-da21a286cd79/go.mod h1:cuTkt7TTyMpufn7aPHO1LsTCYTmJsuLegc1/Ir16jBE=
 github.com/kong/kubernetes-telemetry v0.1.9 h1:XbDMZjZZclHO4oyJGW1mmZ6bzbTnANjcRAYsBg+jpno=
 github.com/kong/kubernetes-telemetry v0.1.9/go.mod h1:lBSbaQdJkoMMO0d+cJWopoJiJ+QHFBttbhCp5VRibJ8=
 github.com/kong/kubernetes-testing-framework v0.47.2 h1:+2Z9anTpbV/hwNeN+NFQz53BMU+g3QJydkweBp3tULo=
diff --git a/test/helpers/deploy/deploy_resources.go b/test/helpers/deploy/deploy_resources.go
index 0952ad65cd..ddc962d0fd 100644
--- a/test/helpers/deploy/deploy_resources.go
+++ b/test/helpers/deploy/deploy_resources.go
@@ -1047,8 +1047,8 @@ func KonnectExtensionRefencingKonnectGatewayControlPlane(
 			ke, ok := obj.(*konnectv1alpha1.KonnectExtension)
 			require.Truef(t, ok, "Expect object %s/%s to be a KonnectExtension, actual type %T",
 				obj.GetNamespace(), obj.GetName(), obj)
-			ke.Spec.KonnectControlPlane = konnectv1alpha1.KonnectExtensionControlPlane{
-				ControlPlaneRef: commonv1alpha1.ControlPlaneRef{
+			ke.Spec.Konnect.ControlPlane = konnectv1alpha1.KonnectExtensionControlPlane{
+				Ref: commonv1alpha1.ControlPlaneRef{
 					Type: commonv1alpha1.ControlPlaneRefKonnectNamespacedRef,
 					KonnectNamespacedRef: &commonv1alpha1.KonnectNamespacedRef{
 						Name:      cp.Name,


Reviews:
user: login: pmalek
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-11T08:38:37Z
user: login: randmonkey
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-11T08:44:28Z
user: login: pmalek
state: APPROVED
author_association: MEMBER
submitted_at: 2025-03-11T08:48:51Z
user: login: mlavacca
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-11T09:07:47Z
user: login: mlavacca
state: APPROVED
author_association: MEMBER
submitted_at: 2025-03-11T09:07:51Z

Review comments:
diff_hunk: @@ -407,11 +411,16 @@ func getKongInKonnectEnvVars(
 	konnectExt konnectv1alpha1.KonnectExtension,
 ) []corev1.EnvVar {
 	envSet := []corev1.EnvVar{}
-	for k, v := range config.KongInKonnectDefaults(konnectExt.Spec.DataPlaneLabels, konnectExt.Status) {
+	var dataplaneLabels map[string]konnectv1alpha1.DataPlaneLabelValue
+	if konnectExt.Spec.Konnect.DataPlane != nil {
+		dataplaneLabels = konnectExt.Spec.Konnect.DataPlane.Labels
+	}
+	for k, v := range config.KongInKonnectDefaults(dataplaneLabels, konnectExt.Status) {
path: controller/pkg/extensions/konnect/konnectextension_test.go
user: login: pmalek
body: Wouldn't this

```suggestion
	for k, v := range config.KongInKonnectDefaults(konnectExt.Spec.Konnect.DataPlane.Labels, konnectExt.Status) {
```

be equivalent? (same in the implementation in `controller/pkg/extensions/konnect/dataplane.go`)

I'm not sure I see the reason for using the additional variable here 🤔 
created_at: 2025-03-11T08:38:15Z
author_association: MEMBER
diff_hunk: @@ -407,11 +411,16 @@ func getKongInKonnectEnvVars(
 	konnectExt konnectv1alpha1.KonnectExtension,
 ) []corev1.EnvVar {
 	envSet := []corev1.EnvVar{}
-	for k, v := range config.KongInKonnectDefaults(konnectExt.Spec.DataPlaneLabels, konnectExt.Status) {
+	var dataplaneLabels map[string]konnectv1alpha1.DataPlaneLabelValue
+	if konnectExt.Spec.Konnect.DataPlane != nil {
+		dataplaneLabels = konnectExt.Spec.Konnect.DataPlane.Labels
+	}
+	for k, v := range config.KongInKonnectDefaults(dataplaneLabels, konnectExt.Status) {
path: controller/pkg/extensions/konnect/konnectextension_test.go
user: login: randmonkey
body: Looks like it is used for preventing `panic`s when `spec.konnect.dataPlane` is not specified since it is not required.
created_at: 2025-03-11T08:44:28Z
author_association: CONTRIBUTOR
diff_hunk: @@ -407,11 +411,16 @@ func getKongInKonnectEnvVars(
 	konnectExt konnectv1alpha1.KonnectExtension,
 ) []corev1.EnvVar {
 	envSet := []corev1.EnvVar{}
-	for k, v := range config.KongInKonnectDefaults(konnectExt.Spec.DataPlaneLabels, konnectExt.Status) {
+	var dataplaneLabels map[string]konnectv1alpha1.DataPlaneLabelValue
+	if konnectExt.Spec.Konnect.DataPlane != nil {
+		dataplaneLabels = konnectExt.Spec.Konnect.DataPlane.Labels
+	}
+	for k, v := range config.KongInKonnectDefaults(dataplaneLabels, konnectExt.Status) {
path: controller/pkg/extensions/konnect/konnectextension_test.go
user: login: pmalek
body: Oh, yes. I missed that.

I think that would could change the `KongInKonnectDefaults` to accept `konnectExtension.Spec.Konnect.DataPlane` ( move this `nil` check to the function itself). This would make the call site a bit clearer. I'm fine if we don't do it in this PR though.
created_at: 2025-03-11T08:48:45Z
author_association: MEMBER
diff_hunk: @@ -407,11 +411,16 @@ func getKongInKonnectEnvVars(
 	konnectExt konnectv1alpha1.KonnectExtension,
 ) []corev1.EnvVar {
 	envSet := []corev1.EnvVar{}
-	for k, v := range config.KongInKonnectDefaults(konnectExt.Spec.DataPlaneLabels, konnectExt.Status) {
+	var dataplaneLabels map[string]konnectv1alpha1.DataPlaneLabelValue
+	if konnectExt.Spec.Konnect.DataPlane != nil {
+		dataplaneLabels = konnectExt.Spec.Konnect.DataPlane.Labels
+	}
+	for k, v := range config.KongInKonnectDefaults(dataplaneLabels, konnectExt.Status) {
path: controller/pkg/extensions/konnect/konnectextension_test.go
user: login: mlavacca
body: Yes, that's needed to prevent panic in case the dataplane is not set
created_at: 2025-03-11T09:07:47Z
author_association: MEMBER

PR comments:
user: login: pmalek
created_at: 2025-03-11T08:39:37Z
body: @randmonkey Should we close #1319 in favor of this one?
author_association: MEMBER
user: login: randmonkey
created_at: 2025-03-11T08:45:06Z
body: > @randmonkey Should we close #1319 in favor of this one?

If @mlavacca thinks it is OK to continue on this one, we can close #1319.
author_association: CONTRIBUTOR