Skip to content

Commit

Permalink
Merge pull request #204 from turkenh/migration-improvements
Browse files Browse the repository at this point in the history
Fixes and improvements in smaller provider migration docs
  • Loading branch information
turkenh authored May 17, 2023
2 parents 9deb6c3 + 1605347 commit 13368e2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
20 changes: 10 additions & 10 deletions docs/sp-migration-conf.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
```bash
kubectl get managed -o yaml > backup-mrs.yaml
kubectl get composite -o yaml > backup-composites.yaml
kubectl get claim -n $NAMESPACE -o yaml > backup-claims.yaml
kubectl get claim --all-namespaces -o yaml > backup-claims.yaml
```

2. Update deletion policy to `Orphan`:
Expand All @@ -30,7 +30,7 @@ kubectl get managed --no-headers -o jsonpath='{range .items[*]}{.apiVersion}{"\n
do
service=$(echo "${line}" | cut -d. -f1)
provider=$(echo "${line}" | cut -d. -f2)
if [[ ${provider} == "upbound" ]]; then
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"
Expand All @@ -41,12 +41,12 @@ 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 [ "${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
Expand All @@ -61,7 +61,7 @@ spec:
done
```

4. Install config providers with `revisionActivationPolicy: Manual`:
4. Install family providers with `revisionActivationPolicy: Manual`:

Verify that `sp-family-manual.yaml` files are generated with the correct content

Expand Down Expand Up @@ -89,7 +89,7 @@ Verify that `sp-manual.yaml` files are generated with the correct content
cat sp-manual.yaml
```

Install the family provider
Install the smallers providers

```bash
kubectl apply -f sp-manual.yaml
Expand Down
32 changes: 16 additions & 16 deletions docs/sp-migration-mr.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ kubectl get managed --no-headers -o jsonpath='{range .items[*]}{.apiVersion}{"\n
do
service=$(echo "${line}" | cut -d. -f1)
provider=$(echo "${line}" | cut -d. -f2)
if [[ ${provider} == "upbound" ]]; then
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"
Expand All @@ -38,12 +38,12 @@ 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 [ "${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
Expand All @@ -58,22 +58,22 @@ spec:
done
```

4. Install config providers with `revisionActivationPolicy: Manual`:
4. Install family providers with `revisionActivationPolicy: Manual`:


Verify that `sp-config-manual.yaml` files are generated with the correct content
Verify that `sp-family-manual.yaml` files are generated with the correct content

```bash
cat sp-config-manual.yaml
cat sp-family-manual.yaml
```

Install the config provider(s)
Install the family provider(s)

```bash
kubectl apply -f sp-config-manual.yaml
kubectl apply -f sp-family-manual.yaml
```

Make sure the config provider(s) are in `Installed: False` and `Healthy: True` state:
Make sure the family provider(s) are in `Installed: False` and `Healthy: True` state:

```bash
kubectl get providers.pkg
Expand All @@ -88,7 +88,7 @@ Verify that `sp-manual.yaml` files are generated with the correct content
cat sp-manual.yaml
```

Install the config provider
Install the smallers providers

```bash
kubectl apply -f sp-manual.yaml
Expand All @@ -109,9 +109,9 @@ kubectl delete provider.pkg $PROVIDER_NAME
7. Update smaller providers with `revisionActivationPolicy:Automatic`:

```bash
sed 's/revisionActivationPolicy: Manual/revisionActivationPolicy: Automatic/' sp-config-manual.yaml > sp-config-automatic.yaml
sed 's/revisionActivationPolicy: Manual/revisionActivationPolicy: Automatic/' sp-family-manual.yaml > sp-family-automatic.yaml

kubectl apply -f sp-config-automatic.yaml
kubectl apply -f sp-family-automatic.yaml
```


Expand Down

0 comments on commit 13368e2

Please sign in to comment.