Closed jbpratt closed 2 years ago
@jbpratt I am unable to reproduce this using the following playbook:
- hosts: localhost
gather_facts: false
tasks:
- community.okd.k8s:
definition:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: standard
annotations:
storageclass.kubernetes.io/is-default-class: "true"
provisioner: kubernetes.io/cinder
- community.okd.k8s:
state: patched
definition:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: standard
annotations:
storageclass.kubernetes.io/is-default-class: "false"
TASK [community.okd.k8s] ********************************************************************************************************************
redirecting (type: action) community.okd.k8s to kubernetes.core.k8s_info
redirecting (type: action) community.okd.k8s to kubernetes.core.k8s_info
changed: [localhost] => {
"changed": true,
"method": "create",
"result": {
"apiVersion": "storage.k8s.io/v1",
"kind": "StorageClass",
"metadata": {
"annotations": {
"storageclass.kubernetes.io/is-default-class": "true"
},
"creationTimestamp": "2022-05-10T14:35:56Z",
"managedFields": [
{
"apiVersion": "storage.k8s.io/v1",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:metadata": {
"f:annotations": {
".": {},
"f:storageclass.kubernetes.io/is-default-class": {}
}
},
"f:provisioner": {},
"f:reclaimPolicy": {},
"f:volumeBindingMode": {}
},
"manager": "OpenAPI-Generator",
"operation": "Update",
"time": "2022-05-10T14:35:56Z"
}
],
"name": "standard",
"resourceVersion": "66545",
"uid": "e0094f26-59dc-48ee-9d64-e2abc2aa901f"
},
"provisioner": "kubernetes.io/cinder",
"reclaimPolicy": "Delete",
"volumeBindingMode": "Immediate"
}
}
TASK [community.okd.k8s] ********************************************************************************************************************
redirecting (type: action) community.okd.k8s to kubernetes.core.k8s_info
redirecting (type: action) community.okd.k8s to kubernetes.core.k8s_info
changed: [localhost] => {
"changed": true,
"method": "patch",
"result": {
"apiVersion": "storage.k8s.io/v1",
"kind": "StorageClass",
"metadata": {
"annotations": {
"storageclass.kubernetes.io/is-default-class": "false"
},
"creationTimestamp": "2022-05-10T14:35:56Z",
"managedFields": [
{
"apiVersion": "storage.k8s.io/v1",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:metadata": {
"f:annotations": {
".": {},
"f:storageclass.kubernetes.io/is-default-class": {}
}
},
"f:provisioner": {},
"f:reclaimPolicy": {},
"f:volumeBindingMode": {}
},
"manager": "OpenAPI-Generator",
"operation": "Update",
"time": "2022-05-10T14:35:56Z"
}
],
"name": "standard",
"resourceVersion": "66546",
"uid": "e0094f26-59dc-48ee-9d64-e2abc2aa901f"
},
"provisioner": "kubernetes.io/cinder",
"reclaimPolicy": "Delete",
"volumeBindingMode": "Immediate"
}
}
Openshift 4.10.9 community.okd 2.2.0 kubernetes.core 2.3.1
Hey @gravesm , thanks for taking a look. I'll try updating my community.okd version. I figured I'm just doing something wrong but it isn't obvious to me yet.
kubernetes.core 2.3.1
community.okd 2.1.0
OpenShift 4.10.13
Oh no, silly mistake on my part. annotations
just isn't indented far enough. Sorry for the noise :facepalm:
Ahhh, now I see it and wonder how I missed it. Glad it's sorted.
I'm trying to patch disable the default storage class as shown below, but when doing so the annotations are not applied. Perhaps I'm doing it wrong. Also not sure if this is an issue in the upstream k8s modules that we redirect to?
(
oc patch storageclass standard -p '{"metadata": {"annotations": {"storageclass.kubernetes.io/is-default-class": "false"}}}'
)