Skip to content

Commit aacfab3

Browse files
committed
Add shortNames for ImageRepository and ImagePolicy
Add 'imgrepo' and 'imgpol' aliases to enable shorter kubectl commands: - kubectl get imgrepo (instead of imagerepositories) - kubectl get imgpol (instead of imagepolicies) The aliases follow Flux ecosystem naming conventions using the 'img' prefix consistent with standard Docker/Kubernetes terminology. Signed-off-by: cappyzawa <[email protected]>
1 parent b65e8a0 commit aacfab3

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

api/v1beta2/imagepolicy_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ func (in *ImagePolicy) SetConditions(conditions []metav1.Condition) {
205205
// +kubebuilder:storageversion
206206
// +kubebuilder:object:root=true
207207
// +kubebuilder:subresource:status
208+
// +kubebuilder:resource:shortName=imgpol
208209
// +kubebuilder:printcolumn:name="LatestImage",type=string,JSONPath=`.status.latestImage`
209210

210211
// ImagePolicy is the Schema for the imagepolicies API

api/v1beta2/imagerepository_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ func (in ImageRepository) GetRequeueAfter() time.Duration {
197197
// +kubebuilder:storageversion
198198
// +kubebuilder:object:root=true
199199
// +kubebuilder:subresource:status
200+
// +kubebuilder:resource:shortName=imgrepo
200201
// +kubebuilder:printcolumn:name="Last scan",type=string,JSONPath=`.status.lastScanResult.scanTime`
201202
// +kubebuilder:printcolumn:name="Tags",type=string,JSONPath=`.status.lastScanResult.tagCount`
202203

config/crd/bases/image.toolkit.fluxcd.io_imagepolicies.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ spec:
1111
kind: ImagePolicy
1212
listKind: ImagePolicyList
1313
plural: imagepolicies
14+
shortNames:
15+
- imgpol
1416
singular: imagepolicy
1517
scope: Namespaced
1618
versions:

config/crd/bases/image.toolkit.fluxcd.io_imagerepositories.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ spec:
1111
kind: ImageRepository
1212
listKind: ImageRepositoryList
1313
plural: imagerepositories
14+
shortNames:
15+
- imgrepo
1416
singular: imagerepository
1517
scope: Namespaced
1618
versions:

0 commit comments

Comments
 (0)