diff --git a/pkg/testhelper/operator/operator.go b/pkg/testhelper/operator/operator.go deleted file mode 100644 index a965e7b..0000000 --- a/pkg/testhelper/operator/operator.go +++ /dev/null @@ -1,27 +0,0 @@ -package operator - -import ( - //nolint:staticcheck // ST1001 - . "github.com/onsi/ginkgo/v2" - //nolint:staticcheck // ST1001 - . "github.com/onsi/gomega" - - "github.com/1Password/onepassword-operator/pkg/testhelper/system" -) - -// BuildOperatorImage builds the Operator image using `make docker-build` -func BuildOperatorImage() { - By("Building the Operator image") - _, err := system.Run("make", "docker-build") - ExpectWithOffset(1, err).NotTo(HaveOccurred()) -} - -// DeployOperator deploys the Operator in the default namespace. -// It waits for the operator pod to be in 'Running' state. -// All the resources created using manifests in `config/` dir. -// To make the operator use Connect or Service Accounts, patch `config/manager/manager.yaml` -func DeployOperator() { - By("Deploying the Operator") - _, err := system.Run("make", "deploy") - Expect(err).NotTo(HaveOccurred()) -} diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index 8208353..a2ed2ec 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -16,7 +16,6 @@ import ( "github.com/1Password/onepassword-operator/pkg/testhelper/kind" "github.com/1Password/onepassword-operator/pkg/testhelper/kube" "github.com/1Password/onepassword-operator/pkg/testhelper/op" - "github.com/1Password/onepassword-operator/pkg/testhelper/operator" "github.com/1Password/onepassword-operator/pkg/testhelper/system" ) @@ -46,7 +45,10 @@ var _ = Describe("Onepassword Operator e2e", Ordered, func() { }, }) - operator.BuildOperatorImage() + By("Building the Operator image") + _, err = system.Run("make", "docker-build") + Expect(err).NotTo(HaveOccurred()) + kind.LoadImageToKind(operatorImageName) kubeClient.Secret("op-credentials").CreateOpCredentials(ctx) @@ -58,7 +60,8 @@ var _ = Describe("Onepassword Operator e2e", Ordered, func() { kubeClient.Secret("onepassword-service-account-token").CreateFromEnvVar(ctx, "OP_SERVICE_ACCOUNT_TOKEN") kubeClient.Secret("onepassword-service-account-token").CheckIfExists(ctx) - operator.DeployOperator() + _, err = system.Run("make", "deploy") + Expect(err).NotTo(HaveOccurred()) kubeClient.Pod(map[string]string{"name": "onepassword-connect-operator"}).WaitingForRunningPod(ctx) })