Skip to content

Conversation

@Daniel-Fan
Copy link
Contributor

@Daniel-Fan Daniel-Fan commented Sep 30, 2021

Some k8s resources could not be updated after it is created. Job for example

Since we will overwrite the resources when it is forced to update. now the update logic will delete the resource and then create a new one.

@Daniel-Fan
Copy link
Contributor Author

It is ready for merging.

}

// delete the existing k8s resource, some resources could not be updated after it has been created
if err := r.Client.Delete(ctx, &existingK8sRes); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this line cause the k8s resource to get deleted in every reconcile loop?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, when ODLM is reconciling, and the resources is forced to update and label is correct. It will be deleted and re-created

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But even if we use the Update(), the resource will be updated in each reconcile loop except the resource could not be updated.

One solution is to compare the existing resource with the new template, and decide whether we should update it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Could I ask which k8s resouce, that can't be updated?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

like job, some of fields in template is immutable, so we could not update it.

Copy link
Contributor

@ZhuoxiLi ZhuoxiLi left a comment

Choose a reason for hiding this comment

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

/lgtm

@ibm-ci-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Daniel-Fan, ZhuoxiLi

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

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [Daniel-Fan,ZhuoxiLi]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ibm-ci-bot ibm-ci-bot merged commit c840b9e into IBM:master Sep 30, 2021
Daniel-Fan added a commit to Daniel-Fan/operand-deployment-lifecycle-manager that referenced this pull request Sep 30, 2021
ibm-ci-bot pushed a commit that referenced this pull request Sep 30, 2021
* Revert "update the logic for updating the k8s resourcces (#752)"

This reverts commit c840b9e.

* skip Job update for October release
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.

4 participants