Skip to content

Conversation

@smarterclayton
Copy link
Contributor

@smarterclayton smarterclayton commented Oct 26, 2018

As discussed in previous review sessions, we want to have all core configuration api objects in the same API group, and we also want to rename CVOConfig to ClusterVersion. This PR changes both - the proposed name for the group is config.openshift.io as in, "the config for an openshift cluster".

Reasons for wanting ClusterVersion as a name:

  • Describes what the object does (manage the cluster version)
  • More closely aligns with the ClusterVersionOperator

Reasons for wanting config.openshift.io as a group name:

  • The cluster version is part of the configuration of a cluster
  • When someone asks "where is the configuration for openshift", we can say "the resources in the config.openshift.io API group"

Reasons for wanting one API group for ClusterVersion, ClusterOperator, and top level config (Image, Network)

  • Makes it easy for an administrator to find "objects that control the configuration of a cluster"
  • Makes generating a client to manage an openshift cluster easy
  • Encourages the idea of CVO + top level config as being "all you need to configure a cluster"

Reasons for moving ClusterOperator into config.openshift.io

  • The CVO mediates the relationship between the second level operators and the user, so the CVO needs to summarize and report their status back to users.
  • The ClusterVersion object is the first object a user should look at with regards to upgrades, but the next natural object they will look at is ClusterOperator (the CVO is a ClusterOperator as well) to find out what is going wrong.

Changes that have been discussed and may influence how people feel about this change, but are not part of this PR:

  • Make ClusterVersion have spec and status (spec is what you want the cluster version to be, status is what it is at)
  • Update ClusterVersion field naming to match terminology we are using else where
  • Move ClusterOperator into config.openshift.io
  • Move ClusterVersion and ClusterOperator to be cluster scoped

One example possible final state (assuming we did all above):

apigroup: config.openshift.io

kind: ClusterVersion
apiVersion: config.openshift.io/v1
metadata:
  name: ...
spec:
  channel: production
  overrides: ...
  update:
    version: 4.1.2
status:
  availableUpdates:
  - version: 4.1.3

kind: ClusterOperator
apiVersion: config.openshift.io/v1
metadata:
  name: cluster-version
status:
  version: 4.1.2
  conditions:
  - type: Available
     status: True

kind: Network
apiVersion: config.openshift.io/v1
metadata:
  name: instance
spec:
  serviceCIDR: 10.1.0.0/16
  podCIDRs:
  - 10.2.0.0/16
# find all config related resources for a cluster
$ oc api-resources --api-group=config.openshift.io
NAME            SHORTNAMES   APIGROUP            NAMESPACED   KIND
clusterversion               config.openshift.io false        ClusterVersion
clusteroperator              config.openshift.io false        ClusterOperator
image                        config.openshift.io false        Image
network                      config.openshift.io false        Network

config.openshift.io will be the API group for all top level cluster
config, including ClusterOperator and CVOConfig, as well as other
component level config (image, network, cloud).

This commit does a rename in place of clusterversion.openshift.io to
config.openshift.io in this operator.
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: smarterclayton

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 26, 2018
@smarterclayton smarterclayton changed the title DO NOT REVIEW - iterating WIP: api: Move CVOConfig to final name and location Oct 26, 2018
@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 26, 2018
@smarterclayton smarterclayton changed the title WIP: api: Move CVOConfig to final name and location api: Move CVOConfig to final name and location Oct 26, 2018
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 26, 2018
@smarterclayton
Copy link
Contributor Author

when this merges we also need to merge openshift/installer#549

@smarterclayton
Copy link
Contributor Author

@deads2k @abhinavdahiya @crawford we've all talked about aspects of this before, if we're not on the same page completely I'll keep adding detail until we are. This only renames CVOConfig and moves groups.

scheme.AddKnownTypes(SchemeGroupVersion,
&CVOConfig{},
&ClusterVersion{},
&CVOStatus{},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this stands out now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think the spec/status split discussion can happen as a second step here. I will create a PR that has those additional commits so we can look at it.

func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&CVOConfig{},
&ClusterVersion{},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pre-existing, but where is the list?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

@deads2k
Copy link
Contributor

deads2k commented Oct 26, 2018

I'm in favor of the change. I think you accidentally moved a second type with this type though.

@smarterclayton
Copy link
Contributor Author

It's not easy to make the installer able to tolerate both CRDs, so the best option I can see is to get review and deliver the rename to the CRD into both repos at once.

This commit renames CVOConfig to ClusterVersion and regenerates the clients,
but does not change any of the fields or usages of the object.
@deads2k
Copy link
Contributor

deads2k commented Nov 2, 2018

lgtm

will leave tagging to @abhinavdahiya or @crawford

@smarterclayton
Copy link
Contributor Author

Closing in favor of #45 which contains this change is approved by abhinav

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants