mirror of
https://github.com/1Password/onepassword-operator.git
synced 2025-10-22 23:48:05 +00:00
Extract setting context namespace to standalone function SetContextNamespace
This commit is contained in:
@@ -22,10 +22,8 @@ const (
|
||||
|
||||
var _ = Describe("Onepassword Operator e2e", Ordered, func() {
|
||||
BeforeAll(func() {
|
||||
By("Set namespace to default")
|
||||
_, _ = system.Run("kubectl", "config", "set-context", "--current", "--namespace=default")
|
||||
kube.SetContextNamespace("default")
|
||||
|
||||
By("Build the operator image")
|
||||
operator.BuildOperatorImage()
|
||||
kind.LoadImageToKind(operatorImageName)
|
||||
|
||||
|
@@ -48,6 +48,12 @@ func DeleteSecret(name string) {
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
}
|
||||
|
||||
func SetContextNamespace(namespace string) {
|
||||
By("Set namespace to " + namespace)
|
||||
_, err := system.Run("kubectl", "config", "set-context", "--current", "--namespace="+namespace)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
}
|
||||
|
||||
// PatchOperatorToUseServiceAccount sets `OP_SERVICE_ACCOUNT_TOKEN` env variable
|
||||
var PatchOperatorToUseServiceAccount = WithOperatorRestart(func() {
|
||||
By("patching the operator deployment with service account token")
|
||||
|
Reference in New Issue
Block a user