Merge pull request #7320 from PhilGrayson/issue-7279

Do not delete templated CRDs
pull/7373/head
Taylor Thomas 5 years ago committed by GitHub
commit f35719a62a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -202,6 +202,11 @@ func (c *Client) Update(original, target ResourceList, force bool) (*Result, err
}
for _, info := range original.Difference(target) {
if info.Mapping.GroupVersionKind.Kind == "CustomResourceDefinition" {
c.Log("Skipping the deletion of CustomResourceDefinition %q", info.Name)
continue
}
c.Log("Deleting %q in %s...", info.Name, info.Namespace)
res.Deleted = append(res.Deleted, info)
if err := deleteResource(info); err != nil {
@ -224,6 +229,11 @@ func (c *Client) Delete(resources ResourceList) (*Result, []error) {
var errs []error
res := &Result{}
err := perform(resources, func(info *resource.Info) error {
if info.Mapping.GroupVersionKind.Kind == "CustomResourceDefinition" {
c.Log("Skipping the deletion of CustomResourceDefinition %q", info.Name)
return nil
}
c.Log("Starting delete for %q %s", info.Name, info.Mapping.GroupVersionKind.Kind)
if err := c.skipIfNotFound(deleteResource(info)); err != nil {
// Collect the error and continue on

Loading…
Cancel
Save