diff --git a/assets/cluster-monitoring-operator/federate-client-certs.yaml b/assets/cluster-monitoring-operator/federate-client-certs.yaml index 78608d5203..a57019e0bc 100644 --- a/assets/cluster-monitoring-operator/federate-client-certs.yaml +++ b/assets/cluster-monitoring-operator/federate-client-certs.yaml @@ -2,6 +2,8 @@ apiVersion: v1 data: {} kind: Secret metadata: + annotations: + openshift.io/owning-component: Monitoring labels: app.kubernetes.io/managed-by: cluster-monitoring-operator app.kubernetes.io/part-of: openshift-monitoring diff --git a/assets/cluster-monitoring-operator/metrics-client-certs.yaml b/assets/cluster-monitoring-operator/metrics-client-certs.yaml index a6e2a4597f..6af55cf56b 100644 --- a/assets/cluster-monitoring-operator/metrics-client-certs.yaml +++ b/assets/cluster-monitoring-operator/metrics-client-certs.yaml @@ -2,6 +2,8 @@ apiVersion: v1 data: {} kind: Secret metadata: + annotations: + openshift.io/owning-component: Monitoring labels: app.kubernetes.io/managed-by: cluster-monitoring-operator app.kubernetes.io/part-of: openshift-monitoring diff --git a/jsonnet/components/cluster-monitoring-operator.libsonnet b/jsonnet/components/cluster-monitoring-operator.libsonnet index 036da261ee..35f35c01ea 100644 --- a/jsonnet/components/cluster-monitoring-operator.libsonnet +++ b/jsonnet/components/cluster-monitoring-operator.libsonnet @@ -62,6 +62,9 @@ function(params) { metadata: { name: 'metrics-client-certs', namespace: cfg.namespace, + annotations: { + 'openshift.io/owning-component': 'Monitoring' + } }, type: 'Opaque', data: {}, @@ -73,6 +76,9 @@ function(params) { metadata: { name: 'federate-client-certs', namespace: cfg.namespace, + annotations: { + 'openshift.io/owning-component': 'Monitoring' + } }, type: 'Opaque', data: {}, diff --git a/pkg/manifests/tls.go b/pkg/manifests/tls.go index 81ed6494e4..25cc4ab8b1 100644 --- a/pkg/manifests/tls.go +++ b/pkg/manifests/tls.go @@ -21,6 +21,7 @@ import ( "math/big" "time" + "github.com/openshift/api/annotations" "github.com/openshift/library-go/pkg/crypto" "github.com/pkg/errors" v1 "k8s.io/api/core/v1" @@ -61,7 +62,9 @@ func (f *Factory) MetricsClientCerts() (*v1.Secret, error) { s.Namespace = f.namespace s.Data = make(map[string][]byte) - s.Annotations = make(map[string]string) + s.Annotations = map[string]string{ + annotations.OpenShiftComponent: "Monitoring", + } return s, nil } @@ -74,7 +77,9 @@ func (f *Factory) FederateClientCerts() (*v1.Secret, error) { s.Namespace = f.namespace s.Data = make(map[string][]byte) - s.Annotations = make(map[string]string) + s.Annotations = map[string]string{ + annotations.OpenShiftComponent: "Monitoring", + } return s, nil } diff --git a/vendor/github.com/openshift/api/annotations/annotations.go b/vendor/github.com/openshift/api/annotations/annotations.go new file mode 100644 index 0000000000..c10234d102 --- /dev/null +++ b/vendor/github.com/openshift/api/annotations/annotations.go @@ -0,0 +1,34 @@ +package annotations + +// annotation keys +// NEVER ADD TO THIS LIST. Annotations need to be owned in the API groups they are associated with, so these constants end +// up nested in an API group, not top level in the OpenShift namespace. The items located here are examples of annotations +// claiming a global namespace key that have never achieved global reach. In the future, names should be based on the +// consuming component. +const ( + // OpenShiftDisplayName is a common, optional annotation that stores the name displayed by a UI when referencing a resource. + OpenShiftDisplayName = "openshift.io/display-name" + + // OpenShiftProviderDisplayNameAnnotation is the name of a provider of a resource, e.g. + // "Red Hat, Inc." + OpenShiftProviderDisplayNameAnnotation = "openshift.io/provider-display-name" + + // OpenShiftDocumentationURLAnnotation is the url where documentation associated with + // a resource can be found. + OpenShiftDocumentationURLAnnotation = "openshift.io/documentation-url" + + // OpenShiftSupportURLAnnotation is the url where support for a template can be found. + OpenShiftSupportURLAnnotation = "openshift.io/support-url" + + // OpenShiftDescription is a common, optional annotation that stores the description for a resource. + OpenShiftDescription = "openshift.io/description" + + // OpenShiftLongDescriptionAnnotation is a resource's long description + OpenShiftLongDescriptionAnnotation = "openshift.io/long-description" + + // OpenShiftComponent is a common, optional annotation that stores the owning component for a resource. + // The component is for whatever bug tracker we're using. That used to be bugzilla, now it is + // a jira component and subcomponent in OCPBUGS. + // For example, "Etcd" or "Networking / ovn-kubernetes" + OpenShiftComponent = "openshift.io/owning-component" +) diff --git a/vendor/modules.txt b/vendor/modules.txt index 0639496896..b401c0c397 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -295,6 +295,7 @@ github.com/opencontainers/go-digest # github.com/openshift/api v0.0.0-20231109185848-6cd72e415ddb ## explicit; go 1.20 github.com/openshift/api +github.com/openshift/api/annotations github.com/openshift/api/apiserver github.com/openshift/api/apiserver/v1 github.com/openshift/api/apps