Skip to content

Commit dcbc254

Browse files
committed
Add grpcPodConfig attribute to spec
Signed-off-by: Per G. da Silva <[email protected]>
1 parent 940ea90 commit dcbc254

File tree

5 files changed

+121
-24
lines changed

5 files changed

+121
-24
lines changed

Diff for: crds/operators.coreos.com_catalogsources.yaml

+35
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,41 @@ spec:
6767
displayName:
6868
description: Metadata
6969
type: string
70+
grpcPodConfig:
71+
description: GrpcPodConfig exposes different overrides for the pod spec of the CatalogSource Pod. Only used when SourceType = SourceTypeGrpc and Image is set.
72+
type: object
73+
properties:
74+
nodeSelector:
75+
description: 'NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node''s labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/'
76+
type: object
77+
additionalProperties:
78+
type: string
79+
priorityClassName:
80+
description: If specified, indicates the pod's priority. "system-node-critical" and "system-cluster-critical" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.
81+
type: string
82+
tolerations:
83+
description: Tolerations are the catalog source's pod's tolerations.
84+
type: array
85+
items:
86+
description: The pod this Toleration is attached to tolerates any taint that matches the triple <key,value,effect> using the matching operator <operator>.
87+
type: object
88+
properties:
89+
effect:
90+
description: Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
91+
type: string
92+
key:
93+
description: Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.
94+
type: string
95+
operator:
96+
description: Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.
97+
type: string
98+
tolerationSeconds:
99+
description: TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.
100+
type: integer
101+
format: int64
102+
value:
103+
description: Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.
104+
type: string
70105
icon:
71106
type: object
72107
required:

Diff for: crds/zz_defs.go

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

Diff for: pkg/operators/v1alpha1/catalogsource_types.go

+28
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package v1alpha1
22

33
import (
44
"fmt"
5+
corev1 "k8s.io/api/core/v1"
56
"time"
67

78
"github.com/sirupsen/logrus"
@@ -69,6 +70,11 @@ type CatalogSourceSpec struct {
6970
// +Optional
7071
Image string `json:"image,omitempty"`
7172

73+
// GrpcPodConfig exposes different overrides for the pod spec of the CatalogSource Pod.
74+
// Only used when SourceType = SourceTypeGrpc and Image is set.
75+
// +Optional
76+
GrpcPodConfig *GrpcPodConfig `json:"grpcPodConfig,omitempty"`
77+
7278
// UpdateStrategy defines how updated catalog source images can be discovered
7379
// Consists of an interval that defines polling duration and an embedded strategy type
7480
// +Optional
@@ -86,6 +92,28 @@ type CatalogSourceSpec struct {
8692
Icon Icon `json:"icon,omitempty"`
8793
}
8894

95+
// GrpcPodConfig contains configuration specified for a catalog source
96+
type GrpcPodConfig struct {
97+
// NodeSelector is a selector which must be true for the pod to fit on a node.
98+
// Selector which must match a node's labels for the pod to be scheduled on that node.
99+
// More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
100+
// +optional
101+
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
102+
103+
// Tolerations are the catalog source's pod's tolerations.
104+
// +optional
105+
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
106+
107+
// If specified, indicates the pod's priority. "system-node-critical" and
108+
// "system-cluster-critical" are two special keywords which indicate the
109+
// highest priorities with the former being the highest priority. Any other
110+
// name must be defined by creating a PriorityClass object with that name.
111+
// If not specified, the pod priority will be default or zero if there is no
112+
// default.
113+
// +optional
114+
PriorityClassName string `json:"priorityClassName,omitempty" protobuf:"bytes,24,opt,name=priorityClassName"`
115+
}
116+
89117
// UpdateStrategy holds all the different types of catalog source update strategies
90118
// Currently only registry polling strategy is implemented
91119
type UpdateStrategy struct {

Diff for: pkg/operators/v1alpha1/zz_generated.deepcopy.go

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

Diff for: pkg/validation/internal/bundle.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ func validateServiceAccounts(bundle *manifests.Bundle) []errors.Error {
5252
sa := v1.ServiceAccount{}
5353
if err := runtime.DefaultUnstructuredConverter.FromUnstructured(obj.Object, &sa); err == nil {
5454
if _, ok := saNamesFromCSV[sa.Name]; ok {
55-
errs = append(errs, errors.ErrInvalidBundle(fmt.Sprintf("invalid service account found in bundle. " +
56-
"This service account %s in your bundle is not valid, because a service account with the same name " +
57-
"was already specified in your CSV. If this was unintentional, please remove the service account " +
58-
"manifest from your bundle. If it was intentional to specify a separate service account, " +
59-
"please rename the SA in either the bundle manifest or the CSV.",sa.Name), sa.Name))
55+
errs = append(errs, errors.ErrInvalidBundle(fmt.Sprintf("invalid service account found in bundle. "+
56+
"This service account %s in your bundle is not valid, because a service account with the same name "+
57+
"was already specified in your CSV. If this was unintentional, please remove the service account "+
58+
"manifest from your bundle. If it was intentional to specify a separate service account, "+
59+
"please rename the SA in either the bundle manifest or the CSV.", sa.Name), sa.Name))
6060
}
6161
}
6262
}

0 commit comments

Comments
 (0)