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 <[email protected]>
  • Loading branch information
tmshort committed Nov 14, 2023
1 parent 99c283b commit ca58fef
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 ca58fef

Please sign in to comment.