diff --git a/pkg/skaffold/deploy/kubectl/visitor.go b/pkg/skaffold/deploy/kubectl/visitor.go index e624f78e700..0a2fbf47a76 100644 --- a/pkg/skaffold/deploy/kubectl/visitor.go +++ b/pkg/skaffold/deploy/kubectl/visitor.go @@ -28,11 +28,14 @@ import ( var transformableWhitelist = map[apimachinery.GroupKind]bool{ {Group: "", Kind: "Pod"}: true, {Group: "apps", Kind: "DaemonSet"}: true, - {Group: "apps", Kind: "Deployment"}: true, + {Group: "apps", Kind: "Deployment"}: true, // v1beta1, v1beta2: deprecated in K8s 1.9, removed in 1.16 {Group: "apps", Kind: "ReplicaSet"}: true, {Group: "apps", Kind: "StatefulSet"}: true, {Group: "batch", Kind: "CronJob"}: true, {Group: "batch", Kind: "Job"}: true, + {Group: "extensions", Kind: "DaemonSet"}: true, // v1beta1: deprecated in K8s 1.9, removed in 1.16 + {Group: "extensions", Kind: "Deployment"}: true, // v1beta1: deprecated in K8s 1.9, removed in 1.16 + {Group: "extensions", Kind: "ReplicaSet"}: true, // v1beta1: deprecated in K8s 1.9, removed in 1.16 {Group: "serving.knative.dev", Kind: "Service"}: true, } diff --git a/pkg/skaffold/deploy/kubectl/visitor_test.go b/pkg/skaffold/deploy/kubectl/visitor_test.go index c90ba6bb4ee..c7cb0e3694c 100644 --- a/pkg/skaffold/deploy/kubectl/visitor_test.go +++ b/pkg/skaffold/deploy/kubectl/visitor_test.go @@ -157,6 +157,36 @@ spec: replicas: 0`), []byte(`name: repl`)}, expected: []string{"apiVersion=apps...", "kind=Depl...", "metadata=map[...", "name=app", "labels=map[...", "name=x", "spec=map[...", "replicas=0", "name=foo"}, }, + { + description: "deprecated daemonset.extensions", + manifests: ManifestList{[]byte(`apiVersion: extensions/v1beta1 +kind: DaemonSet +metadata: + name: app +spec: + replicas: 0`)}, + expected: []string{"apiVersion=exte...", "kind=Daem...", "metadata=map[...", "name=app", "spec=map[...", "replicas=0"}, + }, + { + description: "deprecated deployment.extensions", + manifests: ManifestList{[]byte(`apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: app +spec: + replicas: 0`)}, + expected: []string{"apiVersion=exte...", "kind=Depl...", "metadata=map[...", "name=app", "spec=map[...", "replicas=0"}, + }, + { + description: "deprecated replicaset.extensions", + manifests: ManifestList{[]byte(`apiVersion: extensions/v1beta1 +kind: ReplicaSet +metadata: + name: app +spec: + replicas: 0`)}, + expected: []string{"apiVersion=exte...", "kind=Repl...", "metadata=map[...", "name=app", "spec=map[...", "replicas=0"}, + }, { description: "invalid input", manifests: ManifestList{[]byte(`test:bar`)},