/
importReference.go
49 lines (40 loc) · 1.42 KB
/
importReference.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
49
package v1alpha1
// ImportReferenceType describes the type of location
// from where the referenced template structure should be retrieved.
// Only one of the following parent locations may be specified.
// +kubebuilder:validation:Enum=Uri;Id;Kubernetes
type ImportReferenceType string
const (
UriImportReferenceType ImportReferenceType = "Uri"
IdImportReferenceType ImportReferenceType = "Id"
KubernetesImportReferenceType ImportReferenceType = "Kubernetes"
)
// Location from where the an import reference is retrieved
// +k8s:openapi-gen=true
// +union
type ImportReferenceUnion struct {
// type of location from where the referenced template structure should be retrieved
// +
// +unionDiscriminator
// +optional
ImportReferenceType ImportReferenceType `json:"importReferenceType,omitempty"`
// Uri of a Devfile yaml file
// +optional
Uri string `json:"uri,omitempty"`
// Id in a registry that contains a Devfile yaml file
// +optional
Id string `json:"id,omitempty"`
// Reference to a Kubernetes CRD of type DevWorkspaceTemplate
// +optional
Kubernetes *KubernetesCustomResourceImportReference `json:"kubernetes,omitempty"`
}
type KubernetesCustomResourceImportReference struct {
Name string `json:"name"`
// +optional
Namespace string `json:"namespace,omitempty"`
}
type ImportReference struct {
ImportReferenceUnion `json:",inline"`
// +optional
RegistryUrl string `json:"registryUrl,omitempty"`
}