-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
KudeBundle.go
48 lines (37 loc) · 1.56 KB
/
KudeBundle.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// KudeBundleSpec describes the desired state of a KudeBundle in the cluster. It provides the necessary
// information on the manifests to be installed in the cluster.
type KudeBundleSpec struct {
Files []string `json:"files,omitempty"`
// +kubebuilder:validation:Pattern=`^[^/]+/[^/]+$`
SourceRepository string `json:"sourceRepository,omitempty"`
}
// KudeBundleStatus defines the observed state of a KudeBundle.
type KudeBundleStatus struct {
Errors []string `json:"errors,omitempty"` // List of errors encountered while applying the files
// Conditions represent the latest available observations of the resource
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
}
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
// KudeBundle defines a set of Kubernetes manifest YAML files to be applied in the cluster.
//go:generate go run ../../scripts/objecter/objecter.go -type=KudeBundle
type KudeBundle struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec KudeBundleSpec `json:"spec,omitempty"`
Status KudeBundleStatus `json:"status,omitempty"`
}
//+kubebuilder:object:root=true
// KudeBundleList contains a list of KudeBundle
type KudeBundleList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []KudeBundle `json:"items"`
}
func init() {
SchemeBuilder.Register(&KudeBundle{}, &KudeBundleList{})
}