diff --git a/go.mod b/go.mod index e306367dd..a88b2a32b 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( k8s.io/apimachinery v0.18.9 k8s.io/client-go v0.18.9 k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6 - kmodules.xyz/client-go v0.0.0-20201105071625-0b277310b9b8 + kmodules.xyz/client-go v0.0.0-20201208053851-a1d7be95e006 kmodules.xyz/crd-schema-fuzz v0.0.0-20200922204806-c1426cd7fcf4 kmodules.xyz/custom-resources v0.0.0-20201124062543-bd8d35c21b0c kmodules.xyz/offshoot-api v0.0.0-20201105074700-8675f5f686f2 diff --git a/go.sum b/go.sum index 7fa854a4b..ad9fd34a2 100644 --- a/go.sum +++ b/go.sum @@ -949,6 +949,8 @@ k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89 h1:d4vVOjXm687F1iLSP2q3lyPPuyvTU k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= kmodules.xyz/client-go v0.0.0-20201105071625-0b277310b9b8 h1:zs2+yI/Ola5HjdtfP29XD76Bx5BO4WchC2uN9lkhxQM= kmodules.xyz/client-go v0.0.0-20201105071625-0b277310b9b8/go.mod h1:WXDwZBmvrcLgGcuO9iZpI9jcfPuDFfWbxA4EnhAFtGw= +kmodules.xyz/client-go v0.0.0-20201208053851-a1d7be95e006 h1:gNrNTwi0jViRqdszsb0W5CQF+ANNVFlvh/LO0A3R7dM= +kmodules.xyz/client-go v0.0.0-20201208053851-a1d7be95e006/go.mod h1:WXDwZBmvrcLgGcuO9iZpI9jcfPuDFfWbxA4EnhAFtGw= kmodules.xyz/constants v0.0.0-20200923054614-6b87dbbae4d6/go.mod h1:DbiFk1bJ1KEO94t1SlAn7tzc+Zz95rSXgyUKa2nzPmY= kmodules.xyz/crd-schema-fuzz v0.0.0-20200922204806-c1426cd7fcf4 h1:NWWv+Qju8xzHZT9hIk1+BbgQtIytNOoCU4g4vqUmh3M= kmodules.xyz/crd-schema-fuzz v0.0.0-20200922204806-c1426cd7fcf4/go.mod h1:WrO3fryNyFCgqqyWnwI89lnzWA7kN072Ehya7ELGfzE= diff --git a/vendor/kmodules.xyz/client-go/core/v1/kubernetes.go b/vendor/kmodules.xyz/client-go/core/v1/kubernetes.go index 1ac6cb833..5acc264d0 100644 --- a/vendor/kmodules.xyz/client-go/core/v1/kubernetes.go +++ b/vendor/kmodules.xyz/client-go/core/v1/kubernetes.go @@ -71,10 +71,16 @@ func EnsureContainerDeleted(containers []core.Container, name string) []core.Con func UpsertContainer(containers []core.Container, upsert core.Container) []core.Container { for i, container := range containers { if container.Name == upsert.Name { - err := mergo.MergeWithOverwrite(&container, upsert) + err := mergo.Merge(&container, upsert, mergo.WithOverride) if err != nil { panic(err) } + // mergo does not overwrite "dst (container)" using empty "src (upsert)" values. + // This causes problem we want to remove args or commands (eg, disable TLS). + // TODO: should this be done for all the []string type fields (eg, EnvFrom etc.)? + container.Command = upsert.Command + container.Args = upsert.Args + container.Env = upsert.Env containers[i] = container return containers } diff --git a/vendor/modules.txt b/vendor/modules.txt index 4bb5406a9..ac238c3a5 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -844,7 +844,7 @@ k8s.io/utils/net k8s.io/utils/path k8s.io/utils/pointer k8s.io/utils/trace -# kmodules.xyz/client-go v0.0.0-20201105071625-0b277310b9b8 +# kmodules.xyz/client-go v0.0.0-20201208053851-a1d7be95e006 kmodules.xyz/client-go kmodules.xyz/client-go/api/v1 kmodules.xyz/client-go/apiextensions