Skip to content

Feat: Add CEL expression display on the repository badge in Registry detail page for copy shortcut #372

@xingzhang-suse

Description

@xingzhang-suse

UX design

Image Image

Workflow

  • the filter icon will be displayed on the repos having a CEL
  • the CEL code will actually be displayed as a suffix on the repo name, matching the same colour an styling as the YAML syntax highlight that’s going to be displayed on click, in the popover.

Data source

// Repository specifies an OCI repository and which image tags to scan.
type Repository struct {
	// Name is the repository name.
	Name string `json:"name"`
	// MatchConditions filters image tags using CEL expressions.
	// At most 10 MatchConditions are allowed per repository.
	// +kubebuilder:validation:MaxItems=10
	MatchConditions []MatchCondition `json:"matchConditions,omitempty"`
}

// MatchCondition defines a CEL expression to filter image tags.
type MatchCondition struct {
	// Name is an identifier for this match condition, used for strategic merging of MatchConditions,
	// as well as providing an identifier for logging purposes. A good name should be descriptive of
	// the associated expression.
	Name string `json:"name"`
	// Expression represents the expression which will be evaluated by CEL. Must evaluate to bool.
	// Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
	Expression string `json:"expression"`
}

Referable UI instance in Rancher UI

Image

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions