Skip to content

Instantly share code, notes, and snippets.

@sastorsl
Last active September 7, 2023 08:47
Show Gist options
  • Save sastorsl/23c35db6bcc263bc7b092e7823ab6d5e to your computer and use it in GitHub Desktop.
Save sastorsl/23c35db6bcc263bc7b092e7823ab6d5e to your computer and use it in GitHub Desktop.
OpenShift 4.12 removed APIs list
#!/bin/bash
# https://www.gnu.org/software/bash/manual/html_node/Arrays.html
# Preparing to upgrade to OpenShift Container Platform 4.12
# https://access.redhat.com/articles/6955381
declare -A removedapis=(
[CronJob]=batch/v1beta1
[EndpointSlice]=discovery.k8s.io/v1beta1
[Event]=events.k8s.io/v1beta1
[HorizontalPodAutoscaler]=autoscaling/v2beta1
[PodDisruptionBudget]=policy/v1beta1
[PodSecurityPolicy]=policy/v1beta1
[RuntimeClass]=node.k8s.io/v1beta1
)
for RESOURCE in ${!removedapis[@]}
do
echo "=== ${RESOURCE} - ${removedapis[${RESOURCE}]} ==="
oc get ${RESOURCE} -A -o=custom-columns=NAMESPACE:.metadata.namespace,NAME:.metadata.name,Resource:.kind,API-version:.apiVersion | grep ${removedapis[${RESOURCE}]}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment