@@ -20,22 +20,78 @@ import (
20
20
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21
21
)
22
22
23
- // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
24
- // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
23
+ // GitHub defines a GitHub type source where the CRD is coming from `release` section of a GitHub repository.
24
+ type GitHub struct {
25
+ }
26
+
27
+ // ConfigMap defines a reference to a configmap which hold the CRD information. Version is taken from a version field.
28
+ type ConfigMap struct {
29
+ // +required
30
+ Name string `json:"name"`
31
+ // +required
32
+ Version string `json:"version"`
33
+ }
34
+
35
+ // URL holds a URL from which to fetch the CRD. Version is defined through the digest of the content.
36
+ type URL struct {
37
+ URL string `json:"url"`
38
+ }
39
+
40
+ // Source defines options from where to fetch CRD content.
41
+ type Source struct {
42
+ // +optional
43
+ GitHub * GitHub `json:"gitHub,omitempty"`
44
+ // +optional
45
+ ConfigMap * ConfigMap `json:"configMap,omitempty"`
46
+ // +optional
47
+ URL * URL `json:"url,omitempty"`
48
+ }
25
49
26
50
// BootstrapSpec defines the desired state of Bootstrap
27
51
type BootstrapSpec struct {
28
- // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
29
- // Important: Run "make" to regenerate code after modifying this file
52
+ // Interval defines the regular interval at which a poll for new version should happen.
53
+ // +optional
54
+ Interval metav1.Time `json:"interval,omitempty"`
55
+
56
+ // SourceRef defines a reference to a source which will provide a CRD based on some contract.
57
+ // +required
58
+ Source * Source `json:"source"`
30
59
31
- // Foo is an example field of Bootstrap. Edit bootstrap_types.go to remove/update
32
- Foo string `json:"foo,omitempty"`
60
+ // TemplateRef defines a reference to a configmap which holds a template that we will use to verify that
61
+ // the CRD doesn't break anything if applied.
62
+ // +required
63
+ TemplateRef string `json:"templateRef"`
33
64
}
34
65
35
66
// BootstrapStatus defines the observed state of Bootstrap
36
67
type BootstrapStatus struct {
37
- // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
38
- // Important: Run "make" to regenerate code after modifying this file
68
+ // ObservedGeneration is the last reconciled generation.
69
+ // +optional
70
+ ObservedGeneration int64 `json:"observedGeneration,omitempty"`
71
+
72
+ // +optional
73
+ // +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].status",description=""
74
+ // +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].message",description=""
75
+ Conditions []metav1.Condition `json:"conditions,omitempty"`
76
+
77
+ // +optional
78
+ LastAttemptedVersion string `json:"lastAttemptedVersion,omitempty"`
79
+
80
+ // +optional
81
+ LastAppliedVersion string `json:"lastAppliedVersion,omitempty"`
82
+
83
+ // +optional
84
+ LastAppliedDigest string `json:"lastAppliedDigest,omitempty"`
85
+ }
86
+
87
+ // GetConditions returns the conditions of the ComponentVersion.
88
+ func (in * Bootstrap ) GetConditions () []metav1.Condition {
89
+ return in .Status .Conditions
90
+ }
91
+
92
+ // SetConditions sets the conditions of the ComponentVersion.
93
+ func (in * Bootstrap ) SetConditions (conditions []metav1.Condition ) {
94
+ in .Status .Conditions = conditions
39
95
}
40
96
41
97
//+kubebuilder:object:root=true
0 commit comments