Skip to content

Commit

Permalink
Use random name for operators
Browse files Browse the repository at this point in the history
Signed-off-by: Todd Short <tshort@redhat.com>
  • Loading branch information
tmshort committed Nov 14, 2023
1 parent 9c31974 commit 7c94479
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions internal/controllers/admission_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import (

"github.com/stretchr/testify/require"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/rand"

operatorsv1alpha1 "github.com/operator-framework/operator-controller/api/v1alpha1"
)

func operator(spec operatorsv1alpha1.OperatorSpec) *operatorsv1alpha1.Operator {
return &operatorsv1alpha1.Operator{
ObjectMeta: metav1.ObjectMeta{
Name: "test-operator",
Name: "test-operator-" + rand.String(6),
},
Spec: spec,
}
Expand Down Expand Up @@ -158,8 +159,6 @@ func TestOperatorValidSemver(t *testing.T) {
require.NotNil(t, cl)
err = cl.Create(ctx, op)
require.NoErrorf(t, err, "unexpected error for semver range '%q': %w", validSemver, err)
err = cl.Delete(ctx, op)
require.NoErrorf(t, err, "unexpected error deleting valid semver '%q': %w", validSemver, err)
}
}

Expand Down Expand Up @@ -209,7 +208,5 @@ func TestOperatorValidChannel(t *testing.T) {
require.NotNil(t, cl)
err = cl.Create(ctx, op)
require.NoErrorf(t, err, "unexpected error creating valid channel '%q': %w", validChannel, err)
err = cl.Delete(ctx, op)
require.NoErrorf(t, err, "unexpected error deleting valid channel '%q': %w", validChannel, err)
}
}

0 comments on commit 7c94479

Please sign in to comment.