Move testhelper package to pkg so it can be installed as dependency in secrets injector repo

This commit is contained in:
Volodymyr Zotov
2025-08-21 15:22:41 -05:00
parent 22a7c8f586
commit ca051a08cf
7 changed files with 27 additions and 8 deletions

View File

@@ -0,0 +1,23 @@
package kind
import (
"os"
//nolint:staticcheck // ST1001
. "github.com/onsi/ginkgo/v2"
//nolint:staticcheck // ST1001
. "github.com/onsi/gomega"
"github.com/1Password/onepassword-operator/pkg/testhelper/system"
)
// LoadImageToKind loads a local docker image to the Kind cluster
func LoadImageToKind(imageName string) {
By("loading the operator image on Kind")
clusterName := "kind"
if value, ok := os.LookupEnv("KIND_CLUSTER"); ok {
clusterName = value
}
_, err := system.Run("kind", "load", "docker-image", imageName, "--name", clusterName)
Expect(err).NotTo(HaveOccurred())
}