-
Notifications
You must be signed in to change notification settings - Fork 85
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
try apply yaml in best efforts #223
Conversation
Hi @xuzhenglun. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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/test-infra repository. |
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.
Thank you to create PR.
It looks almost good but left comment.
Please check those.
@@ -79,7 +85,7 @@ func (d *DirectApplier) Apply(ctx context.Context, opt ApplierOptions) error { | |||
applyCmd := apply.NewCmdApply(baseName, f, ioStreams) | |||
applyOpts, err := applyFlags.ToOptions(applyCmd, baseName, nil) | |||
if err != nil { | |||
return fmt.Errorf("error getting apply options: %w", err) | |||
return utilerrors.NewAggregate(append(errs, fmt.Errorf("error from SetNamespace: %w", err))) |
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.
Is message of error from SetNamespace
correct?
@@ -106,7 +112,8 @@ func (d *DirectApplier) Apply(ctx context.Context, opt ApplierOptions) error { | |||
IOStreams: ioStreams, | |||
} | |||
|
|||
return applyOpts.Run() | |||
err = applyOpts.Run() | |||
return utilerrors.NewAggregate(append(errs, fmt.Errorf("error from SetNamespace: %w", err))) |
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.
ditto.
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.
ho, I just corrected it.
/ok-to-test |
@atoato88 Is anything else I need to do? |
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: atoato88, xuzhenglun 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 |
What this PR does / why we need it:
resource <Kind> is not found
will return.kubectl
will try its best efforts to apply YAMLs. In the progress, maybe CRDs have not been established and an error could return. But in the next retry, all YAMLs can be applied successfully.ref: https://github.com/kubernetes/kubectl/blob/master/pkg/cmd/apply/apply.go#L438
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Additional documentation: