diff --git a/go.mod b/go.mod index 075e87a7..b8c6c456 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( k8s.io/apimachinery v0.30.3 k8s.io/client-go v0.30.3 knative.dev/hack v0.0.0-20241010131451-05b2fb30cb4d - knative.dev/operator v0.42.1-0.20241003213123-6dce5ef96d7c + knative.dev/operator v0.42.1-0.20241010181608-36698ccd6a79 knative.dev/pkg v0.0.0-20241010131207-e0f65ceabc68 ) diff --git a/go.sum b/go.sum index 8d327742..3697c124 100644 --- a/go.sum +++ b/go.sum @@ -1294,8 +1294,8 @@ knative.dev/caching v0.0.0-20240923134629-abecea6b8cbe h1:Ay4WnT6wJ4TnO/OrXfFPlm knative.dev/caching v0.0.0-20240923134629-abecea6b8cbe/go.mod h1:6XpJds6qbOPSMyGbj7yaDZNQ3CfByAvi8H4gWk1w+sw= knative.dev/hack v0.0.0-20241010131451-05b2fb30cb4d h1:aCfX7kwkvgGxXXGbso5tLqdwQmzBkJ9d+EIRwksKTvk= knative.dev/hack v0.0.0-20241010131451-05b2fb30cb4d/go.mod h1:R0ritgYtjLDO9527h5vb5X6gfvt5LCrJ55BNbVDsWiY= -knative.dev/operator v0.42.1-0.20241003213123-6dce5ef96d7c h1:xMmPL4WYZrP1LHDLNbS7wf6u8A4EH6Pp0UE/W9rj1LU= -knative.dev/operator v0.42.1-0.20241003213123-6dce5ef96d7c/go.mod h1:LFsHBfoWxlMdHRRKAuLURtCQTRjNN0ImB9MlwU7G6+A= +knative.dev/operator v0.42.1-0.20241010181608-36698ccd6a79 h1:R56sqHmHy7h0MpCTc6gQNg3ibFkBweOdvoP+p9zbbVs= +knative.dev/operator v0.42.1-0.20241010181608-36698ccd6a79/go.mod h1:LFsHBfoWxlMdHRRKAuLURtCQTRjNN0ImB9MlwU7G6+A= knative.dev/pkg v0.0.0-20241010131207-e0f65ceabc68 h1:bsVHXShoLA9+ScLVRgVbd07psRVx9RM5RqXZUaOnXes= knative.dev/pkg v0.0.0-20241010131207-e0f65ceabc68/go.mod h1:mnrs8wCm1DQlXptE6ylKCAKJeCeP3lRTJbu38jW6JAs= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/vendor/knative.dev/operator/pkg/apis/operator/base/common.go b/vendor/knative.dev/operator/pkg/apis/operator/base/common.go index 2b04645c..249cc842 100644 --- a/vendor/knative.dev/operator/pkg/apis/operator/base/common.go +++ b/vendor/knative.dev/operator/pkg/apis/operator/base/common.go @@ -65,6 +65,9 @@ type KComponentSpec interface { // GetAdditionalManifests gets the list of additional manifests, which should be installed GetAdditionalManifests() []Manifest + // GetNamespaceConfiguration gets the labels and annotations for the namespace + GetNamespaceConfiguration() *NamespaceConfiguration + // GetHighAvailability returns means to set the number of desired replicas GetHighAvailability() *HighAvailability @@ -142,6 +145,10 @@ type CommonSpec struct { // +optional DeploymentOverride []WorkloadOverride `json:"deployments,omitempty"` + // NamespaceConfiguration overrides namespace configurations such as labels and annotations. + // +optional + NamespaceConfiguration *NamespaceConfiguration `json:"namespace,omitempty"` + // Workloads overrides workloads configurations such as resources and replicas. // +optional Workloads []WorkloadOverride `json:"workloads,omitempty"` @@ -191,6 +198,11 @@ func (c *CommonSpec) GetVersion() string { return c.Version } +// GetNamespaceConfiguration implements KComponentSpec. +func (c *CommonSpec) GetNamespaceConfiguration() *NamespaceConfiguration { + return c.NamespaceConfiguration +} + // GetManifests implements KComponentSpec. func (c *CommonSpec) GetManifests() []Manifest { return c.Manifests @@ -247,6 +259,17 @@ type Registry struct { ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"` } +// NamespaceConfiguration defines the configurations of namespaces to override. +type NamespaceConfiguration struct { + // Labels overrides labels for the namespace and its template. + // +optional + Labels map[string]string `json:"labels,omitempty"` + + // Annotations overrides labels for the namespace and its template. + // +optional + Annotations map[string]string `json:"annotations,omitempty"` +} + // WorkloadOverride defines the configurations of deployments to override. type WorkloadOverride struct { // Name is the name of the deployment to override. diff --git a/vendor/modules.txt b/vendor/modules.txt index 7146f87b..6a684652 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -560,7 +560,7 @@ k8s.io/utils/trace # knative.dev/hack v0.0.0-20241010131451-05b2fb30cb4d ## explicit; go 1.21 knative.dev/hack -# knative.dev/operator v0.42.1-0.20241003213123-6dce5ef96d7c +# knative.dev/operator v0.42.1-0.20241010181608-36698ccd6a79 ## explicit; go 1.22.0 knative.dev/operator/pkg/apis/operator knative.dev/operator/pkg/apis/operator/base