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 apply resources #389

Merged

Conversation

qiujian16
Copy link
Member

This may impact multiple functions

Summary

Related issue(s)

Fixes #383

This may impact multiple functions

Signed-off-by: Jian Qiu <jqiu@redhat.com>
Copy link

openshift-ci bot commented Nov 6, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qiujian16

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 openshift-ci bot added the approved label Nov 6, 2023
@qiujian16
Copy link
Member Author

/assign @zhujian7

@@ -88,6 +89,11 @@ func (r *ResourceReader) applyOneObject(info *resource.Info) error {
helper := resource.NewHelper(info.Client, info.Mapping).
DryRun(r.dryRun)

modified, err := kubectlutil.GetModifiedConfiguration(info.Object, false, unstructured.UnstructuredJSONScheme)
Copy link
Member

Choose a reason for hiding this comment

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

Hi @qiujian16 could you add some comments/tests for this, I do not understand why moving this func upper can fix the issue.

Copy link
Member Author

Choose a reason for hiding this comment

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

this is to get the modified object, it has to be called before info.Get() otherwise the info.Object will be from the server. A test is added.

Signed-off-by: Jian Qiu <jqiu@redhat.com>
@zhujian7
Copy link
Member

zhujian7 commented Nov 8, 2023

/lgtm
/hold
@qiujian16 feel free to unhold

@qiujian16
Copy link
Member Author

/unhold

@openshift-merge-bot openshift-merge-bot bot merged commit d7db0ea into open-cluster-management-io:main Nov 8, 2023
8 checks passed
@qiujian16 qiujian16 deleted the fix-apply branch November 8, 2023 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Re-init doesn't work well
2 participants