mirror of
https://github.com/1Password/onepassword-operator.git
synced 2025-10-24 16:30:47 +00:00
Wait for Connect pod is running
This commit is contained in:
@@ -37,9 +37,14 @@ var _ = Describe("Onepassword Operator e2e", Ordered, func() {
|
|||||||
kube.CreateSecretFromEnvVar("OP_SERVICE_ACCOUNT_TOKEN", "onepassword-service-account-token")
|
kube.CreateSecretFromEnvVar("OP_SERVICE_ACCOUNT_TOKEN", "onepassword-service-account-token")
|
||||||
|
|
||||||
operator.DeployOperator()
|
operator.DeployOperator()
|
||||||
|
operator.WaitingForOperatorPod()
|
||||||
})
|
})
|
||||||
|
|
||||||
Context("Use the operator with Connect", func() {
|
Context("Use the operator with Connect", func() {
|
||||||
|
BeforeAll(func() {
|
||||||
|
operator.WaitingForConnectPod()
|
||||||
|
})
|
||||||
|
|
||||||
runCommonTestCases()
|
runCommonTestCases()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func BuildOperatorImage() {
|
func BuildOperatorImage() {
|
||||||
By("building the operator image")
|
By("building the Operator image")
|
||||||
_, err := system.Run("make", "docker-build")
|
_, err := system.Run("make", "docker-build")
|
||||||
ExpectWithOffset(1, err).NotTo(HaveOccurred())
|
ExpectWithOffset(1, err).NotTo(HaveOccurred())
|
||||||
}
|
}
|
||||||
@@ -20,11 +20,13 @@ func BuildOperatorImage() {
|
|||||||
// All the resources created using manifests in `config/` dir.
|
// All the resources created using manifests in `config/` dir.
|
||||||
// To make the operator use Connect or Service Accounts, patch `config/manager/manager.yaml`
|
// To make the operator use Connect or Service Accounts, patch `config/manager/manager.yaml`
|
||||||
func DeployOperator() {
|
func DeployOperator() {
|
||||||
By("deploying the operator")
|
By("deploying the Operator")
|
||||||
_, err := system.Run("make", "deploy")
|
_, err := system.Run("make", "deploy")
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred())
|
||||||
|
}
|
||||||
|
|
||||||
By("waiting for the operator pod to be 'Running'")
|
func WaitingForOperatorPod() {
|
||||||
|
By("Waiting for the Operator pod to be 'Running'")
|
||||||
Eventually(func(g Gomega) {
|
Eventually(func(g Gomega) {
|
||||||
output, err := system.Run("kubectl", "get", "pods",
|
output, err := system.Run("kubectl", "get", "pods",
|
||||||
"-l", "name=onepassword-connect-operator",
|
"-l", "name=onepassword-connect-operator",
|
||||||
@@ -33,3 +35,14 @@ func DeployOperator() {
|
|||||||
g.Expect(output).To(ContainSubstring("Running"))
|
g.Expect(output).To(ContainSubstring("Running"))
|
||||||
}, 30*time.Second, 1*time.Second).Should(Succeed())
|
}, 30*time.Second, 1*time.Second).Should(Succeed())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func WaitingForConnectPod() {
|
||||||
|
By("Waiting for the Connect pod to be 'Running'")
|
||||||
|
Eventually(func(g Gomega) {
|
||||||
|
output, err := system.Run("kubectl", "get", "pods",
|
||||||
|
"-l", "app=onepassword-connect",
|
||||||
|
"-o", "jsonpath={.items[0].status.phase}")
|
||||||
|
g.Expect(err).NotTo(HaveOccurred())
|
||||||
|
g.Expect(output).To(ContainSubstring("Running"))
|
||||||
|
}, 30*time.Second, 1*time.Second).Should(Succeed())
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user