diff --git a/CHANGELOG.md b/CHANGELOG.md index a6ba47e01d..83d1d10a23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## v1.5.1 + +* Bug fix - [Ignore namespace for custom eniconfig watch](https://github.com/aws/amazon-vpc-cni-k8s/pull/561) (#561, @mogren) + ## v1.5.0 * Bug fix - [Fix spelling on annotation](https://github.com/aws/amazon-vpc-cni-k8s/pull/482) (#482, @forsberg) diff --git a/config/v1.5/aws-k8s-cni.yaml b/config/v1.5/aws-k8s-cni.yaml index 958b0ff977..6b468fed67 100644 --- a/config/v1.5/aws-k8s-cni.yaml +++ b/config/v1.5/aws-k8s-cni.yaml @@ -81,7 +81,7 @@ spec: tolerations: - operator: Exists containers: - - image: 602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon-k8s-cni:v1.5.0 + - image: 602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon-k8s-cni:v1.5.1 imagePullPolicy: Always ports: - containerPort: 61678 @@ -102,10 +102,6 @@ spec: valueFrom: fieldRef: fieldPath: spec.nodeName - - name: WATCH_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace resources: requests: cpu: 10m diff --git a/pkg/apis/crd/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/crd/v1alpha1/zz_generated.deepcopy.go index 6c8f9f77e2..feb45b9835 100644 --- a/pkg/apis/crd/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/crd/v1alpha1/zz_generated.deepcopy.go @@ -13,7 +13,7 @@ func (in *ENIConfig) DeepCopyInto(out *ENIConfig) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec + in.Spec.DeepCopyInto(&out.Spec) out.Status = in.Status return } @@ -72,6 +72,11 @@ func (in *ENIConfigList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ENIConfigSpec) DeepCopyInto(out *ENIConfigSpec) { *out = *in + if in.SecurityGroups != nil { + in, out := &in.SecurityGroups, &out.SecurityGroups + *out = make([]string, len(*in)) + copy(*out, *in) + } return } diff --git a/pkg/eniconfig/eniconfig.go b/pkg/eniconfig/eniconfig.go index d4ad2a3078..4b0a34204a 100644 --- a/pkg/eniconfig/eniconfig.go +++ b/pkg/eniconfig/eniconfig.go @@ -26,12 +26,9 @@ import ( "github.com/aws/amazon-vpc-cni-k8s/pkg/apis/crd/v1alpha1" - corev1 "k8s.io/api/core/v1" - - "github.com/operator-framework/operator-sdk/pkg/util/k8sutil" - sdkVersion "github.com/operator-framework/operator-sdk/version" - log "github.com/cihub/seelog" + sdkVersion "github.com/operator-framework/operator-sdk/version" + corev1 "k8s.io/api/core/v1" ) const ( @@ -154,13 +151,9 @@ func (eniCfg *ENIConfigController) Start() { resource := "crd.k8s.amazonaws.com/v1alpha1" kind := "ENIConfig" - namespace, err := k8sutil.GetWatchNamespace() - if err != nil { - log.Errorf("failed to get watch namespace: %v", err) - } resyncPeriod := time.Second * 5 - log.Infof("Watching %s, %s, %s, every %v s", resource, kind, namespace, resyncPeriod.Seconds()) - sdk.Watch(resource, kind, namespace, resyncPeriod) + log.Infof("Watching %s, %s, every %v s", resource, kind, resyncPeriod.Seconds()) + sdk.Watch(resource, kind, "", resyncPeriod) sdk.Watch("/v1", "Node", corev1.NamespaceAll, resyncPeriod) sdk.Handle(NewHandler(eniCfg)) sdk.Run(context.TODO()) @@ -180,7 +173,6 @@ func (eniCfg *ENIConfigController) Getter() *ENIConfigInfo { for name, val := range eniCfg.eni { output.ENI[name] = *val } - return output } diff --git a/vendor/gopkg.in/yaml.v2/go.mod b/vendor/gopkg.in/yaml.v2/go.mod index 1934e87694..ee8918f563 100644 --- a/vendor/gopkg.in/yaml.v2/go.mod +++ b/vendor/gopkg.in/yaml.v2/go.mod @@ -1,5 +1,3 @@ -module "gopkg.in/yaml.v2" +module gopkg.in/yaml.v2 -require ( - "gopkg.in/check.v1" v0.0.0-20161208181325-20d25e280405 -) +require gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405