Change SourceRef to use CrossNamespaceSourceReference

This commit is contained in:
Philip Laine 2020-09-08 21:46:56 +02:00
parent ea627e3448
commit c113c2043f
4 changed files with 40 additions and 3 deletions

View File

@ -50,8 +50,7 @@ type KustomizationSpec struct {
// +required
Prune bool `json:"prune"`
// A list of workloads (Deployments, DaemonSets and StatefulSets)
// to be included in the health assessment.
// A list of resources to be included in the health assessment.
// +optional
HealthChecks []CrossNamespaceObjectReference `json:"healthChecks,omitempty"`
@ -61,7 +60,7 @@ type KustomizationSpec struct {
// Reference of the source where the kustomization file is.
// +required
SourceRef CrossNamespaceObjectReference `json:"sourceRef"`
SourceRef CrossNamespaceSourceReference `json:"sourceRef"`
// This flag tells the controller to suspend subsequent kustomize executions,
// it does not apply to already started executions. Defaults to false.

View File

@ -35,3 +35,24 @@ type CrossNamespaceObjectReference struct {
// +optional
Namespace string `json:"namespace,omitempty"`
}
// CrossNamespaceSourceReference contains enough information to let you locate the
// typed referenced object at cluster level
type CrossNamespaceSourceReference struct {
// API version of the referent
// +optional
APIVersion string `json:"apiVersion,omitempty"`
// Kind of the referent
// +kubebuilder:validation:Enum=GitRepository
// +required
Kind string `json:"kind"`
// Name of the referent
// +required
Name string `json:"name"`
// Namespace of the referent
// +optional
Namespace string `json:"namespace,omitempty"`
}

View File

@ -57,6 +57,21 @@ func (in *CrossNamespaceObjectReference) DeepCopy() *CrossNamespaceObjectReferen
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CrossNamespaceSourceReference) DeepCopyInto(out *CrossNamespaceSourceReference) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrossNamespaceSourceReference.
func (in *CrossNamespaceSourceReference) DeepCopy() *CrossNamespaceSourceReference {
if in == nil {
return nil
}
out := new(CrossNamespaceSourceReference)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Decryption) DeepCopyInto(out *Decryption) {
*out = *in

View File

@ -133,6 +133,8 @@ spec:
type: string
kind:
description: Kind of the referent
enum:
- GitRepository
type: string
name:
description: Name of the referent