-
Notifications
You must be signed in to change notification settings - Fork 105
OCPBUGS-35855: Wire dry run option to Image API server operations #511
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
Conversation
|
@ardaguclu: This pull request references Jira Issue OCPBUGS-35855, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
/hold |
|
/jira refresh |
|
@ardaguclu: This pull request references Jira Issue OCPBUGS-35855, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
@ardaguclu: This pull request references Jira Issue OCPBUGS-35855, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
/label qe-approved |
|
@ardaguclu: This pull request references Jira Issue OCPBUGS-35855, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
Tests have completed and patch worked; |
|
/approve |
| }) | ||
| } else { | ||
| target, err = r.imageStreamRegistry.UpdateImageStream(ctx, target, false, &metav1.UpdateOptions{}) | ||
| target, err = r.imageStreamRegistry.UpdateImageStream(ctx, target, false, &metav1.UpdateOptions{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering why we don't just pass the entire options object. At the very least, it would work for the update branch, though there's also the create branch to consider.
One benefit would be that we could also keep track of field owners. Maybe that's something we can improve in the future.
For now, would it make sense to create a small helper function that generates the supported options?
For example:
func updateOptionsToSupportedUpdateOptions(opts *metav1.UpdateOptions) *metav1.UpdateOptions {
if opts == nil {
return nil
}
return &metav1.UpdateOptions{
DryRun: opts.DryRun,
}
}
func updateOptionsToSupportedCreateOptions(opts *metav1.UpdateOptions) *metav1.CreateOptions {
if opts == nil {
return nil
}
return &metav1.CreateOptions{
DryRun: opts.DryRun,
}
}
please also consider adding comments to these functions explaining that maybe in the future the list of supported options could be extended (field ownership)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Carrying fieldManager field in options may create conflicts, if there is another resource that uses server side apply. So I deliberately only carry the dry run options which makes this PR is a safe change.
But for the long term I agree with you, fieldManager field can also be carried as well. So that I've applied to your suggestion and moved the logic under helper functions.
Please let me know what you think. Thanks for review.
|
looks flaky |
|
/lgtm |
|
@p0lyn0mial I forgot to rename all the usages of |
|
/lgtm Also many thanks for the PR! |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ardaguclu, flavianmissi, p0lyn0mial 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 |
|
/retest |
|
@ardaguclu: all tests passed! Full PR test history. Your PR dashboard. 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-sigs/prow repository. I understand the commands that are listed here. |
|
@ardaguclu: Jira Issue OCPBUGS-35855: Some pull requests linked via external trackers have merged: The following pull requests linked via external trackers have not merged:
These pull request must merge or be unlinked from the Jira bug in order for it to move to the next state. Once unlinked, request a bug refresh with Jira Issue OCPBUGS-35855 has not been moved to the MODIFIED state. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
[ART PR BUILD NOTIFIER] Distgit: ose-openshift-apiserver |
|
/cherry-pick release-4.19 |
|
@wangke19: new pull request created: #524 In response to this:
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-sigs/prow repository. |
Some of API servers that run in openshift-apiserver do not support dry run (like Image). So that when user passes
--dry-run=serverin oc for image related resources (as described in the linked issue), it actually performs the operation instead of simulating the operation and outputs the result. This is unwanted and disruptive behavior that may lead to undesired consequences.The reason of the issue is dry-run option is not wired through the storage layer of Image. This PR tries to achieve this.