Skip to content

Commit 843cdbd

Browse files
committed
feat: add CrossNamespaceObjectReference to GitRepositoryVerification
Signed-off-by: pranshul gupta <[email protected]>
1 parent a0b4969 commit 843cdbd

File tree

3 files changed

+68
-1
lines changed

3 files changed

+68
-1
lines changed

api/v1/gitrepository_types.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,23 @@ type GitRepositoryRef struct {
218218
Commit string `json:"commit,omitempty"`
219219
}
220220

221+
// CrossNamespaceObjectReference allows referencing a Secret or ConfigMap
222+
// in another namespace.
223+
type CrossNamespaceObjectReference struct {
224+
// Name of the Secret or ConfigMap.
225+
// +kubebuilder:validation:MinLength=1
226+
Name string `json:"name"`
227+
228+
// Namespace of the Secret or ConfigMap.
229+
// +kubebuilder:validation:MinLength=1
230+
Namespace string `json:"namespace"`
231+
232+
// Kind of the object being referenced: Secret or ConfigMap.
233+
// +kubebuilder:validation:Enum=Secret;ConfigMap
234+
Kind string `json:"kind"`
235+
}
236+
237+
221238
// GitRepositoryVerification specifies the Git commit signature verification
222239
// strategy.
223240
type GitRepositoryVerification struct {
@@ -235,6 +252,11 @@ type GitRepositoryVerification struct {
235252
// authors.
236253
// +required
237254
SecretRef meta.LocalObjectReference `json:"secretRef"`
255+
256+
// PublicKeyRef allows referencing a Secret or ConfigMap in another namespace
257+
// that contains the public key(s) for verification.
258+
// +optional
259+
PublicKeyRef *CrossNamespaceObjectReference `json:"publicKeyRef,omitempty"`
238260
}
239261

240262
// GitRepositoryStatus records the observed state of a Git repository.

api/v1/zz_generated.deepcopy.go

Lines changed: 21 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/source.toolkit.fluxcd.io_gitrepositories.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,31 @@ spec:
217217
- Tag
218218
- TagAndHEAD
219219
type: string
220+
publicKeyRef:
221+
description: |-
222+
PublicKeyRef allows referencing a Secret or ConfigMap in another namespace
223+
that contains the public key(s) for verification.
224+
properties:
225+
kind:
226+
description: 'Kind of the object being referenced: Secret
227+
or ConfigMap.'
228+
enum:
229+
- Secret
230+
- ConfigMap
231+
type: string
232+
name:
233+
description: Name of the Secret or ConfigMap.
234+
minLength: 1
235+
type: string
236+
namespace:
237+
description: Namespace of the Secret or ConfigMap.
238+
minLength: 1
239+
type: string
240+
required:
241+
- kind
242+
- name
243+
- namespace
244+
type: object
220245
secretRef:
221246
description: |-
222247
SecretRef specifies the Secret containing the public keys of trusted Git

0 commit comments

Comments
 (0)