Kong / gateway-operator

Kubernetes Operator for Kong Gateways
Apache License 2.0
41 stars 9 forks source link

Add `app` label to all `DataPlane` and `ControlPlane` owned resources #157

Open czeslavo opened 9 months ago

czeslavo commented 9 months ago

Problem Statement

Currently, it's not possible to list some of DataPlane and ControlPlane -owned resources with use of the app label because it's not assigned consistently to all of them. Example of a resource that do not have the app label assigned: cluster certificate Secret,

Proposed Solution

Make sure that all of the resources owned by DataPlane and ControlPlane do have the app label assigned with a value equal to the parent's name.

Acceptance Criteria

pmalek commented 9 months ago

After checking this it seems that we do this at least for Deployments in https://github.com/Kong/gateway-operator/blob/f6badbef64ac96c78d381f86a48b5b8a60ec4d70/internal/utils/kubernetes/resources/deployments.go#L186 and https://github.com/Kong/gateway-operator/blob/f6badbef64ac96c78d381f86a48b5b8a60ec4d70/internal/utils/kubernetes/resources/deployments.go#L42. We might need to check this for other resources as well though to verify.

pmalek commented 9 months ago

Where we're not using this is for Deployment listing https://github.com/Kong/gateway-operator/blob/f6badbef64ac96c78d381f86a48b5b8a60ec4d70/controllers/dataplane_owned_resources.go#L59-L72, and ingress Service listing https://github.com/Kong/gateway-operator/blob/f6badbef64ac96c78d381f86a48b5b8a60ec4d70/controllers/dataplane_owned_resources.go#L282-L295