Skip to content

refactor: extract bootstrap annotation key format string into a helper function #232

@Shreya2005-2005

Description

@Shreya2005-2005

Describe the issue

The annotation key format string for bootstrap completion tracking is
duplicated in two separate functions in
internal/controller/node_controller.go:

  • Line 327 in isBootstrapCompleted
  • Line 335 in markBootstrapCompleted

Both use:

fmt.Sprintf("readiness.k8s.io/bootstrap-completed-%s", ruleName)

If one is updated but not the other, it causes a silent bug where
bootstrap completion is never detected.

Expected behavior

Extract into a single helper function:

func bootstrapAnnotationKey(ruleName string) string {
    return fmt.Sprintf("readiness.k8s.io/bootstrap-completed-%s", ruleName)
}

File

internal/controller/node_controller.go lines 327, 335

Are you able to fix this issue?

Yes (I will propose a PR)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions