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

validateClusterInfo: use clientcmdapi.NewCluster() #44221

Conversation

ncdc
Copy link
Member

@ncdc ncdc commented Apr 7, 2017

Change validateClusterInfo to use clientcmdapi.NewCluster() instead of
clientcmdapi.Cluster{} when comparing against the passed in clusterInfo.
clusterInfo most likely will be a combination of
clientcmdapi.NewCluster() merged with potential overrides. This is
necessary because otherwise, the DeepEqual between what is supposed to
be an empty Cluster and clusterInfo will fail, resulting in an error
that doesn't allow fall-through to checking for in-cluster
configuration.

#40508 changed DirectClientConfig.getContext() to start with a clientcmdapi.NewCluster() instead of the zero value for clientcmdapi.Cluster. This means that the Extensions map in the Cluster is initialized instead of nil, which breaks the DeepEqual test unless you compare clusterInfo against an initialized clientcmdapi.NewCluster().

cc @smarterclayton @sttts @vjsamuel @liggitt @deads2k @soltysh @fabianofranz @kubernetes/sig-api-machinery-pr-reviews

@ncdc ncdc added area/client-libraries sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. labels Apr 7, 2017
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 7, 2017
@k8s-github-robot k8s-github-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. release-note-label-needed labels Apr 7, 2017
@k8s-reviewable
Copy link

This change is Reviewable

Change validateClusterInfo to use clientcmdapi.NewCluster() instead of
clientcmdapi.Cluster{} when comparing against the passed in clusterInfo.
clusterInfo most likely will be a combination of
clientcmdapi.NewCluster() merged with potential overrides. This is
necessary because otherwise, the DeepEqual between what is supposed to
be an empty Cluster and clusterInfo will fail, resulting in an error
that doesn't allow fall-through to checking for in-cluster
configuration.
@ncdc ncdc force-pushed the fix-validateClusterInfo-empty-cluster-check branch from 5a54a47 to 266ba9f Compare April 7, 2017 20:50
@sttts sttts added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-label-needed labels Apr 10, 2017
@soltysh
Copy link
Contributor

soltysh commented Apr 10, 2017

LGTM

@deads2k
Copy link
Contributor

deads2k commented Apr 11, 2017

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 11, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, ncdc

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 11, 2017
@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 43545, 44293, 44221, 43888)

@k8s-github-robot k8s-github-robot merged commit f1b9c17 into kubernetes:master Apr 11, 2017
@ncdc ncdc deleted the fix-validateClusterInfo-empty-cluster-check branch April 18, 2017 18:01
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. area/client-libraries cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants