-
Notifications
You must be signed in to change notification settings - Fork 586
/
types_console_yaml_sample.go
74 lines (61 loc) · 2.95 KB
/
types_console_yaml_sample.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package v1
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ConsoleYAMLSample is an extension for customizing OpenShift web console YAML samples.
//
// Compatibility level 2: Stable within a major release for a minimum of 9 months or 3 minor releases (whichever is longer).
// +kubebuilder:object:root=true
// +kubebuilder:resource:path=consoleyamlsamples,scope=Cluster
// +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/481
// +openshift:file-pattern=operatorOrdering=00
// +openshift:capability=Console
// +kubebuilder:metadata:annotations="description=Extension for configuring openshift web console YAML samples."
// +kubebuilder:metadata:annotations="displayName=ConsoleYAMLSample"
// +openshift:compatibility-gen:level=2
type ConsoleYAMLSample struct {
metav1.TypeMeta `json:",inline"`
// metadata is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
metav1.ObjectMeta `json:"metadata"`
Spec ConsoleYAMLSampleSpec `json:"spec"`
}
// ConsoleYAMLSampleSpec is the desired YAML sample configuration.
// Samples will appear with their descriptions in a samples sidebar
// when creating a resources in the web console.
type ConsoleYAMLSampleSpec struct {
// targetResource contains apiVersion and kind of the resource
// YAML sample is representating.
TargetResource metav1.TypeMeta `json:"targetResource"`
// title of the YAML sample.
Title ConsoleYAMLSampleTitle `json:"title"`
// description of the YAML sample.
Description ConsoleYAMLSampleDescription `json:"description"`
// yaml is the YAML sample to display.
YAML ConsoleYAMLSampleYAML `json:"yaml"`
// snippet indicates that the YAML sample is not the full YAML resource
// definition, but a fragment that can be inserted into the existing
// YAML document at the user's cursor.
// +optional
Snippet bool `json:"snippet"`
}
// ConsoleYAMLSampleTitle of the YAML sample.
// +kubebuilder:validation:Pattern=`^(.|\s)*\S(.|\s)*$`
type ConsoleYAMLSampleTitle string
// ConsoleYAMLSampleDescription of the YAML sample.
// +kubebuilder:validation:Pattern=`^(.|\s)*\S(.|\s)*$`
type ConsoleYAMLSampleDescription string
// ConsoleYAMLSampleYAML is the YAML sample to display.
// +kubebuilder:validation:Pattern=`^(.|\s)*\S(.|\s)*$`
type ConsoleYAMLSampleYAML string
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// Compatibility level 2: Stable within a major release for a minimum of 9 months or 3 minor releases (whichever is longer).
// +openshift:compatibility-gen:level=2
type ConsoleYAMLSampleList struct {
metav1.TypeMeta `json:",inline"`
// metadata is the standard list's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
metav1.ListMeta `json:"metadata"`
Items []ConsoleYAMLSample `json:"items"`
}