Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG 1816624: MHC structural schema #536

Merged
merged 9 commits into from Mar 25, 2020

Conversation

enxebre
Copy link
Member

@enxebre enxebre commented Mar 24, 2020

To generate CRDs with structural schema compliant properties we update sigs.k8s.io/controller-tools
As a consequence we need update pretty much all the k8s and openshift api machinery stack to kube 1.18. Controller-runtime points to kubernetes-sigs/controller-runtime#836.
This also force us to update to go 1.13. Needs openshift/release#7889

Also as a consequence of the kube 1.18 update we are forced to take the chance to finally drop the CVO lib deps in favour of openshift/library-go which uses the latest versions of the API machinery.

After regenerating the CRDs I manually added preserveUnknownFields:false for MHC.

kubectl explain mhc --recursive=true
KIND:     MachineHealthCheck
VERSION:  machine.openshift.io/v1beta1

DESCRIPTION:
     MachineHealthCheck is the Schema for the machinehealthchecks API

FIELDS:
   apiVersion	<string>
   kind	<string>
   metadata	<Object>
      annotations	<map[string]string>
      clusterName	<string>
      creationTimestamp	<string>
      deletionGracePeriodSeconds	<integer>
      deletionTimestamp	<string>
      finalizers	<[]string>
      generateName	<string>
      generation	<integer>
      labels	<map[string]string>
      managedFields	<[]Object>
         apiVersion	<string>
         fieldsType	<string>
         fieldsV1	<map[string]>
         manager	<string>
         operation	<string>
         time	<string>
      name	<string>
      namespace	<string>
      ownerReferences	<[]Object>
         apiVersion	<string>
         blockOwnerDeletion	<boolean>
         controller	<boolean>
         kind	<string>
         name	<string>
         uid	<string>
      resourceVersion	<string>
      selfLink	<string>
      uid	<string>
   spec	<Object>
      maxUnhealthy	<>
      nodeStartupTimeout	<string>
      selector	<Object>
         matchExpressions	<[]Object>
            key	<string>
            operator	<string>
            values	<[]string>
         matchLabels	<map[string]string>
      unhealthyConditions	<[]Object>
         status	<string>
         timeout	<string>
         type	<string>
   status	<Object>
      currentHealthy	<integer>
      expectedMachines	<integer>

To generate CRDs with structural schema compliant properties we update sigs.k8s.io/controller-tools
This indirectly requires to update pretty much all the k8s and openshift api machinery stack.
k8s.io/api v0.18.0-rc.1
k8s.io/apimachinery v0.18.0-rc.1
k8s.io/client-go v0.18.0-rc.1
k8s.io/code-generator v0.18.0-rc.1
k8s.io/klog v1.0.0
k8s.io/kube-aggregator v0.18.0-rc.1 // indirect
k8s.io/kubectl v0.18.0-rc.1
github.com/openshift/api v0.0.0-20200323095748-e7041f8762a3
github.com/openshift/client-go v0.0.0-20200320150128-a906f3d8e723
github.com/openshift/library-go v0.0.0-20200324092245-db2a8546af81
@openshift-ci-robot
Copy link
Contributor

@enxebre: This pull request references Bugzilla bug 1816624, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

BUG 1816624: MHC structural schema

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Mar 24, 2020
@openshift-ci-robot
Copy link
Contributor

@enxebre: This pull request references Bugzilla bug 1816624, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

BUG 1816624: MHC structural schema

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@enxebre
Copy link
Member Author

enxebre commented Mar 24, 2020

/cc @JoelSpeed

@openshift-ci-robot
Copy link
Contributor

@enxebre: This pull request references Bugzilla bug 1816624, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

BUG 1816624: MHC structural schema

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@enxebre enxebre force-pushed the mhc-structural-schema branch 4 times, most recently from a407416 to 015378d Compare March 25, 2020 00:03
@enxebre
Copy link
Member Author

enxebre commented Mar 25, 2020

/retest

@enxebre
Copy link
Member Author

enxebre commented Mar 25, 2020

/test images

1 similar comment
@enxebre
Copy link
Member Author

enxebre commented Mar 25, 2020

/test images

Copy link
Contributor

@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.

Generally looks good once the tests are passing, added a few questions as I was looking through

@@ -99,7 +99,6 @@ type MachineHealthCheckStatus struct {
ExpectedMachines *int `json:"expectedMachines"`

// total number of machines counted by this machine health check
// +kubebuilder:default=0
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this not allowed anymore?

Copy link
Member Author

@enxebre enxebre Mar 25, 2020

Choose a reason for hiding this comment

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

nope, API machinery complains. Note this never applied since defaulting requires a resource to be structural schema to work.

select {
case recv := <-requests:
if recv != tc.expectedRequest {
t.Error("received request does not match expected request")
}

t.Logf("Last reconcile %v", <-requests)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this channel guaranteed to receive another request? This seems like an odd thing to add

Copy link
Member Author

Choose a reason for hiding this comment

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

Definitely odd, I couldn't really figure out where is the last request coming from :/. I'd suggest though we focus on following up to replace this completely with ginkgo like coverage (OCPCLOUD-816).

pkg/operator/operator_test.go Outdated Show resolved Hide resolved
This commit mostly ensures we set the API version in the expected objects otherwise equality.Semantic.DeepEqual fails to compare with what is coming from the fake client.
@enxebre
Copy link
Member Author

enxebre commented Mar 25, 2020

/test unit

@JoelSpeed
Copy link
Contributor

/lgtm

I agree with your comments @enxebre, follow up for refactoring tests sounds good

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 25, 2020
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 25, 2020

@enxebre: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-gcp e50e0e3 link /test e2e-gcp

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@JoelSpeed
Copy link
Contributor

/approve

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JoelSpeed

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

The pull request process is described here

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 Mar 25, 2020
@openshift-merge-robot openshift-merge-robot merged commit 9320438 into openshift:master Mar 25, 2020
@openshift-ci-robot
Copy link
Contributor

@enxebre: All pull requests linked via external trackers have merged. Bugzilla bug 1816624 has been moved to the MODIFIED state.

In response to this:

BUG 1816624: MHC structural schema

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

}
}
if d != nil {
generation = d.Status.ObservedGeneration
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks broken, see #541

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. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants