Closed aii-nozomu-oki closed 1 year ago
yes, I think we should avoid this error, and I think the problem is here https://github.com/open-cluster-management-io/registration/blob/v0.10.0/pkg/spoke/managedcluster/creating_controller.go#L57
now we only skip the unauthorized error when the user is an anonymous
Thanks, I have confirmed that removing the anonymous check will stop the log from being output. And I have created a pull request.
I followed the Installation page and installed OCM on two K3s with clusteradm.
Approximately one hour after installation(This is probably because the sync interval is 1 hour. https://github.com/open-cluster-management-io/registration/blob/v0.10.0/pkg/spoke/managedcluster/creating_controller.go#L25 ), klusterlet-registration-agent repeatedly outputs the following error:
K3s outputs the following error:
According to my investigation, the error is originating from the following line. https://github.com/open-cluster-management-io/registration/blob/v0.10.0/pkg/spoke/managedcluster/creating_controller.go#L56
My understanding is that ManagedClusterCreatingController uses cluster-bootstrap token and the token expires in 1 hour( https://github.com/open-cluster-management-io/clusteradm/blob/v0.5.0/pkg/helpers/client.go#L210 ). So the error output itself is a natural behavior. However, I think the log output "Unauthorized" should be avoided because it gives the system administrator the impression that something is wrong with the system. Any thoughts?
K3s version: v1.26.1+k3s1 clusteradm version: v0.5.0 default bundle version: 0.10.0