diff --git a/internal/manifests/manifestutils/annotations.go b/internal/manifests/manifestutils/annotations.go index d4d102828c..539e890029 100644 --- a/internal/manifests/manifestutils/annotations.go +++ b/internal/manifests/manifestutils/annotations.go @@ -16,7 +16,7 @@ func Annotations(instance v1beta1.OpenTelemetryCollector, filterAnnotations []st // new map every time, so that we don't touch the instance's annotations annotations := map[string]string{} - if nil != instance.ObjectMeta.Annotations { + if instance.ObjectMeta.Annotations != nil { for k, v := range instance.ObjectMeta.Annotations { if !IsFilteredSet(k, filterAnnotations) { annotations[k] = v @@ -31,7 +31,7 @@ func Annotations(instance v1beta1.OpenTelemetryCollector, filterAnnotations []st func PodAnnotations(instance v1beta1.OpenTelemetryCollector, filterAnnotations []string) (map[string]string, error) { // new map every time, so that we don't touch the instance's annotations podAnnotations := map[string]string{} - if nil != instance.Spec.PodAnnotations { + if instance.Spec.PodAnnotations != nil { for k, v := range instance.Spec.PodAnnotations { if !IsFilteredSet(k, filterAnnotations) { podAnnotations[k] = v diff --git a/internal/manifests/manifestutils/labels.go b/internal/manifests/manifestutils/labels.go index b929264aac..1c596031f7 100644 --- a/internal/manifests/manifestutils/labels.go +++ b/internal/manifests/manifestutils/labels.go @@ -28,7 +28,7 @@ func Labels(instance metav1.ObjectMeta, name string, image string, component str var versionLabel string // new map every time, so that we don't touch the instance's label base := map[string]string{} - if nil != instance.Labels { + if instance.Labels != nil { for k, v := range instance.Labels { if !IsFilteredSet(k, filterLabels) { base[k] = v diff --git a/internal/manifests/opampbridge/annotations.go b/internal/manifests/opampbridge/annotations.go index bf2e27263d..3e54ccbfce 100644 --- a/internal/manifests/opampbridge/annotations.go +++ b/internal/manifests/opampbridge/annotations.go @@ -22,7 +22,7 @@ func Annotations(instance v1alpha1.OpAMPBridge, configMap *v1.ConfigMap, filterA for key, value := range instance.Spec.PodAnnotations { annotations[key] = value } - if nil != instance.ObjectMeta.Annotations { + if instance.ObjectMeta.Annotations != nil { for k, v := range instance.ObjectMeta.Annotations { if !manifestutils.IsFilteredSet(k, filterAnnotations) { annotations[k] = v diff --git a/internal/manifests/targetallocator/annotations.go b/internal/manifests/targetallocator/annotations.go index a387e1fb6c..f52c390880 100644 --- a/internal/manifests/targetallocator/annotations.go +++ b/internal/manifests/targetallocator/annotations.go @@ -22,7 +22,7 @@ func Annotations(instance v1alpha1.TargetAllocator, configMap *v1.ConfigMap, fil for key, value := range instance.Spec.PodAnnotations { annotations[key] = value } - if nil != instance.ObjectMeta.Annotations { + if instance.ObjectMeta.Annotations != nil { for k, v := range instance.ObjectMeta.Annotations { if !manifestutils.IsFilteredSet(k, filterAnnotations) { annotations[k] = v