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 ClusterResourceSet not getting Secret/Configmap TypeMeta #4129

Merged
merged 1 commit into from
Feb 3, 2021

Conversation

sedefsavas
Copy link

What this PR does / why we need it:
After using live client for ConfigMap and Secrets, when doing get on the resources, TypeMeta is returned nil.
Using a different conversion fills apiVersion and kind fields.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #4115

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 28, 2021
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 28, 2021
@sedefsavas sedefsavas changed the title 🐛Fix cluster resource set not getting Secret/Configmap TypeMeta with l… 🐛Fix ClusterResourceSet not getting Secret/Configmap TypeMeta Jan 28, 2021
@vincepri
Copy link
Member

@sedefsavas Can you open a PR to the main branch first?

@sedefsavas sedefsavas changed the base branch from release-0.3 to master February 1, 2021 17:09
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 1, 2021
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Feb 1, 2021
@sedefsavas
Copy link
Author

/retest

@sedefsavas
Copy link
Author

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 1, 2021
@sedefsavas
Copy link
Author

/hold cancel

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 1, 2021
@sedefsavas
Copy link
Author

Moved PR to the main branch.

Copy link
Contributor

@wfernandes wfernandes left a comment

Choose a reason for hiding this comment

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

Just a couple of comments.
Also are we sure that the tests will catch the error above? I tried to get the tests to fail but couldn't. Maybe I'm missing something?

@vincepri
Copy link
Member

vincepri commented Feb 3, 2021

/test pull-cluster-api-test-main

@vincepri
Copy link
Member

vincepri commented Feb 3, 2021

@sedefsavas Is the test failure related? It seems to be failing on CRS tests

Comment on lines +392 to 393
err := r.Client.Scheme().Convert(resourceInterface, raw, nil)
if err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
err := r.Client.Scheme().Convert(resourceInterface, raw, nil)
if err != nil {
if err := r.Client.Scheme().Convert(resourceInterface, raw, nil); err != nil {

@sedefsavas
Copy link
Author

Passing locally and controllers test failed there.

/test pull-cluster-api-test-main

@sedefsavas
Copy link
Author

It passed now, retesting.
/test pull-cluster-api-test-main

@sedefsavas
Copy link
Author

This is looking good.
@vincepri

Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vincepri

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 added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 3, 2021
@vincepri
Copy link
Member

vincepri commented Feb 3, 2021

/milestone v0.4.0

@sedefsavas Can you open a cherry-pick PR to release-0.3 once this merges?

@k8s-ci-robot k8s-ci-robot added this to the v0.4.0 milestone Feb 3, 2021
@k8s-ci-robot k8s-ci-robot merged commit 88d38fe into kubernetes-sigs:master Feb 3, 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. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

Using ClusterResourceSet with Secret fails to apply
4 participants