@@ -49,13 +49,18 @@ spec:
49
49
echo "Checking for MachineConfigNodes CRD with v1alpha1 version..."
50
50
51
51
# Check if CRD exists
52
- if ! oc get crd "$CRD_NAME" >/dev/null 2>&1; then
53
- echo "CRD $CRD_NAME does not exist, nothing to clean up"
52
+ if ! CRD_CHECK_OUTPUT=$(oc get crd "$CRD_NAME" 2>&1); then
53
+ echo "Error checking for CRD $CRD_NAME: $CRD_CHECK_OUTPUT"
54
+ echo "Assuming CRD does not exist, nothing to clean up"
54
55
exit 0
55
56
fi
56
-
57
+
57
58
# Check if CRD has v1alpha1 version
58
- HAS_V1ALPHA1=$(oc get crd "$CRD_NAME" -o jsonpath='{.spec.versions[?(@.name=="v1alpha1")].name}' 2>/dev/null || echo "")
59
+ if ! HAS_V1ALPHA1=$(oc get crd "$CRD_NAME" -o jsonpath='{.spec.versions[?(@.name=="v1alpha1")].name}' 2>&1); then
60
+ echo "Error checking CRD versions for $CRD_NAME: $HAS_V1ALPHA1"
61
+ echo "v1 version likely exists, skipping cleanup"
62
+ exit 0
63
+ fi
59
64
60
65
if [ -z "$HAS_V1ALPHA1" ]; then
61
66
echo "CRD $CRD_NAME does not have v1alpha1 version, nothing to clean up"
@@ -65,10 +70,11 @@ spec:
65
70
echo "Found CRD $CRD_NAME with v1alpha1 version, deleting it..."
66
71
67
72
# Delete the CRD
68
- if oc delete crd "$CRD_NAME"; then
73
+ if DELETE_OUTPUT=$( oc delete crd "$CRD_NAME" 2>&1) ; then
69
74
echo "Successfully deleted CRD $CRD_NAME"
70
75
else
71
76
echo "Failed to delete CRD $CRD_NAME"
77
+ echo "Delete error output: $DELETE_OUTPUT"
72
78
exit 1
73
79
fi
74
80
88
94
seccompProfile :
89
95
type : RuntimeDefault
90
96
nodeSelector :
91
- node-role.kubernetes.io/control-plane : " "
97
+ node-role.kubernetes.io/master : " "
92
98
priorityClassName : " system-cluster-critical"
93
99
tolerations :
94
100
- effect : NoSchedule
0 commit comments