mirror of
https://github.com/helm/helm.git
synced 2026-04-21 06:06:56 -04:00
Merge f257c95c78 into 1be395e7aa
This commit is contained in:
commit
45cb563ff2
2 changed files with 18 additions and 1 deletions
|
|
@ -1241,7 +1241,7 @@ func patchResourceServerSide(target *resource.Info, dryRun bool, forceConflicts
|
|||
return fmt.Errorf("conflict occurred while applying object %s/%s %s: %w", target.Namespace, target.Name, target.Mapping.GroupVersionKind.String(), err)
|
||||
}
|
||||
|
||||
return err
|
||||
return fmt.Errorf("server-side apply failed for object %s/%s %s: %w", target.Namespace, target.Name, target.Mapping.GroupVersionKind.String(), err)
|
||||
}
|
||||
|
||||
return target.Refresh(obj, true)
|
||||
|
|
|
|||
|
|
@ -1802,6 +1802,23 @@ func TestPatchResourceServerSide(t *testing.T) {
|
|||
},
|
||||
ExpectedErrorContains: "the server reported a conflict",
|
||||
},
|
||||
"generic server-side apply error": {
|
||||
Pods: newPodList("whale"),
|
||||
DryRun: false,
|
||||
ForceConflicts: false,
|
||||
FieldValidationDirective: FieldValidationDirectiveStrict,
|
||||
Callback: func(t *testing.T, _ testCase, _ []RequestResponseAction, _ *http.Request) (*http.Response, error) {
|
||||
t.Helper()
|
||||
|
||||
return newResponse(http.StatusBadRequest, &metav1.Status{
|
||||
Status: metav1.StatusFailure,
|
||||
Message: `failed to create typed patch object: .spec.template.spec.containers[name="test"].env: duplicate entries for key [name="SERVER_CONTEXT_PATH"]`,
|
||||
Reason: metav1.StatusReasonBadRequest,
|
||||
Code: http.StatusBadRequest,
|
||||
})
|
||||
},
|
||||
ExpectedErrorContains: "server-side apply failed for object default/whale /v1, Kind=Pod: failed to create typed patch object",
|
||||
},
|
||||
}
|
||||
|
||||
for name, tc := range testCases {
|
||||
|
|
|
|||
Loading…
Reference in a new issue