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 round-trip of Unstructured.OwnerReferences #46683

Conversation

ash2k
Copy link
Member

@ash2k ash2k commented May 31, 2017

What this PR does / why we need it:
Previously setOwnerReference() was storing pointers but extractOwnerReference() is expecting pointer fields as plain values so it cannot read those pointers. And hence you cannot read what you've just stored.

Which issue this PR fixes
#46817

Special notes for your reviewer:
This is similar to #43346.

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 31, 2017
@k8s-ci-robot
Copy link
Contributor

Hi @ash2k. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with @k8s-bot ok to test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

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.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 31, 2017
@ash2k
Copy link
Member Author

ash2k commented May 31, 2017

/sig api-machinery

@k8s-ci-robot k8s-ci-robot added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label May 31, 2017
@k8s-github-robot k8s-github-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. release-note-none Denotes a PR that doesn't merit a release note. labels May 31, 2017
@ash2k
Copy link
Member Author

ash2k commented May 31, 2017

I'm not sure whether I've added tests to the right file - there is also k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructured_test.go with some tests for unstructured.

setNestedField(ret, src.Kind, "kind")
setNestedField(ret, src.Name, "name")
setNestedField(ret, src.APIVersion, "apiVersion")
setNestedField(ret, string(src.UID), "uid")
setNestedField(ret, controllerPtr, "controller")
setNestedField(ret, blockOwnerDeletionPtr, "blockOwnerDeletion")
if src.Controller != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

you need comments here explaining how the marshalling leaves nil as missing, and otherwise as a bool, so this matches the "normal" marshalling.

@deads2k
Copy link
Contributor

deads2k commented Jun 1, 2017

comment about adding a comment that needs to be addressed.

@deads2k deads2k assigned deads2k and unassigned krousey and mbohlool Jun 1, 2017
@deads2k
Copy link
Contributor

deads2k commented Jun 1, 2017

@k8s-bot ok to test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 1, 2017
@deads2k
Copy link
Contributor

deads2k commented Jun 1, 2017

@ash2k new process requires issues for bug fixes. Make an issue, link from your description, tag me, and I'll apply the necessary labels.

Previously setOwnerReference was storing pointers but
extractOwnerReference is expecting pointer fields as plain values.
Fixes kubernetes#46817
@ash2k ash2k force-pushed the fix-untructured-owner-references branch from 55d65e8 to 427b8cd Compare June 2, 2017 01:13
@ash2k
Copy link
Member Author

ash2k commented Jun 2, 2017

@deads2k added a comment to the code, created a tracking issue #46817.

@shashidharatd
Copy link

@k8s-bot pull-kubernetes-federation-e2e-gce test this
ref: #46827

@deads2k deads2k added this to the v1.7 milestone Jun 2, 2017
@deads2k
Copy link
Contributor

deads2k commented Jun 2, 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 Jun 2, 2017
@deads2k
Copy link
Contributor

deads2k commented Jun 2, 2017

@k8s-bot pull-kubernetes-e2e-gce-etcd3 test this
@k8s-bot pull-kubernetes-federation-e2e-gce test this

@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ash2k, deads2k
We suggest the following additional approver: smarterclayton

Assign the PR to them by writing /assign @smarterclayton in a comment when ready.

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

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

@deads2k deads2k added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 2, 2017
@deads2k
Copy link
Contributor

deads2k commented Jun 2, 2017

must be the apimachinery tests. approved

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Jun 2, 2017

@ash2k: The following test(s) failed:

Test name Commit Details Rerun command
pull-kubernetes-federation-e2e-gce 427b8cd link @k8s-bot pull-kubernetes-federation-e2e-gce test this

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.

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 44883, 46836, 46765, 46683, 46050)

@k8s-github-robot k8s-github-robot merged commit 61cd3fc into kubernetes:master Jun 6, 2017
@ash2k ash2k deleted the fix-untructured-owner-references branch June 15, 2017 06:31
@ash2k
Copy link
Member Author

ash2k commented Apr 23, 2021

/kind bug

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Apr 23, 2021
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. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants