Skip to content

Conversation

@asalkeld
Copy link
Contributor

@asalkeld asalkeld commented Sep 22, 2020

Originally done to get "oc explain Provisioning" to print more information.
(https://bugzilla.redhat.com/show_bug.cgi?id=1880787)

Update:
So I think we should merge this, just because v1alpha1 is deprecated..

However this is not helping 'oc explain Provisioning'.
if I "oc apply -f manifests/0000_30_cluster-baremetal-operator_00_metal3provisioning.crd.yaml"
then 'oc explain Provisioning', I still get the same response.

Copy link

@JoelSpeed JoelSpeed left a comment

Choose a reason for hiding this comment

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

Since this changes your resource to include a status subresource, have you checked that you are handling updates to the status using a status client within the controller? If you aren't, your controller would stop being able to update the status once this is merged

Makefile Outdated
CONTROLLER_GEN ?= go run vendor/sigs.k8s.io/controller-tools/cmd/controller-gen/main.go
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true"
CRD_OPTIONS ?= "crd:trivialVersions=true,crdVersions=v1"
Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately, we need to keep this consistent with what is in the machine-api-operator for the time being. https://github.com/openshift/machine-api-operator/blob/master/install/0000_30_machine-api-operator_04_metal3provisioning.crd.yaml#L1 shows that is still using v1beta1.

I think that means deferring the fix for this until later in the 4.7 cycle, when we have completed the work to remove the metal3 management logic from the MAO. Unless we also need to backport the fix to 4.6, in which case I would expect a patch in the MAO repository to land before we make the change here.

Copy link
Member

Choose a reason for hiding this comment

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

I think the point here is to copy this into the MAO, since the explain output is currently broken in 4.6.

Copy link

@JoelSpeed JoelSpeed Sep 22, 2020

Choose a reason for hiding this comment

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

I believe it will be safe to copy what is currently generated in this PR over to MAO within the 4.6 timeline, can a PR raised for that and attached to the same bug?

Copy link
Contributor

Choose a reason for hiding this comment

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

This generated CRD is different from the one in MAO specifically around https://github.com/openshift/machine-api-operator/blob/master/install/0000_30_machine-api-operator_04_metal3provisioning.crd.yaml#L98-L101. Either we have to update our code here to generate the enum or make the changes in MAO independent of these changes.

Choose a reason for hiding this comment

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

The enum you've highlighted appears to be present in the version in this PR as well?

enum:
- Managed
- Unmanaged
- Disabled

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, #19 took care of that.

Choose a reason for hiding this comment

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

Ok, so it should be safe to copy this generated file over to MAO and make sure they're synced?


// +kubebuilder:object:root=true
// +kubebuilder:resource:path=provisionings,scope=Cluster
// +kubebuilder:subresource:status
Copy link
Contributor

Choose a reason for hiding this comment

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

These changes should be OK, since they match the MAO version.

@sadasu
Copy link
Contributor

sadasu commented Sep 22, 2020

Since this changes your resource to include a status subresource, have you checked that you are handling updates to the status using a status client within the controller? If you aren't, your controller would stop being able to update the status once this is merged

@JoelSpeed by status client in the controller, do you mean the ClusterOperator tracking the status of the Operator? Moreover, this PR is changing the order of the kubebuilder comments and not adding a new one. Should this result in a status change somewhere?

@JoelSpeed
Copy link

@sadasu If you look at the generated CRD in this repo, it doesn't currently include the status subresource, so this generation is adding the status subresource to the CRD in the eyes of the API server.

However, if you look in the machine-api-operator repo, you can see the subresource is already there in that version, so as long as that is the one people are using, there's no breaking changes or anything here and my previous comment can be ignored

@asalkeld asalkeld force-pushed the crd-v1beta1-is-deprecated branch from 3346984 to 2c5c0e6 Compare September 23, 2020 07:25
@asalkeld asalkeld changed the title Generate the CRD with v1 (not v1alpha1) and fix scope Generate the CRD with v1 (not v1alpha1) Sep 23, 2020
@asalkeld asalkeld marked this pull request as draft September 23, 2020 07:27
@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. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Sep 23, 2020
@asalkeld asalkeld force-pushed the crd-v1beta1-is-deprecated branch from 2c5c0e6 to fcb2f02 Compare September 29, 2020 01:04
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 29, 2020
@asalkeld asalkeld marked this pull request as ready for review September 29, 2020 01:09
@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 Sep 29, 2020
@asalkeld asalkeld force-pushed the crd-v1beta1-is-deprecated branch from fcb2f02 to 4f456ae Compare October 8, 2020 23:33
@asalkeld asalkeld force-pushed the crd-v1beta1-is-deprecated branch from 4f456ae to f38ec83 Compare October 8, 2020 23:53
@dhellmann
Copy link
Contributor

Comparing the CRD file in this PR with the version currently in the MAO show no differences.

/approve

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: asalkeld, dhellmann

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 9, 2020
@dhellmann
Copy link
Contributor

Comparing the CRD file in this PR with the version currently in the MAO show no differences.

/approve

Well, it does show differences if I compare the right files. :head-desk:

The file in this PR looks correct.

@sadasu
Copy link
Contributor

sadasu commented Oct 13, 2020

/lgtm

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. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants