-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #205 from ezgidemirel/move-to-scripts
Move inline bash code to separate files to prevent copy/paste errors
- Loading branch information
Showing
5 changed files
with
63 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
function getsmallerproviders(){ | ||
provider="${1}" | ||
version="${2}" | ||
smaller=$(grep -irn ${provider}.upbound.io/v1beta1 ${CONF_PATH} | awk '{print $3}'| cut -d '.' -f 1 | sort | uniq) | ||
|
||
for s in ${smaller[@]}; do if [ $s != "azure" ]; then echo "- provider: xpkg.upbound.io/upbound-release-candidates/provider-$provider-$s";echo " version: \"$version\""; fi; done | ||
} | ||
|
||
providers=( "aws:v0.36.0" "gcp:v0.33.0" "azure:v0.34.0" ) | ||
|
||
for pp in ${providers[@]}; do getsmallerproviders "${pp%%:*}" "${pp##*:}"; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
version_aws=v0.37.0 | ||
version_azure=v0.34.0 | ||
version_gcp=v0.34.0 | ||
|
||
rm -f "sp-manual.yaml" && touch "sp-manual.yaml" | ||
rm -f "sp-family-manual.yaml" && touch "sp-family-manual.yaml" | ||
kubectl get managed --no-headers -o jsonpath='{range .items[*]}{.apiVersion}{"\n"}{end}' | grep -E '(aws|gcp|azure).upbound.io' | sort | uniq | while read -r line | ||
do | ||
service=$(echo "${line}" | cut -d. -f1) | ||
provider=$(echo "${line}" | cut -d. -f2) | ||
if [ "${provider}" = "upbound" ]; then | ||
# azure.upbound.io is an exception where apiVersion does not contain the service name | ||
# we have those resources in the family package | ||
provider="azure" | ||
fi | ||
eval version=\$"version_${provider}" | ||
|
||
for sp in config ${service}; do | ||
filename="sp-manual.yaml" | ||
providername="${provider}-${sp}" | ||
|
||
if [ "${sp}" = "config" ] || [ "${sp}" = "azure" ]; then | ||
# azure.upbound.io is an exception where apiVersion does not contain the service name | ||
# we have those resources in the family package | ||
providername="family-$provider" | ||
filename="sp-family-manual.yaml" | ||
fi | ||
if ! cat "${filename}" | grep provider-${providername}:${version} > /dev/null; then | ||
echo "apiVersion: pkg.crossplane.io/v1 | ||
kind: Provider | ||
metadata: | ||
name: upbound-release-candidates-provider-${providername} | ||
spec: | ||
package: xpkg.upbound.io/upbound-release-candidates/provider-${providername}:${version} | ||
revisionActivationPolicy: Manual" >> "${filename}" | ||
echo "---" >> "${filename}" | ||
fi | ||
done | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.