mirror of
https://github.com/kubernetes/kubectl.git
synced 2026-05-28 04:35:50 -04:00
Fixes prune for server-side applied objects
Kubernetes-commit: 21393f1b1d859cecdcc9aeee01f7dbf9aab71120
This commit is contained in:
parent
b46583a036
commit
7efcc7e0ac
2 changed files with 13 additions and 0 deletions
|
|
@ -381,6 +381,11 @@ func (o *ApplyOptions) Validate() error {
|
|||
return fmt.Errorf("--force cannot be used with --prune")
|
||||
}
|
||||
|
||||
// Currently do not support pruning objects which are server-side applied.
|
||||
if o.Prune && o.ServerSideApply {
|
||||
return fmt.Errorf("--prune is in alpha and doesn't currently work on objects created by server-side apply")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -147,6 +147,14 @@ func TestApplyFlagValidation(t *testing.T) {
|
|||
},
|
||||
expectedErr: "--force cannot be used with --prune",
|
||||
},
|
||||
{
|
||||
args: [][]string{
|
||||
{"server-side", "true"},
|
||||
{"prune", "true"},
|
||||
{"all", "true"},
|
||||
},
|
||||
expectedErr: "--prune is in alpha and doesn't currently work on objects created by server-side apply",
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
|
|
|
|||
Loading…
Reference in a new issue