Skip to content

Commit

Permalink
chore: automate downstream manifest generation
Browse files Browse the repository at this point in the history
make prepare-downstream-release RELEASE=3.6.2 REPLACES=3.6.1 QUAY_RELEASE=3.6.2 CLAIR_RELEASE=3.6.2 CHANNEL=stable-3.6

will create a cluster service version virtually identical to the one
located in bundle/downstream.

note that we're also replacing `QUAY_DEFAULT_BRANDING` value from
'upstream' to 'redhat'. it seems the operator knows how to tell Quay
which is the correct logo to use. this is also done in the CSV itself,
and is still done because I'm actually not sure if the mechanism behind
QUAY_DEFAULT_BRANDING can be trusted.
  • Loading branch information
flavianmissi committed Dec 22, 2021
1 parent 518af8f commit d49150a
Show file tree
Hide file tree
Showing 14 changed files with 434 additions and 3,672 deletions.
30 changes: 11 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,15 @@ CONTROLLER_GEN=$(shell which controller-gen)
endif

# This target called from the prepare-release github action.
# RELEASE - quay-operator tag (eg. v3.6.0-alpha.4)
# QUAY_RELEASE - quay version
# CLAIR_RELEASE - clair version
# CHANNEL - operator channel (eg. stable-3.6, preview-3.6)
# RELEASE - quay-operator tag (eg. 3.6.0-alpha.4)
# QUAY_RELEASE - quay version (eg. 3.6.0-alpha.4)
# CLAIR_RELEASE - clair version (eg. 4.3.5)
prepare-release:
sed -i "s/createdAt:.*/createdAt: `date --utc +'%Y-%m-%d %k:%m UTC'`/" bundle/upstream/manifests/quay-operator.clusterserviceversion.yaml
sed -i "s/olm\.skipRange:.*/olm\.skipRange: \">=3.5.x <$(RELEASE)\"/" bundle/upstream/manifests/quay-operator.clusterserviceversion.yaml
sed -i "s/quay-version:.*/quay-version: v$(RELEASE)/" bundle/upstream/manifests/quay-operator.clusterserviceversion.yaml
sed -i "s/containerImage:.*/containerImage: quay.io\/projectquay\/quay-operator:v$(RELEASE)/" bundle/upstream/manifests/quay-operator.clusterserviceversion.yaml
sed -i "s/^ name: quay-operator.*/ name: quay-operator.v$(RELEASE)/" bundle/upstream/manifests/quay-operator.clusterserviceversion.yaml
sed -i "s/image: quay.io\/projectquay\/quay-operator.*/image: quay.io\/projectquay\/quay-operator:v$(RELEASE)/" bundle/upstream/manifests/quay-operator.clusterserviceversion.yaml
sed -i "s/value: quay.io\/projectquay\/quay:.*/value: quay.io\/projectquay\/quay:$(QUAY_RELEASE)/" bundle/upstream/manifests/quay-operator.clusterserviceversion.yaml
sed -i "s/value: quay.io\/projectquay\/clair:.*/value: quay.io\/projectquay\/clair:$(CLAIR_RELEASE)/" bundle/upstream/manifests/quay-operator.clusterserviceversion.yaml
sed -i "s/^ version: .*/ version: $(RELEASE)/" bundle/upstream/manifests/quay-operator.clusterserviceversion.yaml
ifneq (,$(findstring alpha,$(RELEASE)))
sed -i "s/operators.operatorframework.io.bundle.channel.default.v1.*/operators.operatorframework.io.bundle.channel.default.v1: preview-3.6/" bundle/upstream/metadata/annotations.yaml
sed -i "s/operators.operatorframework.io.bundle.channels.v1.*/operators.operatorframework.io.bundle.channels.v1: preview-3.6/" bundle/upstream/metadata/annotations.yaml
else
sed -i "s/operators.operatorframework.io.bundle.channel.default.v1.*/operators.operatorframework.io.bundle.channel.default.v1: stable-3.6/" bundle/upstream/metadata/annotations.yaml
sed -i "s/operators.operatorframework.io.bundle.channels.v1.*/operators.operatorframework.io.bundle.channels.v1: stable-3.6/" bundle/upstream/metadata/annotations.yaml
endif
@./hack/prepare-upstream.sh

# CHANNEL - operator channel (eg. stable-3.6)
# RELEASE - quay-operator tag (eg. 3.6.0-alpha.4)
# REPLACES - previous z-stream, do not set when releasing a y-stream
prepare-downstream-release:
@./hack/prepare-downstream.sh
322 changes: 0 additions & 322 deletions bundle/downstream/manifests/quay-operator.clusterserviceversion.yaml

This file was deleted.

2,672 changes: 0 additions & 2,672 deletions bundle/downstream/manifests/quayecosystems.crd.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions bundle/downstream/metadata/annotations.yaml

This file was deleted.

285 changes: 285 additions & 0 deletions bundle/manifests/quay-operator.clusterserviceversion.yaml

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,43 +20,70 @@ spec:
description: QuayRegistry is the Schema for the quayregistries API.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: QuayRegistrySpec defines the desired state of QuayRegistry.
properties:
components:
description: Components declare how the Operator should handle backing Quay services.
description: Components declare how the Operator should handle backing
Quay services.
items:
description: Component describes how the Operator should handle a backing Quay service.
description: Component describes how the Operator should handle
a backing Quay service.
properties:
kind:
description: Kind is the unique name of this type of component.
type: string
managed:
description: Managed indicates whether or not the Operator is responsible for the lifecycle of this component. Default is true.
description: Managed indicates whether or not the Operator is
responsible for the lifecycle of this component. Default is
true.
type: boolean
overrides:
description: Overrides holds information regarding component
specific configurations.
properties:
volumeSize:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
required:
- kind
- managed
type: object
type: array
configBundleSecret:
description: ConfigBundleSecret is the name of the Kubernetes `Secret` in the same namespace which contains the base Quay config and extra certs.
description: ConfigBundleSecret is the name of the Kubernetes `Secret`
in the same namespace which contains the base Quay config and extra
certs.
type: string
type: object
status:
description: QuayRegistryStatus defines the observed state of QuayRegistry.
properties:
conditions:
description: Conditions represent the conditions that a QuayRegistry can have.
description: Conditions represent the conditions that a QuayRegistry
can have.
items:
description: 'Condition is a single condition of a QuayRegistry. Conditions should follow the "abnormal-true" principle in order to only bring the attention of users to "broken" states. Example: a condition of `type: "Ready", status: "True"`` is less useful and should be omitted whereas `type: "NotReady", status: "True"` is more useful when trying to monitor when something is wrong.'
description: 'Condition is a single condition of a QuayRegistry.
Conditions should follow the "abnormal-true" principle in order
to only bring the attention of users to "broken" states. Example:
a condition of `type: "Ready", status: "True"`` is less useful
and should be omitted whereas `type: "NotReady", status: "True"`
is more useful when trying to monitor when something is wrong.'
properties:
lastTransitionTime:
format: date-time
Expand All @@ -75,19 +102,24 @@ spec:
type: object
type: array
configEditorCredentialsSecret:
description: ConfigEditorCredentialsSecret is the Kubernetes `Secret` containing the config editor password.
description: ConfigEditorCredentialsSecret is the Kubernetes `Secret`
containing the config editor password.
type: string
configEditorEndpoint:
description: ConfigEditorEndpoint is the external access point for a web-based reconfiguration interface for the Quay registry instance.
description: ConfigEditorEndpoint is the external access point for
a web-based reconfiguration interface for the Quay registry instance.
type: string
currentVersion:
description: CurrentVersion is the actual version of Quay that is actively deployed.
description: CurrentVersion is the actual version of Quay that is
actively deployed.
type: string
lastUpdated:
description: LastUpdate is the timestamp when the Operator last processed this instance.
description: LastUpdate is the timestamp when the Operator last processed
this instance.
type: string
registryEndpoint:
description: RegistryEndpoint is the external access point for the Quay registry.
description: RegistryEndpoint is the external access point for the
Quay registry.
type: string
type: object
type: object
Expand Down
File renamed without changes.
Loading

0 comments on commit d49150a

Please sign in to comment.