|
|
@ -23,12 +23,13 @@ import (
|
|
|
|
goerrors "errors"
|
|
|
|
goerrors "errors"
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"io"
|
|
|
|
"io"
|
|
|
|
"k8s.io/apimachinery/pkg/api/meta"
|
|
|
|
|
|
|
|
"log"
|
|
|
|
"log"
|
|
|
|
"sort"
|
|
|
|
"sort"
|
|
|
|
"strings"
|
|
|
|
"strings"
|
|
|
|
"time"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"k8s.io/apimachinery/pkg/api/meta"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/evanphx/json-patch"
|
|
|
|
"github.com/evanphx/json-patch"
|
|
|
|
appsv1 "k8s.io/api/apps/v1"
|
|
|
|
appsv1 "k8s.io/api/apps/v1"
|
|
|
|
appsv1beta1 "k8s.io/api/apps/v1beta1"
|
|
|
|
appsv1beta1 "k8s.io/api/apps/v1beta1"
|
|
|
@ -362,8 +363,9 @@ func (c *Client) Update(namespace string, originalReader, targetReader io.Reader
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
c.Log("Unable to get annotations on %q, err: %s", info.Name, err)
|
|
|
|
c.Log("Unable to get annotations on %q, err: %s", info.Name, err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if annotations != nil && annotations[ResourcePolicyAnno] == KeepPolicy {
|
|
|
|
if ResourcePolicyIsKeep(annotations) {
|
|
|
|
c.Log("Skipping delete of %q due to annotation [%s=%s]", info.Name, ResourcePolicyAnno, KeepPolicy)
|
|
|
|
policy := annotations[ResourcePolicyAnno]
|
|
|
|
|
|
|
|
c.Log("Skipping delete of %q due to annotation [%s=%s]", info.Name, ResourcePolicyAnno, policy)
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|