Skip to content

Commit

Permalink
fix: track harbor generated secrets by flux (#3051)
Browse files Browse the repository at this point in the history
* fix: track harbor generated secrets by flux

* chore: PR feedback

Co-authored-by: Jimmi Dyson <[email protected]>

---------

Co-authored-by: Jimmi Dyson <[email protected]>
  • Loading branch information
mhrabovcin and jimmidyson authored Jan 23, 2025
1 parent 57c85b2 commit 18c2b91
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
3 changes: 2 additions & 1 deletion services/harbor/1.16.0/pre-install/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- pre-install-jobs.yaml
- secrets.yaml
- pre-install-jobs.yaml
14 changes: 10 additions & 4 deletions services/harbor/1.16.0/pre-install/pre-install-jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,11 @@ spec:
SECRET_NAME="harbor-admin-password"
if kubectl get secret -n ncr-system "$SECRET_NAME" ; then
echo "$SECRET_NAME secret exists"
exit 0
EXISTING_PASSWORD="$(kubectl get secret -n ncr-system $SECRET_NAME -o jsonpath='{.data.HARBOR_ADMIN_PASSWORD}')"
if [ ! -z "$EXISTING_PASSWORD" ]; then
echo "$SECRET_NAME secret with password exists"
exit 0
fi
fi
kubectl create secret generic -n ncr-system "$SECRET_NAME" -oyaml --dry-run=client \
Expand All @@ -109,8 +112,11 @@ spec:
SECRET_NAME="harbor-valkey-password"
if kubectl get secret -n ncr-system "$SECRET_NAME" ; then
echo "$SECRET_NAME secret exists"
exit 0
EXISTING_PASSWORD="$(kubectl get secret -n ncr-system $SECRET_NAME -o jsonpath='{.data.REDIS_PASSWORD}')"
if [ ! -z "$EXISTING_PASSWORD" ]; then
echo "$SECRET_NAME secret with password exists"
exit 0
fi
fi
kubectl create secret generic -n ncr-system "$SECRET_NAME" -oyaml --dry-run=client \
Expand Down
14 changes: 14 additions & 0 deletions services/harbor/1.16.0/pre-install/secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
apiVersion: v1
kind: Secret
metadata:
name: harbor-admin-password
namespace: ncr-system
type: Opaque
---
apiVersion: v1
kind: Secret
metadata:
name: harbor-valkey-password
namespace: ncr-system
type: Opaque

0 comments on commit 18c2b91

Please sign in to comment.