Skip to content

Add schema version label to RunningConfig #416

Description

@steiler

Currently, the RunningConfig resource does not have a mechanism to explicitly identify the schema version that the configuration belongs to. This makes it difficult to track, filter, or validate if a running configuration corresponds to a specific version of the schema.

Describe the solution you'd like
I would like to add a standard label to the RunningConfig metadata that specifies the schema version.

Proposed Label Key: config.sdcio.dev/schemaVersion

Recommendation: Why a Label?
A label is recommended over an annotation because it allows for efficient filtering and selection of resources via the API (e.g., kubectl get runningconfigs -l config.sdcio.dev/schemaVersion=v1.0.0). This is crucial for operations that need to target configurations of a specific version, such as migrations or validation checks. Schema versions typically conform to label value constraints (alphanumeric, -, _, .), making them suitable for labels.

Describe alternatives you've considered

  • Annotations: While annotations can hold arbitrary data, they cannot be used for filtering resources in API queries. This would make it harder to list all configs associated with a specific schema version.
  • Spec Field: Embedding the version in the Spec is possible, but this information is metadata about the resource rather than the configuration spec itself.

Additional context
Relevant file: apis/config/running_config_types.go

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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