Skip to content

Instantly share code, notes, and snippets.

@sastorsl
Last active September 7, 2023 08:47
Show Gist options
  • Select an option

  • Save sastorsl/23c35db6bcc263bc7b092e7823ab6d5e to your computer and use it in GitHub Desktop.

Select an option

Save sastorsl/23c35db6bcc263bc7b092e7823ab6d5e to your computer and use it in GitHub Desktop.

Revisions

  1. sastorsl revised this gist Sep 7, 2023. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions openshift-4.12-removed-apis.bash
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,3 @@
    ```bash
    #!/bin/bash
    # https://www.gnu.org/software/bash/manual/html_node/Arrays.html
    # Preparing to upgrade to OpenShift Container Platform 4.12
    @@ -16,5 +15,5 @@ declare -A removedapis=(
    for RESOURCE in ${!removedapis[@]}
    do
    echo "=== ${RESOURCE} - ${removedapis[${RESOURCE}]} ==="
    oc get ${RESOURCE} -A -o yaml | grep ${removedapis[${RESOURCE}]}
    oc get ${RESOURCE} -A -o=custom-columns=NAMESPACE:.metadata.namespace,NAME:.metadata.name,Resource:.kind,API-version:.apiVersion | grep ${removedapis[${RESOURCE}]}
    done
  2. sastorsl revised this gist Sep 7, 2023. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions openshift-4.12-removed-apis.bash
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,8 @@
    ```bash
    #!/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
  3. sastorsl renamed this gist Sep 7, 2023. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions gistfile1.txt → openshift-4.12-removed-apis.bash
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    ```bash
    #!/bin/bash
    #
    # https://www.gnu.org/software/bash/manual/html_node/Arrays.html
    declare -A removedapis=(
    [CronJob]=batch/v1beta1
    @@ -15,5 +15,4 @@ for RESOURCE in ${!removedapis[@]}
    do
    echo "=== ${RESOURCE} - ${removedapis[${RESOURCE}]} ==="
    oc get ${RESOURCE} -A -o yaml | grep ${removedapis[${RESOURCE}]}
    done
    ```
    done
  4. sastorsl created this gist Sep 7, 2023.
    19 changes: 19 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    ```bash
    #!/bin/bash
    #

    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 yaml | grep ${removedapis[${RESOURCE}]}
    done
    ```