-
Notifications
You must be signed in to change notification settings - Fork 75
feat: Add bootstrap NRC duration metric #294
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,17 +25,21 @@ import ( | |
| readinessv1alpha1 "sigs.k8s.io/node-readiness-controller/api/v1alpha1" | ||
| ) | ||
|
|
||
| //nolint:godot | ||
| const ( | ||
| // bootstrapAnnotationPrefix is the common prefix for all bootstrap completion | ||
| // annotations on a Node. The suffix is the rule's metadata.uid (RFC 4122 UUID, | ||
| // ~36 chars), which is immutable for the object's lifetime and globally unique. | ||
| // | ||
| // Full key format: readiness.k8s.io/bootstrap-completed-<ruleUID> | ||
| // Value format: {"rule-name":"<ruleName>"} (for human readability) | ||
| // Value format: {"rule-name":"<ruleName>"} (for human readability). | ||
| bootstrapAnnotationPrefix = "readiness.k8s.io/bootstrap-completed-" | ||
| ) | ||
|
|
||
| // bootstrapAnnotationPayload is the JSON value stored in a bootstrap-completion annotation. | ||
| type bootstrapAnnotationPayload struct { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO, TaintAppliedAt and Completed are better suited for the dedicated NodeEvaluation 'status' api we planned. Can we discuss this during our next sync on how we could shape it in the alpha2 api? |
||
| RuleName string `json:"rule-name"` | ||
| } | ||
|
|
||
| // bootstrapAnnotationKey returns the annotation key for a rule's bootstrap | ||
| // completion state, using the rule's UID as the suffix. | ||
| func bootstrapAnnotationKey(uid types.UID) string { | ||
|
|
@@ -45,9 +49,7 @@ func bootstrapAnnotationKey(uid types.UID) string { | |
| // bootstrapAnnotationValue returns the JSON-encoded value to store in the | ||
| // bootstrap annotation. It includes the rule name for human readability. | ||
| func bootstrapAnnotationValue(ruleName string) string { | ||
| v := struct { | ||
| RuleName string `json:"rule-name"` | ||
| }{RuleName: ruleName} | ||
| v := bootstrapAnnotationPayload{RuleName: ruleName} | ||
| b, err := json.Marshal(v) | ||
| if err != nil { | ||
| return `{"rule-name":""}` // should never happen | ||
|
|
||
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.
cc @Karthik-K-N for note as we should keep this field name and semantics same when we split NodeEvaluation status