chore(questions): replace questions parts with templates (#3402)

* chore(questions): replace port parts with templates

* chore(questions): replace controller parts with templates

* remove tons of whitespce

* remove quotes from strings on templates

* make complete controller an include

* default to recreate

* remove replica and strategies as it's covered from controllerStrtegies include

* remove whitespace again

* replace controllertype with include (deployment/daemonset/statefulset)

* replace advanced port part except targetport

* remove more quotes

* add hidden toggle of enable the port

* new includes

* update build script

* controller deploy/stateful/deamon template changes

* replace controllerStrategies with replicas, replica#, strategy, recreate

* move 2 templates into a subfolder

* remove quotes

* remove disabled portals from questions and defined them on values

* remove enabled portal from the questions and add it on values

* one more app

* Portal cleanup

* remove portal templates

* add more includes

* replace portal links

* move some templates in folders

* replace ingressRoot with template

* more grouping

* replace persistenceroot with template

* replace serviceExpertRoot

* replace serviceroot

* fix a rogue one

* vctRoot

* securityContext cleanup

* remove quotes from templates on string

* replace vctRoot

* replace advanedSecurityRoot

* replace podsecurity root

* Update .github/scripts/build-catalog.sh

* Update values.yaml

* remove dupe portal

* update build-release script

* fix paths

* fix apps with imageSelector

Co-authored-by: Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl>
This commit is contained in:
Stavros Kois
2022-08-09 00:25:02 +03:00
committed by GitHub
parent f655142dc6
commit ac9cc7f736
1531 changed files with 13457 additions and 133255 deletions

View File

@@ -11,6 +11,11 @@ include_questions(){
local target="catalog/${train}/${chartname}/${chartversion}"
echo "Including standardised questions.yaml includes for: ${chartname}"
# Replace # Include{portalLink} with the standard portalLink codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{portalLink}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/portalLink.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{global} with the standard global codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{global}/ { for (i=0;i<n;++i) print a[i]; next }
@@ -26,90 +31,205 @@ include_questions(){
/# Include{fixedEnv}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/fixedEnv.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{controller} with the standard controller codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{controller}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/controller/controller.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{controllerDeployment} with the standard controllerDeployment codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{controllerDeployment}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/controller/controllerDeployment.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{controllerStatefullset} with the standard controllerStatefullset codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{controllerStatefullset}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/controller/controllerStatefullset.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{controllerDaemonset} with the standard controllerDaemonset codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{controllerDaemonset}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/controller/controllerDaemonset.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{replicas} with the standard replicas codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{replicas}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/replicas/replicas.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{replica1} with the standard replica1 codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{replica1}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/replicas/replica1.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{replica2} with the standard replica2 codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{replica2}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/replicas/replica2.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{replica3} with the standard replica3 codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{replica3}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/replicas/replica3.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{strategy} with the standard strategy codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{strategy}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/strategy/strategy.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{recreate} with the standard recreate codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{recreate}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/strategy/recreate.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{rollingupdate} with the standard rollingupdate codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{rollingupdate}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/strategy/rollingupdate.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{controllerTypes} with the standard controllerTypes codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{controllerTypes}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/controllerTypes.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{controllerExpert} with the standard controllerExpert codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{controllerExpert}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/controllerExpert.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
1' templates/questions/controller/controllerExpert.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{controllerExpertCommand} with the standard controllerExpertCommand codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{controllerExpertCommand}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/controllerExpertCommand.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
1' templates/questions/controller/controllerExpertCommand.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{containerConfig} with the standard containerConfig codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{containerConfig}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/containerConfig.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{serviceRoot} with the standard serviceRoot codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{serviceRoot}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/service/serviceRoot.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{serviceSelector} with the standard serviceSelector codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{serviceSelector}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/serviceSelector.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
1' templates/questions/service/serviceSelector.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{advancedPortHTTP} with the standard advancedPortHTTP codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{advancedPortHTTP}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/advancedPortHTTP.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{advancedPortHTTPS} with the standard advancedPortHTTPS codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{advancedPortHTTPS}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/advancedPortHTTPS.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{advancedPortTCP} with the standard advancedPortTCP codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{advancedPortTCP}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/advancedPortTCP.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{advancedPortUDP} with the standard advancedPortUDP codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{advancedPortUDP}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/advancedPortUDP.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{serviceExpertRoot} with the standard serviceExpertRoot codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{serviceExpertRoot}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/service/serviceExpertRoot.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{serviceExpert} with the standard serviceExpert codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{serviceExpert}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/serviceExpert.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
1' templates/questions/service/serviceExpert.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{serviceList} with the standard serviceList codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{serviceList}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/serviceList.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
1' templates/questions/service/serviceList.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{vctRoot} with the standard vctRoot codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{vctRoot}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/vctRoot.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{persistenceRoot} with the standard persistenceRoot codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{persistenceRoot}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/persistence/persistenceRoot.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{persistenceBasic} with the standard persistenceBasic codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{persistenceBasic}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/persistenceBasic.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
1' templates/questions/persistence/persistenceBasic.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{persistenceAdvanced} with the standard persistenceAdvanced codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{persistenceAdvanced}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/persistenceAdvanced.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
1' templates/questions/persistence/persistenceAdvanced.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{persistenceList} with the standard persistenceList codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{persistenceList}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/persistenceList.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
1' templates/questions/persistence/persistenceList.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{security} with the standard security codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{security}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/security.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{securityContextAdvancedRoot} with the standard securityContextAdvancedRoot codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{securityContextAdvancedRoot}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/securityContextAdvancedRoot.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{securityContextAdvanced} with the standard securityContextAdvanced codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{securityContextAdvanced}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/securityContextAdvanced.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{podSecurityContextRoot} with the standard podSecurityContextRoot codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{podSecurityContextRoot}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/podSecurityContextRoot.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{podSecurityContextAdvanced} with the standard podSecurityContextAdvanced codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{podSecurityContextAdvanced}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/podSecurityContextAdvanced.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{ingressRoot} with the standard ingressRoot codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{ingressRoot}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/ingress/ingressRoot.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{ingressDefault} with the standard ingressDefault codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{ingressDefault}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/ingressDefault.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
1' templates/questions/ingress/ingressDefault.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{ingressTLS} with the standard ingressTLS codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{ingressTLS}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/ingressTLS.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
1' templates/questions/ingress/ingressTLS.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{ingressTraefik} with the standard ingressTraefik codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{ingressTraefik}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/ingressTraefik.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
1' templates/questions/ingress/ingressTraefik.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{ingressExpert} with the standard ingressExpert codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{ingressExpert}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/ingressExpert.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
1' templates/questions/ingress/ingressExpert.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{ingressList} with the standard ingressList codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{ingressList}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/ingressList.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
1' templates/questions/ingress/ingressList.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{addons} with the standard addons codesnippet
awk 'NR==FNR { a[n++]=$0; next }
@@ -119,17 +239,17 @@ include_questions(){
# Replace # Include{metrics} with the standard metrics codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{metrics}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/metrics.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
1' templates/questions/metrics/metrics.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{metrics3m} with the standard metrics3m codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{metrics3m}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/metrics3m.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
1' templates/questions/metrics/metrics3m.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{metrics60m} with the standard metrics60m codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{metrics60m}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/metrics60m.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
1' templates/questions/metrics/metrics60m.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
# Replace # Include{prometheusRule} with the standard prometheusRule codesnippet
awk 'NR==FNR { a[n++]=$0; next }