-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP - introducing imagePullSecrets * Adding test for imagepullsecrets * now creates a docker secret * the secret is created and passed to the helm chart * refactoring helm install to always use the imagepullsecret * refactor example cluster creation to honor the operator secret * cluster wide install test now honors imagepullsecret * upgrade operator test should honor ImagePullSecret * import fix * added write-up for the helm chart * added test doc * revert upgrade_operator test changes
- Loading branch information
1 parent
06804bd
commit 3516aa1
Showing
9 changed files
with
176 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
tests/helm_chart_imagepullsecrets/helm_chart_imagepullsecrets_suite_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// Copyright DataStax, Inc. | ||
// Please see the included license file for details. | ||
|
||
package helm_chart_imagepullsecrets | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
|
||
ginkgo_util "github.com/datastax/cass-operator/mage/ginkgo" | ||
"github.com/datastax/cass-operator/mage/kubectl" | ||
) | ||
|
||
var ( | ||
testName = "Helm Chart imagePullSecrets" | ||
opNamespace = "test-helm-chart-imagepullsecrets" | ||
dc1Name = "dc2" | ||
dc1Yaml = "../testdata/default-single-rack-single-node-dc.yaml" | ||
ns = ginkgo_util.NewWrapper(testName, opNamespace) | ||
) | ||
|
||
func TestLifecycle(t *testing.T) { | ||
// Only run this test if docker creds are defined | ||
if kubectl.DockerCredentialsDefined() { | ||
AfterSuite(func() { | ||
logPath := fmt.Sprintf("%s/aftersuite", ns.LogDir) | ||
err := kubectl.DumpAllLogs(logPath).ExecV() | ||
if err != nil { | ||
fmt.Printf("\n\tError during dumping logs: %s\n\n", err.Error()) | ||
} | ||
fmt.Printf("\n\tPost-run logs dumped at: %s\n\n", logPath) | ||
ns.Terminate() | ||
}) | ||
|
||
RegisterFailHandler(Fail) | ||
RunSpecs(t, testName) | ||
} | ||
} | ||
|
||
var _ = Describe(testName, func() { | ||
Context("when in a new cluster", func() { | ||
Specify("the operator can be correctly installed with imagePullSecrets", func() { | ||
|
||
By("creating a namespace for the cass-operator") | ||
err := kubectl.CreateNamespace(opNamespace).ExecV() | ||
Expect(err).ToNot(HaveOccurred()) | ||
|
||
step := "setting up cass-operator resources via helm chart" | ||
|
||
ns.HelmInstall("../../charts/cass-operator-chart") | ||
|
||
ns.WaitForOperatorReady() | ||
|
||
// Create a small cass cluster to verify cass-operator is functional | ||
step = "creating first datacenter resource" | ||
k := kubectl.ApplyFiles(dc1Yaml) | ||
ns.ExecAndLog(step, k) | ||
|
||
ns.WaitForDatacenterReady(dc1Name) | ||
}) | ||
}) | ||
}) |