Skip to content

Commit ac50ddc

Browse files
author
Jeff Peeler
committed
fix(olm): do not check namespace if casting failed
1 parent 5b7d140 commit ac50ddc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/controller/operators/olm/operator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,11 +751,11 @@ func (a *Operator) crdOwnerConflicts(in *v1alpha1.ClusterServiceVersion, csvsInN
751751
// syncNamespace is the method that gets called when we see a namespace event in the cluster
752752
func (a *Operator) syncNamespace(obj interface{}) (syncError error) {
753753
namespace, ok := obj.(*corev1.Namespace)
754-
namespaceName := namespace.GetName()
755754
if !ok {
756755
log.Debugf("wrong type: %#v", obj)
757756
return fmt.Errorf("casting Namespace failed")
758757
}
758+
namespaceName := namespace.GetName()
759759

760760
log.Infof("syncing Namespace: %s", namespaceName)
761761
if err := a.annotator.AnnotateNamespace(namespace); err != nil {

0 commit comments

Comments
 (0)