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 1820474: clusterAutoscaler and machineAutoscaler structural schema #146

Merged
merged 8 commits into from Apr 7, 2020

Conversation

enxebre
Copy link
Member

@enxebre enxebre commented Apr 3, 2020

This makes clusterAutoscaler and machineAutoscaler structural schemas.
To this end I update controller-tools, which forced me to update the whole api machinery stack to kube 1.18. As a consequence I had to drop CVO to avoid transitive incompatible dependencies and take the chance to move to openshift/library-go. As a consequence I had to update scripts to run on golang 1.13.
Needs openshift/release#8114.

@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 Apr 3, 2020
@openshift-ci-robot
Copy link
Contributor

@enxebre: This pull request references Bugzilla bug 1820474, 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 NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1820474: clusterAutoscaler and machineAutoscaler 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 Apr 3, 2020

KIND:     ClusterAutoscaler
VERSION:  autoscaling.openshift.io/v1

DESCRIPTION:
     ClusterAutoscaler is the Schema for the clusterautoscalers 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>
      balanceSimilarNodeGroups	<boolean>
      ignoreDaemonsetsUtilization	<boolean>
      maxPodGracePeriod	<integer>
      podPriorityThreshold	<integer>
      resourceLimits	<Object>
         cores	<Object>
            max	<integer>
            min	<integer>
         gpus	<[]Object>
            max	<integer>
            min	<integer>
            type	<string>
         maxNodesTotal	<integer>
         memory	<Object>
            max	<integer>
            min	<integer>
      scaleDown	<Object>
         delayAfterAdd	<string>
         delayAfterDelete	<string>
         delayAfterFailure	<string>
         enabled	<boolean>
         unneededTime	<string>
      skipNodesWithLocalStorage	<boolean>
   status	<map[string]>
KIND:     MachineAutoscaler
VERSION:  autoscaling.openshift.io/v1beta1

DESCRIPTION:
     MachineAutoscaler is the Schema for the machineautoscalers 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>
      maxReplicas	<integer>
      minReplicas	<integer>
      scaleTargetRef	<Object>
         apiVersion	<string>
         kind	<string>
         name	<string>
   status	<Object>
      lastTargetRef	<Object>
         apiVersion	<string>
         kind	<string>
         name	<string>

@openshift-ci-robot
Copy link
Contributor

@enxebre: This pull request references Bugzilla bug 1820474, 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 1820474: clusterAutoscaler and machineAutoscaler 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.

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.

/approve

@JoelSpeed
Copy link
Contributor

/retest

@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 Apr 3, 2020
@JoelSpeed
Copy link
Contributor

L13 of the Makefile needs to go from GOFLAGS += -mod=vendor to GOFLAGS ?= -mod=vendor to work with Go 1.13, the flag is included by default from 1.13 onwards

@enxebre
Copy link
Member Author

enxebre commented Apr 3, 2020

/retest

@enxebre enxebre force-pushed the structural-schema branch 2 times, most recently from 52daa3b to 1341f59 Compare April 6, 2020 16:56
Copy link
Contributor

@elmiko elmiko left a comment

Choose a reason for hiding this comment

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

looks good to me from a logic standpoint, i just have a question about a variable name

// Fail if we didn't find any of the supported target types registered.
if len(r.config.SupportedTargetGVKs) < 1 {
return ErrNoSupportedTargets
func getMissingGVKs(restMapper meta.RESTMapper, supportedCVKs []schema.GroupVersionKind) ([]schema.GroupVersionKind, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

should the second argument be named supportGVKs to make it clearer?

func getMissingGVKs(restMapper meta.RESTMapper, supportedCVKs []schema.GroupVersionKind) ([]schema.GroupVersionKind, error) {
var missingGVKs []schema.GroupVersionKind

for _, gvk := range supportedCVKs {
Copy link
Contributor

Choose a reason for hiding this comment

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

s/supportedCVKs/supportedGVKs/ ?

Before revendoring controller-runtime `watch` was running `start` by default which made it possible to use the returned error to discriminated the existing GVKs https://github.com/openshift/cluster-autoscaler-operator/blob/a0b7aead18c86ac9a51f3479cba0c656ed83065f/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go#L122.

Without this commit, the new behaviour introduced by controller-runtime https://github.com/kubernetes-sigs/controller-runtime/blob/b6092bd383f0317f48ee396629ceb46d7dd064b4/pkg/internal/controller/controller.go#L137 is hidding the missing GVKs until the manager is started resulting in a fatal error.
@enxebre
Copy link
Member Author

enxebre commented Apr 7, 2020

/retest

Copy link
Contributor

@alexander-demicev alexander-demicev left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 7, 2020
@enxebre
Copy link
Member Author

enxebre commented Apr 7, 2020

/test e2e-aws

@enxebre
Copy link
Member Author

enxebre commented Apr 7, 2020

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 3ab6dc5 into openshift:master Apr 7, 2020
@openshift-ci-robot
Copy link
Contributor

@enxebre: All pull requests linked via external trackers have merged: openshift/cluster-autoscaler-operator#146. Bugzilla bug 1820474 has been moved to the MODIFIED state.

In response to this:

Bug 1820474: clusterAutoscaler and machineAutoscaler 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.

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

7 participants