Skip to content

Commit a957ddb

Browse files
Reuse the PodPolicy
1 parent dbf0823 commit a957ddb

File tree

6 files changed

+10664
-345
lines changed

6 files changed

+10664
-345
lines changed

api/compute/v1alpha1/backendconfig_types.go

+1-40
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
package v1alpha1
1919

2020
import (
21-
v1 "k8s.io/api/core/v1"
2221
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2322
)
2423

@@ -36,51 +35,13 @@ type BackendConfigSpec struct {
3635
Env map[string]string `json:"env,omitempty"`
3736

3837
// +kubebuilder:validation:Optional
39-
Pod *BackendConfigPodPolicy `json:"pod,omitempty"`
38+
Pod *PodPolicy `json:"pod,omitempty"`
4039

4140
// +kubebuilder:validation:Optional
4241
// indicate whether auto update functions&sinks&source when the BackendConfig is updated
4342
AutoUpdate bool `json:"autoUpdate,omitempty"`
4443
}
4544

46-
// BackendConfigPodPolicy defines the policy for the pod
47-
type BackendConfigPodPolicy struct {
48-
// Labels specify the labels to attach to pod the operator creates for the cluster.
49-
Labels map[string]string `json:"labels,omitempty"`
50-
51-
// NodeSelector specifies a map of key-value pairs. For a pod to be eligible to run
52-
// on a node, the node must have each of the indicated key-value pairs as labels.
53-
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
54-
55-
// Affinity specifies the scheduling constraints of a pod
56-
Affinity *v1.Affinity `json:"affinity,omitempty"`
57-
58-
// Tolerations specifies the tolerations of a Pod
59-
Tolerations []v1.Toleration `json:"tolerations,omitempty"`
60-
61-
// Annotations specifies the annotations to attach to pods the operator creates
62-
Annotations map[string]string `json:"annotations,omitempty"`
63-
64-
// SecurityContext specifies the security context for the entire pod
65-
// More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context
66-
SecurityContext *v1.PodSecurityContext `json:"securityContext,omitempty"`
67-
68-
// TerminationGracePeriodSeconds is the amount of time that kubernetes will give
69-
// for a pod before terminating it.
70-
TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
71-
72-
// ImagePullSecrets is an optional list of references to secrets in the same
73-
// namespace to use for pulling any of the images used by this PodSpec.
74-
ImagePullSecrets []v1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
75-
76-
// ServiceAccountName is the name of the ServiceAccount to use to run this pod.
77-
// +optional
78-
ServiceAccountName string `json:"serviceAccountName,omitempty"`
79-
80-
// +kubebuilder:validation:Optional
81-
Liveness *Liveness `json:"liveness,omitempty"`
82-
}
83-
8445
// BackendConfigStatus defines the observed state of BackendConfig
8546
type BackendConfigStatus struct {
8647
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster

api/compute/v1alpha1/zz_generated.deepcopy.go

+1-69
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)