Skip to content

Commit

Permalink
use the first group of the cluster UUID as the cluster name
Browse files Browse the repository at this point in the history
  • Loading branch information
zugwan committed Jun 29, 2022
1 parent 14eb114 commit 9b8b3e7
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/render-cd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,21 @@ do

# Post processes for the customized action
# Action1. change the namespace for cluster-resouces from argo to cluster-name
site_prefix=${site%%-*}
echo "Almost finished: changing namespace for cluster-resouces from argo to cluster-name.."
sudo sed -i "s/ namespace: argo/ namespace: $site/g" $(pwd)/$outputdir/$site/tks-cluster-aws/cluster-api-aws/*
sudo sed -i "s/ - argo/ - $site/g" $(pwd)/$outputdir/$site/tks-cluster-aws/cluster-api-aws/*
sudo sed -i "s/ namespace: argo/ namespace: $site/g" $(pwd)/$outputdir/$site/tks-cluster-byoh/cluster-api-byoh/*
sudo sed -i "s/ - argo/ - $site/g" $(pwd)/$outputdir/$site/tks-cluster-byoh/cluster-api-byoh/*
sudo sed -i "s/ namespace: argo/ namespace: $site_prefix/g" $(pwd)/$outputdir/$site/tks-cluster-aws/cluster-api-aws/*
sudo sed -i "s/ - argo/ - $site_prefix/g" $(pwd)/$outputdir/$site/tks-cluster-aws/cluster-api-aws/*
sudo sed -i "s/ namespace: argo/ namespace: $site_prefix/g" $(pwd)/$outputdir/$site/tks-cluster-byoh/cluster-api-byoh/*
sudo sed -i "s/ - argo/ - $site_prefix/g" $(pwd)/$outputdir/$site/tks-cluster-byoh/cluster-api-byoh/*
# It's possible besides of two above but very tricky!!
# sudo sed -i "s/ argo$/ $site/g" $(pwd)/$outputdir/$site/tks-cluster-aws/cluster-api-aws/*
# sudo sed -i "s/ argo$/ $site_prefix/g" $(pwd)/$outputdir/$site/tks-cluster-aws/cluster-api-aws/*
echo "---
apiVersion: v1
kind: Namespace
metadata:
name: $site
name: $site_prefix
labels:
name: $site
name: $site_prefix
# It bring the secret 'dacapod-argocd-config' using kubed
decapod-argocd-config: enabled
" > Namespace_aws_rc.yaml
Expand Down

0 comments on commit 9b8b3e7

Please sign in to comment.