Skip to content

Commit

Permalink
Console CRDs: Rename files to use the default run-level for updates
Browse files Browse the repository at this point in the history
It's unclear what the motivation was for their existing runlevels,
with the API filenames landing without much context:

  $ git --no-pager log --oneline operator/v1/0000_70_console-operator.crd.yaml | tail -n1
  862dd2f Add console-operator CRD and generate from types
  $ git --no-pager log -1 --format='%h %B' --stat=80 862dd2f
  862dd2f Add console-operator CRD and generate from types

   operator/v1/0000_70_console-operator.crd.yaml | 195 ++++++++++++++++++++++++++
   1 file changed, 195 insertions(+)
  $ git --no-pager log --oneline helm/*.crd.yaml | tail -n1
  a4be43c Added ability to configure Helm chart repository accessible within cluster
  $ git --no-pager log -1 --format='%h %B' --stat=80 a4be43c
  a4be43c Added ability to configure Helm chart repository accessible within cluster

  * Introduced `HelmChartRepository` top-level CR modelled according to chartrepo.Entry
    from https://github.com/helm/helm/blob/master/pkg/repo/chartrepo.go#L42
  * The corresponding enchancement: openshift/enhancements/pull/175

   Makefile                                           |   3 +-
   hack/update-deepcopy.sh                            |   2 +-
   hack/verify-crds.sh                                |   1 +
   .../0000_10-helm-chart-repository.crd.yaml         | 138 +++++++++++++++++++
   helm/v1alpha1/doc.go                               |   8 ++
   helm/v1alpha1/register.go                          |  38 ++++++
   helm/v1alpha1/types_helm.go                        | 108 +++++++++++++++
   helm/v1alpha1/zz_generated.deepcopy.go             | 152 +++++++++++++++++++++
   8 files changed, 448 insertions(+), 2 deletions(-)
  $ git --no-pager log --oneline helm/v1beta1/0000_10-project-helm-chart-repository.crd.yaml | tail -n1
  8fe639f helm: add a new namespaced CRD for helm
  $ git --no-pager log -1 --format='%h %B' --stat=80 8fe639f
  8fe639f helm: add a new namespaced CRD for helm

  As part of the process to support namespace-scoped Helm repositories for
  non-admin users, this PR adds a new namespace-scoped CRD definition
  named `projecthelmchartrepositories.helm.openshift.io`.

  Closes: https://issues.redhat.com/browse/HELM-258
  Signed-off-by: Allen Bai <abai@redhat.com>

   .../0000_10-project-helm-chart-repository.crd.yaml | 130 +++++++++++++++++++++
   helm/v1beta1/register.go                           |   2 +
   ...ypes_helm.go => types_helm_chart_repository.go} |   0
   .../v1beta1/types_project_helm_chart_repository.go |  92 +++++++++++++++
   helm/v1beta1/zz_generated.deepcopy.go              | 119 +++++++++++++++++++
   5 files changed, 343 insertions(+)

Removing the explicit runlevels will allow these resources to go in
with the other console resources in the default runlevel 50 [1,2].

Significantly, the outgoing 0000_70_console-operator.crd.yaml hadn't
matched the
0000_<runlevel>_<dash-separated-component>_<manifest_filename>
template [1], and by sorting lexically between other level-70
manifests:

  $ oc adm release extract --to manifests quay.io/openshift-release-dev/ocp-release:4.14.0-ec.4-x86_64
  $ ls manifests | grep -1 0000_70_console-operator.crd.yaml
  0000_70_cluster-network-operator_05_clusteroperator.yaml
  0000_70_console-operator.crd.yaml
  0000_70_dns-operator_00-cluster-role.yaml

it had been pushing the network and DNS manifests together into one
large task-node.  With this change removing the unparsable attempt at
a runlevel, the network and DNS manifests will be able to apply on
updates via two parallel task-nodes.

I'm prefixing most of them with '00_' now to get them near the front
of the other level-50 console manifests.  For example,
manifests/01-helm.yaml is declaring a HelmChartRepository resource
[3], so we want it to sort after the HelmChartRepository
CustomResourceDefinition within the console task-node.

But I'm prefixing ConsolePlugin with '90_' to sort it towards the
back, after 07-operator.yaml [4], because the operator is what serves
the /crdconvert webhook defined in that CRD [5].

Generated with:

  $ rename 's/0000_[0-9][0-9]_/00_/' console/*/*.yaml helm/*/*.yaml operator/*/*console-operator*.yaml
  $ sed -i 's/0000_[0-9][0-9]_/00_/' console/*/*testsuite.yaml helm/*/*.testsuite.yaml
  $ sed -i 's/0000_[0-9][0-9]_\(.*console-operator\)/00_\1/' operator/*/*testsuite.yaml
  $ rename 's/00_/90_/' console/*/*consoleplugin*.yaml
  $ sed -i 's/00_/90_/' console/*/*consoleplugin*testsuite.yaml
  $ git add -A console helm operator

[1]: https://github.com/openshift/enhancements/blob/cafeb5c3cba7f8c9e261b2aabffa92e34dd76be6/dev-guide/cluster-version-operator/dev/operators.md#what-is-the-order-that-resources-get-createdupdated-in
[2]: https://github.com/openshift/oc/blob/13225e00caf1ad2d3603e1d1cc8651833f2effcb/pkg/cli/admin/release/new.go#L1412-L1416
[3]: https://github.com/openshift/console-operator/blob/cb08a319271b2f4676d1faae96a5ab10440facb0/manifests/01-helm.yaml
[4]: https://github.com/openshift/console-operator/blob/cb08a319271b2f4676d1faae96a5ab10440facb0/manifests/07-operator.yaml
[5]: https://issues.redhat.com//browse/OCPBUGS-15834
  • Loading branch information
wking committed Aug 2, 2023
1 parent ab49804 commit 9e3e820
Show file tree
Hide file tree
Showing 20 changed files with 10 additions and 10 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion console/v1/stable.consoleclidownload.testsuite.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "[Stable] ConsoleCLIDownload"
crd: 0000_10_consoleclidownload.crd.yaml
crd: 00_consoleclidownload.crd.yaml
tests:
onCreate:
- name: Should be able to create a minimal ConsoleCLIDownload
Expand Down
2 changes: 1 addition & 1 deletion console/v1/stable.consoleexternalloglink.testsuite.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "[Stable] ConsoleExternalLogLink"
crd: 0000_10_consoleexternalloglink.crd.yaml
crd: 00_consoleexternalloglink.crd.yaml
tests:
onCreate:
- name: Should be able to create a minimal ConsoleExternalLogLink
Expand Down
2 changes: 1 addition & 1 deletion console/v1/stable.consolelink.testsuite.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "[Stable] ConsoleLink"
crd: 0000_10_consolelink.crd.yaml
crd: 00_consolelink.crd.yaml
tests:
onCreate:
- name: Should be able to create a minimal ConsoleLink
Expand Down
2 changes: 1 addition & 1 deletion console/v1/stable.consolenotification.testsuite.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "[Stable] ConsoleNotification"
crd: 0000_10_consolenotification.crd.yaml
crd: 00_consolenotification.crd.yaml
tests:
onCreate:
- name: Should be able to create a minimal ConsoleNotification
Expand Down
2 changes: 1 addition & 1 deletion console/v1/stable.consoleplugin.testsuite.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "[Stable] ConsolePlugin"
crd: 0000_10_consoleplugin.crd.yaml
crd: 90_consoleplugin.crd.yaml
tests:
onCreate:
- name: Should be able to create a minimal ConsolePlugin
Expand Down
2 changes: 1 addition & 1 deletion console/v1/stable.consolequickstart.testsuite.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "[Stable] ConsoleQuickStart"
crd: 0000_10_consolequickstart.crd.yaml
crd: 00_consolequickstart.crd.yaml
tests:
onCreate:
- name: Should be able to create a minimal ConsoleQuickStart
Expand Down
2 changes: 1 addition & 1 deletion console/v1/stable.consolesample.testsuite.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "[Stable] ConsoleSample"
crd: 0000_10_consolesample.crd.yaml
crd: 00_consolesample.crd.yaml
tests:
onCreate:
- name: Should be able to create a minimal ConsoleSample with GitImport
Expand Down
2 changes: 1 addition & 1 deletion console/v1/stable.consoleyamlsample.testsuite.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "[Stable] ConsoleYAMLSample"
crd: 0000_10_consoleyamlsample.crd.yaml
crd: 00_consoleyamlsample.crd.yaml
tests:
onCreate:
- name: Should be able to create a minimal ConsoleYAMLSample
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion console/v1alpha1/stable.consoleplugin.testsuite.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "[Stable] ConsolePlugin"
crd: 0000_10_consoleplugin.crd.yaml
crd: 90_consoleplugin.crd.yaml
tests:
onCreate:
- name: Should be able to create a minimal ConsolePlugin
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion operator/v1/stable.console.testsuite.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "[Stable] Console"
crd: 0000_70_console-operator.crd.yaml
crd: 00_console-operator.crd.yaml
tests:
onCreate:
- name: Should be able to create a minimal Console
Expand Down

0 comments on commit 9e3e820

Please sign in to comment.