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

Fix a bug in ClusterClient's GetClusterObjects() and GetMachineObjects() #321

Merged
merged 1 commit into from
Jun 11, 2018

Conversation

spew
Copy link
Contributor

@spew spew commented Jun 10, 2018

What this PR does / why we need it:
The previous implementation took the address of the iteration variable. While the value of the iteration value changes on each iteration, the address does not change for the entirety of the loop. Previously, the slice returned by these functions would be a collection of the exact same iterator variable address and which of course would be filled with a value of the last value in the loop iteration.

This is the same behavior that is explained here: golang/go#22791.

Release note:

NONE

@kubernetes/kube-deploy-reviewers

The previous implementation took the address of the iteration variable. While the value of the iteration value changes on each iteration, the address does not change for the entirety of the loop. Previously, the slice returned by these functions would be a collection of the exact same iterator variable address and which of course would be filled with a value of the last value in the loop iteration.
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 10, 2018
@k8s-ci-robot k8s-ci-robot requested a review from karan June 10, 2018 20:43
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: spew

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

@k8s-ci-robot k8s-ci-robot requested a review from krisnova June 10, 2018 20:43
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 10, 2018
@spew
Copy link
Contributor Author

spew commented Jun 10, 2018

/retest

@spew
Copy link
Contributor Author

spew commented Jun 10, 2018

/cc @jessicaochen @k4leung4 @karan

@spew
Copy link
Contributor Author

spew commented Jun 10, 2018

/assign @jessicaochen @k4leung4

@dims
Copy link
Member

dims commented Jun 10, 2018

/lgtm

@k8s-ci-robot
Copy link
Contributor

@dims: changing LGTM is restricted to assignees, and only kubernetes-sigs/cluster-api repo collaborators may be assigned issues.

In response to this:

/lgtm

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.

@k4leung4
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 11, 2018
@k8s-ci-robot k8s-ci-robot merged commit 7fdecc5 into kubernetes-sigs:master Jun 11, 2018
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. 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. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants