mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #113348 from seans3/prune-ssa-fix
Disallow prune for server-side applied objects
This commit is contained in:
commit
4e800983fb
@ -381,6 +381,11 @@ func (o *ApplyOptions) Validate() error {
|
|||||||
return fmt.Errorf("--force cannot be used with --prune")
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,6 +147,14 @@ func TestApplyFlagValidation(t *testing.T) {
|
|||||||
},
|
},
|
||||||
expectedErr: "--force cannot be used with --prune",
|
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 {
|
for _, test := range tests {
|
||||||
|
Loading…
Reference in New Issue
Block a user