Skip to content

Commit

Permalink
Fix annotations
Browse files Browse the repository at this point in the history
- Add version update to `bundle` Make target
- Add labels from CPaaS

Signed-off-by: Dale Haiducek <[email protected]>
  • Loading branch information
dhaiducek committed Jan 10, 2025
1 parent 9363aa4 commit 744d102
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 14 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,15 @@ bundle: operator-sdk manifests kustomize ## Generate bundle manifests and metada
$(SED) -i 's/mediatype: \"\"/mediatype: \"image\/svg+xml\"/g' bundle/manifests/gatekeeper-operator.clusterserviceversion.yaml
$(SED) -i 's/^ version:.*/ version: "$(VERSION)"/' bundle/manifests/gatekeeper-operator.clusterserviceversion.yaml
$(SED) -i '/^ createdAt:.*/d' bundle/manifests/gatekeeper-operator.clusterserviceversion.yaml
$(SED) -i 's/$(CHANNELS)/$(CHANNELS)/g' bundle/metadata/annotations.yaml
yq '.annotations["operators.operatorframework.io.bundle.channels.v1"] = "$(CHANNELS)"' -i bundle/metadata/annotations.yaml
yq '.annotations.version = "v$(VERSION)"' -i bundle/metadata/annotations.yaml
$(SED) -i 's/^ olm.skipRange:.*/ olm.skipRange: "<$(VERSION)"/' bundle/manifests/gatekeeper-operator.clusterserviceversion.yaml
ifneq ($(REPLACES_VERSION), none)
$(SED) -i 's/^ replaces:.*/ replaces: gatekeeper-operator.v$(REPLACES_VERSION)/' bundle/manifests/gatekeeper-operator.clusterserviceversion.yaml
else
$(SED) -i 's/^ replaces:.*/ # replaces: none/' bundle/manifests/gatekeeper-operator.clusterserviceversion.yaml
endif
awk '/FROM/,/# Core bundle annotations./' build/bundle.Dockerfile | sed '$$d' > build/bundle.Dockerfile.tmp
awk '/FROM/,/# Core bundle annotations/' build/bundle.Dockerfile | sed '$$d' > build/bundle.Dockerfile.tmp
mv build/bundle.Dockerfile.tmp build/bundle.Dockerfile
yq '.annotations' bundle/metadata/annotations.yaml | sed 's/: /=/' | sed 's/^\([^#]\)/LABEL \1/' >> build/bundle.Dockerfile
$(OPERATOR_SDK) bundle validate ./bundle
Expand Down
12 changes: 8 additions & 4 deletions build/bundle.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM scratch
COPY bundle/manifests /manifests/
COPY bundle/metadata /metadata/

# Core bundle annotations.
# Core bundle annotations
LABEL operators.operatorframework.io.bundle.channel.default.v1=stable
LABEL operators.operatorframework.io.bundle.channels.v1="stable,3.17"
LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
Expand All @@ -14,17 +14,21 @@ LABEL operators.operatorframework.io.bundle.package.v1=gatekeeper-operator
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.34.1
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3
# Red Hat annotations.
# Red Hat annotations
LABEL com.redhat.component=gatekeeper-operator-bundle-container
LABEL com.redhat.delivery.backport=false
LABEL com.redhat.delivery.operator.bundle=true
LABEL com.redhat.openshift.versions=v4.12
# K8s/Openshift annotations
LABEL io.k8s.display-name="Gatekeeper Operator"
LABEL io.k8s.description="The Gatekeeper Operator installs and configures Open Policy Agent Gatekeeper."
LABEL io.openshift.expose-services=""
LABEL io.openshift.tags="data,images"
# Bundle metadata
LABEL name=gatekeeper/gatekeeper-operator-bundle
LABEL description="The Gatekeeper Operator installs and configures Open Policy Agent Gatekeeper."
LABEL io.k8s.description="The Gatekeeper Operator installs and configures Open Policy Agent Gatekeeper."
LABEL summary="Red Hat Gatekeeper Operator"
LABEL version=v3.17.0
LABEL version=v3.17.1
LABEL release=""
LABEL distribution-scope=public
LABEL maintainer="[email protected]"
Expand Down
12 changes: 8 additions & 4 deletions build/bundle.Dockerfile.rhtap
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ FROM scratch
COPY --from=builder /gatekeeper-operator/bundle/manifests /manifests/
COPY --from=builder /gatekeeper-operator/bundle/metadata /metadata/

# Core bundle annotations.
# Core bundle annotations
LABEL operators.operatorframework.io.bundle.channel.default.v1=stable
LABEL operators.operatorframework.io.bundle.channels.v1="stable,3.17"
LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
Expand All @@ -20,17 +20,21 @@ LABEL operators.operatorframework.io.bundle.package.v1=gatekeeper-operator
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.34.1
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3
# Red Hat annotations.
# Red Hat annotations
LABEL com.redhat.component=gatekeeper-operator-bundle-container
LABEL com.redhat.delivery.backport=false
LABEL com.redhat.delivery.operator.bundle=true
LABEL com.redhat.openshift.versions=v4.12
# K8s/Openshift annotations
LABEL io.k8s.display-name="Gatekeeper Operator"
LABEL io.k8s.description="The Gatekeeper Operator installs and configures Open Policy Agent Gatekeeper."
LABEL io.openshift.expose-services=""
LABEL io.openshift.tags="data,images"
# Bundle metadata
LABEL name=gatekeeper/gatekeeper-operator-bundle
LABEL description="The Gatekeeper Operator installs and configures Open Policy Agent Gatekeeper."
LABEL io.k8s.description="The Gatekeeper Operator installs and configures Open Policy Agent Gatekeeper."
LABEL summary="Red Hat Gatekeeper Operator"
LABEL version=v3.17.0
LABEL version=v3.17.1
LABEL release=""
LABEL distribution-scope=public
LABEL maintainer="[email protected]"
Expand Down
12 changes: 8 additions & 4 deletions bundle/metadata/annotations.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
annotations:
# Core bundle annotations.
# Core bundle annotations
operators.operatorframework.io.bundle.channel.default.v1: stable
operators.operatorframework.io.bundle.channels.v1: "stable,3.17"
operators.operatorframework.io.bundle.manifests.v1: manifests/
Expand All @@ -9,17 +9,21 @@ annotations:
operators.operatorframework.io.metrics.builder: operator-sdk-v1.34.1
operators.operatorframework.io.metrics.mediatype.v1: metrics+v1
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3
# Red Hat annotations.
# Red Hat annotations
com.redhat.component: gatekeeper-operator-bundle-container
com.redhat.delivery.backport: false
com.redhat.delivery.operator.bundle: true
com.redhat.openshift.versions: v4.12
# K8s/Openshift annotations
io.k8s.display-name: "Gatekeeper Operator"
io.k8s.description: "The Gatekeeper Operator installs and configures Open Policy Agent Gatekeeper."
io.openshift.expose-services: ""
io.openshift.tags: "data,images"
# Bundle metadata
name: gatekeeper/gatekeeper-operator-bundle
description: "The Gatekeeper Operator installs and configures Open Policy Agent Gatekeeper."
io.k8s.description: "The Gatekeeper Operator installs and configures Open Policy Agent Gatekeeper."
summary: "Red Hat Gatekeeper Operator"
version: v3.17.0
version: v3.17.1
release: ""
distribution-scope: public
maintainer: "[email protected]"
Expand Down

0 comments on commit 744d102

Please sign in to comment.