-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix up comments and errors around CRD issues #499
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
much more helpful error message.
8535cd7
to
c2cf0ec
Compare
lib/backend/k8s/k8s.go
Outdated
// as a backend but can often fail when using KDD as it relies | ||
// on various custom resources existing. | ||
// To ensure the datastore is initialized, this function checks that a | ||
// known custom resource is defined: FelixGlobalConfigSetting. It accomplishes this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean GlobalFelixConfig
here?
lib/backend/k8s/k8s.go
Outdated
// on various custom resources existing. | ||
// To ensure the datastore is initialized, this function checks that a | ||
// known custom resource is defined: FelixGlobalConfigSetting. It accomplishes this | ||
// by trying to set the ClusterType (an example of FelixGlobalConfigSetting). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure I understand what you mean by an example of FelixGlobalConfigSetting
. ClusterType
is an instance of GlobalFelixConfig
CRD
lib/backend/k8s/k8s.go
Outdated
err := c.waitForClusterType() | ||
if err != nil { | ||
return fmt.Errorf("Failed to ensure ClusterType is set: %s", err) | ||
return fmt.Errorf("Failed to ensure datastore has been initialized: \"%s\". Have you created custom resources and is calico authorized to access them?", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit odd to see a ?
in an error message. How about something like: `return fmt.Errorf("Failed to ensure datastore has been initialized: "%s". Make sure the Custom Resource Definitions are created and Calico is authorized to access them", err)
c2cf0ec
to
70f6894
Compare
70f6894
to
99611e7
Compare
JGOC |
Provide better comments and error messages around the code that checks the datastore is initialized. This error should help alleviate a possibly common scenario where users launch Calico in KDD mode without first creating the custom resources. In that scenario, we were seeing the following error in calico/node:
We should now see a more appropriate error:
ERROR: Unable to set node resource configuration: Failed to ensure the datastore has been initialized: "timed out waiting for the condition". Make sure the Custom Resource Definitions have been created and Calico has been authorized to access them.