Skip to content

Commit 9d3c170

Browse files
Pothulapatiroboquat
authored andcommitted
upload custom CA into terraform state
Signed-off-by: Tarun Pothulapati <[email protected]>
1 parent 4ff2e8c commit 9d3c170

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

.werft/eks-installer-tests.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ pod:
8989
value: "/mnt/secrets/sh-playground-sa-perm/sh-sa.json"
9090
- name: TF_VAR_dns_sa_creds
9191
value: "/mnt/secrets/sh-playground-dns-perm/sh-dns-sa.json"
92+
- name: TF_VAR_sa_creds
93+
value: "/mnt/secrets/sh-playground-sa-perm/sh-sa.json"
9294
- name: NODENAME
9395
valueFrom:
9496
fieldRef:

.werft/installer-tests.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,12 @@ export async function installerTests(config: TestConfig) {
347347
console.error("Failed to send message to Slack", error);
348348
});
349349

350+
if (selfSigned === "true") {
351+
exec(
352+
`werft log result -d "Custom CA Certificate store underd GCP project 'sh-automated-tests'" url "gs://nightly-tests/tf-state/${process.env["TF_VAR_TEST_ID"]}-ca.pem"`,
353+
);
354+
}
355+
350356
exec(
351357
`werft log result -d "Terraform state" url "Terraform state file name is ${process.env["TF_VAR_TEST_ID"]}"`,
352358
);
@@ -384,10 +390,7 @@ function runIntegrationTests() {
384390
function callMakeTargets(phase: string, description: string, makeTarget: string, failable: boolean = false) {
385391
werft.log(phase, `Calling ${makeTarget}`);
386392
// exporting cloud env var is important for the make targets
387-
var env = `export TF_VAR_cluster_version=${k8s_version} cloud=${cloud} TF_VAR_domain=${baseDomain} TF_VAR_gcp_zone=${gcpDnsZone}`;
388-
if (selfSigned) {
389-
env = env.concat(` self_signed=${selfSigned}`)
390-
}
393+
const env = `export TF_VAR_cluster_version=${k8s_version} cloud=${cloud} TF_VAR_domain=${baseDomain} TF_VAR_gcp_zone=${gcpDnsZone}`;
391394

392395
const response = exec(
393396
`${env} && make -C ${makefilePath} ${makeTarget}`,

install/tests/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,9 @@ self-signed-config:
314314
envsubst < ./manifests/kots-config-self-signed.yaml > tmp_2_config.yml
315315
yq m -i tmp_config.yml tmp_2_config.yml
316316

317+
# upload the Custom CA Cert into tf-state
318+
gsutil cp ./ca.pem gs://nightly-tests/tf-state/${TF_VAR_TEST_ID}-ca.pem
319+
317320
storage-config-incluster:
318321
@echo "Nothing to do"
319322

@@ -449,6 +452,9 @@ destroy-kubeconfig:
449452
gcloud auth activate-service-account --key-file=${GOOGLE_APPLICATION_CREDENTIALS} --project=sh-automated-tests
450453
gsutil rm gs://nightly-tests/tf-state/${TF_VAR_TEST_ID}-kubeconfig || echo "No kubeconfig"
451454
gsutil rm gs://nightly-tests/tf-state/${TF_VAR_TEST_ID}-creds || echo "No credentials file"
455+
ifeq (true,$(self_signed))
456+
gsutil rm gs://nightly-tests/tf-state/${TF_VAR_TEST_ID}-ca.pem || echo "No custom CA cert file"
457+
endif
452458
rm ${KUBECONFIG} || echo "No kubeconfig"
453459

454460
select-workspace:

0 commit comments

Comments
 (0)