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

reconciler/apiexport: don't klog.Fatal #1291

Merged
merged 1 commit into from
Jun 20, 2022

Conversation

sttts
Copy link
Member

@sttts sttts commented Jun 20, 2022

Fixed old code that exits the process.

@openshift-ci openshift-ci bot requested review from ncdc and stevekuznetsov June 20, 2022 06:41
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 20, 2022
Copy link
Contributor

@s-urbaniak s-urbaniak left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 20, 2022
@openshift-ci openshift-ci bot merged commit 66ef40c into kcp-dev:main Jun 20, 2022
Copy link
Contributor

@s-urbaniak s-urbaniak left a comment

Choose a reason for hiding this comment

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

Let's make it a bit more clear to the future reader in comments how the logic about reconcilation works (in case of programming error objectmeta/spec change will be patched first, in the next iteration the status change).

@@ -322,10 +323,6 @@ func (c *controller) patchIfNeeded(ctx context.Context, old, obj *apisv1alpha1.A
specOrObjectMetaChanged := !equality.Semantic.DeepEqual(old.Spec, obj.Spec) || !equality.Semantic.DeepEqual(old.ObjectMeta, obj.ObjectMeta)
statusChanged := !equality.Semantic.DeepEqual(old.Status, obj.Status)

if specOrObjectMetaChanged && statusChanged {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's put as a comment on the inner apiExportForPatch declaration that the logic will guarantee that only the objectmeta/spec change will be patched first and on the next iteration the spec change.

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 20, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 20, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sttts

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

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants