You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When the name of a new KadaluStorage starts with the name of an existing KadaluStorage, the following exception is thrown in operator and operator is restarted.
[2024-04-09 13:32:22,578] INFO [main - 526:handle_external_storage_addition] - Updated configmap name=kadalu-info volname=gfstest
[2024-04-09 13:32:23,247] INFO [main - 531:handle_external_storage_addition] - Deployed External StorageClass volname=gfstest manifest=/kadalu/templates/external-storageclass.yaml
[2024-04-09 13:32:34,973] INFO [main - 526:handle_external_storage_addition] - Updated configmap name=kadalu-info volname=gfstest-2
Traceback (most recent call last):
File "/kadalu/main.py", line 1080, in <module>
main()
File "/kadalu/main.py", line 1069, in main
crd_watch(core_v1_client, k8s_client)
File "/kadalu/main.py", line 911, in crd_watch
watch_stream(core_v1_client, k8s_client)
File "/kadalu/main.py", line 898, in watch_stream
handle_added(core_v1_client, obj)
File "/kadalu/main.py", line 582, in handle_added
handle_external_storage_addition(core_v1_client, obj)
File "/kadalu/main.py", line 530, in handle_external_storage_addition
lib_execute(KUBECTL_CMD, APPLY_CMD, "-f", filename)
File "/kadalu/kadalulib.py", line 184, in execute
raise CommandException(proc.returncode, out.strip(), err.strip())
kadalulib.CommandException: [1] Error from server (Forbidden): error when applying patch:
{"metadata":{"annotations":{"kubectl.kubernetes.io/last-applied-configuration":"{\"allowVolumeExpansion\":false,\"apiVersion\":\"storage.k8s.io/v1\",\"kind\":\"StorageClass\",\"metadata\":{\"annotations\":{},\"name\":\"kadalu.gfstest-2\"},\"parameters\":{\"gluster_hosts\":\"gfs-1.example.de,gfs-2.example.de,gfs-3.example.de\",\"gluster_options\":\"log-level=INFO\",\"gluster_volname\":\"gfstest-2\",\"hostvol_type\":\"External\",\"single_pv_per_pool\":\"True\"},\"provisioner\":\"kadalu\"}\n"}},"parameters":{"gluster_volname":"gfstest-2"}}
to:
Resource: "storage.k8s.io/v1, Resource=storageclasses", GroupVersionKind: "storage.k8s.io/v1, Kind=StorageClass"
Name: "kadalu.gfstest-2", Namespace: ""
for: "/kadalu/templates/external-storageclass.yaml": error when patching "/kadalu/templates/external-storageclass.yaml": storageclasses.storage.k8s.io "kadalu.gfstest-2" is forbidden: User "system:serviceaccount:kadalu:kadalu-operator" cannot patch resource "storageclasses" in API group "storage.k8s.io" at the cluster scope
[2024-04-09 13:32:36,515] INFO [kadalulib - 432:monitor_proc] - Restarted Process name=operator
However, the configmap has correctly been updated (includes entries for both gfstest and gfstest-2).
As long as the KadaluStorage gfstest-2 exists, operator will be stuck in a endless restart loop.
To Reproduce
Steps to reproduce the behavior:
Create a KadaluStorage with any name (e.g. test)
Create a second KadaluStorage with a name starting with the name of previous KadaluStorage (e.g. test-1)
Environment:
Kadalu Version: [1.2.0]
K8S_DIST: [kubernetes]
external gluster with single_pv_per_pool=true
The text was updated successfully, but these errors were encountered:
Oh, it seems this was my mistake. There was a leftover StorageClass named gfstest-2 from previous tests. After deleting this the problem disappeared. But maybe it could beneficial, to add "patch" to rbac?
there is a bug as well, since kds is namespaced and simply creating a storageclass which is clusterscope w/ same name as kds the operator will hit an error. I'm not sure whether that needs any urgent fix.
The other one, patching storageclass, it shouldn't result in a patch in the first place as params of storageclass are immutable and even if we provide the patch verb the resulting operation would fail if the params are changed and if params aren't changed I think that'll be a no-op.
Describe the bug
When the name of a new KadaluStorage starts with the name of an existing KadaluStorage, the following exception is thrown in operator and operator is restarted.
However, the configmap has correctly been updated (includes entries for both gfstest and gfstest-2).
As long as the KadaluStorage gfstest-2 exists, operator will be stuck in a endless restart loop.
To Reproduce
Steps to reproduce the behavior:
test
)test-1
)Environment:
The text was updated successfully, but these errors were encountered: