@leverege/build-tools 2.59.0-beta.4 → 2.59.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +8 -5
- package/src/Docker.mjs +133 -14
- package/src/Utils.mjs +7 -1
- package/src/build-cnpg-image.mjs +167 -0
- package/src/circleate.sh +2 -2
- package/src/docker-to-registry.mjs +2 -4
- package/src/generate-docs-conf.json +41 -0
- package/src/generate-docs.mjs +51 -0
- package/src/helm-charts/cnpg-operator/helmup.plugin +7 -7
- package/src/helm-charts/elasticsearch8/helmup.plugin +1 -1
- package/src/helm-charts/prom-operator/helmup.plugin +1 -1
- package/src/helm-charts/redis/helmup.plugin +1 -1
- package/src/helm-charts/velero/helmup.plugin +1 -1
- package/src/helm-charts/velero/velero-local.yaml +4 -0
- package/src/helmup.sh +31 -4
- package/src/k8cryo.sh +0 -20
- package/src/tag-release.mjs +0 -692
- package/src/templates/bashrcTemplate.hbs +0 -46
- package/src/templates/cloudBuildSteps.hbs +0 -13
- package/src/templates/dockerfileTemplate.hbs +0 -86
- /package/src/{cnpg-backup.mjs → snapshot-cnpg.mjs} +0 -0
package/src/helmup.sh
CHANGED
|
@@ -578,8 +578,35 @@ function installCnpgOperatorEnvironment() {
|
|
|
578
578
|
CNPG_SVC_ACCT="$CNPG_NAMESPACE-sa"
|
|
579
579
|
CNPG_SVC_EMAIL="$CNPG_SVC_ACCT@$GCP_PROJECT_ID.iam.gserviceaccount.com"
|
|
580
580
|
|
|
581
|
-
|
|
582
|
-
|
|
581
|
+
# We used to delete the SA when we were doing clean installs but that bit
|
|
582
|
+
# me in the ass the time I moved the operator dir out of the way to run
|
|
583
|
+
# helmwhat to populate with latest operator version. The result? The SA
|
|
584
|
+
# was deleted and recreated and the existing system lost the ability to
|
|
585
|
+
# write to GCS which resulted in WAL failures. The deletion / recreation
|
|
586
|
+
# logic was only useful in the early days of creating / deleting for
|
|
587
|
+
# initial development.
|
|
588
|
+
#
|
|
589
|
+
# Synopsis: deleting an SA from an actual non-test system is BAD NEWS
|
|
590
|
+
# and if it happens then you will need to rebind the SA to
|
|
591
|
+
# workload identity by hand.
|
|
592
|
+
#
|
|
593
|
+
# kubectl delete serviceaccounts -n $CNPG_NAMESPACE $CNPG_SVC_ACCT &> $DEVNULL
|
|
594
|
+
# gcloud --quiet iam service-accounts delete $CNPG_SVC_EMAIL --project $GCP_PROJECT_ID&> $DEVNULL
|
|
595
|
+
kubectl describe serviceaccounts -n $CNPG_NAMESPACE $CNPG_SVC_ACCT &> $DEVNULL
|
|
596
|
+
if [ $? -eq 0 ];
|
|
597
|
+
then
|
|
598
|
+
cat<<SKIP_CNPG_SA_CREATION
|
|
599
|
+
|
|
600
|
+
$YELO_WARN The CNPG SA $CNPG_SVC_ACCT already exists
|
|
601
|
+
|
|
602
|
+
Deleting the SA for the purposes of upgrading the operator is going to
|
|
603
|
+
wreck someone's day (probably yours) if the desire is to simply upgrade
|
|
604
|
+
in place. To force a clean reinstall, delete both the k8s and gcp SA for
|
|
605
|
+
CNPG and try again. (see comments in helmup for more info)
|
|
606
|
+
|
|
607
|
+
SKIP_CNPG_SA_CREATION
|
|
608
|
+
return
|
|
609
|
+
fi
|
|
583
610
|
|
|
584
611
|
# Create the operands namespace and annotate to allow redis access
|
|
585
612
|
createNamespaceIfNeeded $CNPG_NAMESPACE
|
|
@@ -699,10 +726,10 @@ function installVeleroEnvironment() {
|
|
|
699
726
|
gcloud config set project $GCP_PROJECT_ID
|
|
700
727
|
|
|
701
728
|
## The major chart version will determine the bucket suffix
|
|
702
|
-
[ -z "$
|
|
729
|
+
[ -z "$VELERO_CHART_VERSION" ] && VELERO_CHART_VERSION="8"
|
|
703
730
|
|
|
704
731
|
## Create a bucket
|
|
705
|
-
BUCKET="$GCP_PROJECT_ID-velero-$
|
|
732
|
+
BUCKET="$GCP_PROJECT_ID-velero-$VELERO_CHART_VERSION"
|
|
706
733
|
printf "\nCreating storage bucket `color g $BUCKET` in `color g $GCE_REGION`\n"
|
|
707
734
|
gsutil mb -l $GCE_REGION gs://$BUCKET/ &> $DEVNULL
|
|
708
735
|
warnOnError $? "Bucket failed to create or already exists - go check it\n"
|
package/src/k8cryo.sh
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
#
|
|
3
|
-
. `build-tools --bashfun`
|
|
4
|
-
|
|
5
|
-
daysToKeep=${1:-60}
|
|
6
|
-
let hoursToKeep="$daysToKeep*24"
|
|
7
|
-
printf "\ncryo backup set to keep for $daysToKeep days / $hoursToKeep hours\n"
|
|
8
|
-
|
|
9
|
-
if [ "`basename $0`" == "k8thaw" ];
|
|
10
|
-
then
|
|
11
|
-
errorExit "k8thaw - UNDER CONSTRUCTION"
|
|
12
|
-
fi
|
|
13
|
-
|
|
14
|
-
# Gets the UTC time in the same format that velero schedules use for
|
|
15
|
-
# generating the Date Time Stamp for scheduled backups.
|
|
16
|
-
DTS="`date -u +\"%Y%m%d%H%M%S\"`"
|
|
17
|
-
|
|
18
|
-
printf "\nExecuting = > velero backup create velero-cryo-$DTS --ttl ${hoursToKeep}h\n"
|
|
19
|
-
|
|
20
|
-
velero backup create velero-cryo-$DTS --ttl ${hoursToKeep}h
|