Remove operator package, as make commands can be run directly using system.Run

This commit is contained in:
Volodymyr Zotov
2025-08-28 13:12:48 -05:00
parent 9d08bcc864
commit 6492b3cf34
2 changed files with 6 additions and 30 deletions

View File

@@ -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())
}

View File

@@ -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)
})