/
settingsconfig_types.go
54 lines (43 loc) · 1.74 KB
/
settingsconfig_types.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
package v1alpha1
import (
corev1 "k8s.io/api/core/v1"
netv1 "k8s.io/api/networking/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
cfg "sigs.k8s.io/controller-runtime/pkg/config/v1alpha1"
)
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
type SettingsNetPolConfig struct {
// Specification of the desired behavior for this NetworkPolicy.
// +optional
Namespace string `json:"namespace,omitempty"`
Spec netv1.NetworkPolicySpec `json:"spec,omitempty"`
}
type SettingsQuotaConfig struct {
// Defines the desired quota.
// +optional
Namespace string `json:"namespace,omitempty"`
Spec corev1.ResourceQuotaSpec `json:"spec,omitempty"`
}
//+kubebuilder:object:root=true
// SettingsConfig is the Schema for the settingsconfigs API
type SettingsConfig struct {
metav1.TypeMeta `json:",inline"`
// ControllerManagerConfigurationSpec returns the generic configuration for controllers
cfg.ControllerManagerConfigurationSpec `json:",inline"`
// Namespace defines the space within which each name must be unique. An empty namespace is
// equivalent to the "default" namespace, but "default" is the canonical representation.
// Not all objects are required to be scoped to a namespace - the value of this field for
// those objects will be empty.
//
// Must be a DNS_LABEL.
// Cannot be updated.
// More info: http://kubernetes.io/docs/user-guide/namespaces
// +optional
Namespace string `json:"namespace,omitempty"`
NetPolConfig SettingsNetPolConfig `json:"networkPolicyConfig,omitempty"`
QuotaConfig SettingsQuotaConfig `json:"quotaConfig,omitempty"`
}
//+kubebuilder:object:root=true
func init() {
SchemeBuilder.Register(&SettingsConfig{})
}