Skip to content

Commit

Permalink
Merge pull request #478 from joejstuart/EC-1100
Browse files Browse the repository at this point in the history
Per imageUrl/component exceptions
  • Loading branch information
joejstuart authored Feb 24, 2025
2 parents 1cff291 + e409aaf commit be8b799
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ spec:
description: ImageRef is used to specify an image by its digest.
pattern: ^sha256:[a-fA-F0-9]{64}$
type: string
imageUrl:
description: ImageUrl is used to specify an image by its URL with or without a tag.
pattern: ^(?:https:\/\/)?[a-z0-9.-]+\/[a-z0-9-]+\/[a-z0-9-]+(?::[a-zA-Z0-9._-]+)?$
type: string
value:
type: string
required:
Expand All @@ -192,6 +196,10 @@ spec:
description: ImageRef is used to specify an image by its digest.
pattern: ^sha256:[a-fA-F0-9]{64}$
type: string
imageUrl:
description: ImageUrl is used to specify an image by its URL with or without a tag.
pattern: ^(?:https:\/\/)?[a-z0-9.-]+\/[a-z0-9-]+\/[a-z0-9-]+(?::[a-zA-Z0-9._-]+)?$
type: string
value:
type: string
required:
Expand Down
5 changes: 5 additions & 0 deletions api/v1alpha1/enterprisecontractpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ type VolatileCriteria struct {
// +optional
// +kubebuilder:validation:Pattern=`^sha256:[a-fA-F0-9]{64}$`
ImageRef string `json:"imageRef,omitempty"`

// ImageUrl is used to specify an image by its URL with or without a tag.
// +optional
// +kubebuilder:validation:Pattern=`^(?:https:\/\/)?[a-z0-9.-]+\/[a-z0-9-]+\/[a-z0-9-]+(?::[a-zA-Z0-9._-]+)?$`
ImageUrl string `json:"imageUrl,omitempty"`
}

// VolatileSourceConfig specifies volatile configuration for a policy source.
Expand Down
4 changes: 4 additions & 0 deletions api/v1alpha1/policy_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@
"imageRef": {
"type": "string",
"description": "ImageRef is used to specify an image by its digest.\n+optional\n+kubebuilder:validation:Pattern=`^sha256:[a-fA-F0-9]{64}$`"
},
"imageUrl": {
"type": "string",
"description": "ImageUrl is used to specify an image by its URL with or without a tag.\n+optional\n+kubebuilder:validation:Pattern=`^(?:https:\\/\\/)?[a-z0-9.-]+\\/[a-z0-9-]+\\/[a-z0-9-]+(?::[a-zA-Z0-9._-]+)?$`"
}
},
"additionalProperties": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ spec:
description: ImageRef is used to specify an image by its digest.
pattern: ^sha256:[a-fA-F0-9]{64}$
type: string
imageUrl:
description: ImageUrl is used to specify an image by its URL with or without a tag.
pattern: ^(?:https:\/\/)?[a-z0-9.-]+\/[a-z0-9-]+\/[a-z0-9-]+(?::[a-zA-Z0-9._-]+)?$
type: string
value:
type: string
required:
Expand All @@ -192,6 +196,10 @@ spec:
description: ImageRef is used to specify an image by its digest.
pattern: ^sha256:[a-fA-F0-9]{64}$
type: string
imageUrl:
description: ImageUrl is used to specify an image by its URL with or without a tag.
pattern: ^(?:https:\/\/)?[a-z0-9.-]+\/[a-z0-9-]+\/[a-z0-9-]+(?::[a-zA-Z0-9._-]+)?$
type: string
value:
type: string
required:
Expand Down

0 comments on commit be8b799

Please sign in to comment.