Skip to content

Commit 8de8874

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

File tree

5 files changed

+124
-31
lines changed

5 files changed

+124
-31
lines changed

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.
76+
type: object
77+
additionalProperties:
78+
type: string
79+
priorityClassName:
80+
description: If specified, indicates the pod's priority. 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:

crds/zz_defs.go

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

pkg/operators/v1alpha1/catalogsource_types.go

+30-6
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"
@@ -48,35 +49,40 @@ type CatalogSourceSpec struct {
4849
// The range of the priority value can go from positive to negative in the range of int32.
4950
// The default value to a catalog source with unassigned priority would be 0.
5051
// The catalog source with the same priority values will be ranked lexicographically based on its name.
51-
// +Optional
52+
// +optional
5253
Priority int `json:"priority,omitempty"`
5354

5455
// ConfigMap is the name of the ConfigMap to be used to back a configmap-server registry.
5556
// Only used when SourceType = SourceTypeConfigmap or SourceTypeInternal.
56-
// +Optional
57+
// +optional
5758
ConfigMap string `json:"configMap,omitempty"`
5859

5960
// Address is a host that OLM can use to connect to a pre-existing registry.
6061
// Format: <registry-host or ip>:<port>
6162
// Only used when SourceType = SourceTypeGrpc.
6263
// Ignored when the Image field is set.
63-
// +Optional
64+
// +optional
6465
Address string `json:"address,omitempty"`
6566

6667
// Image is an operator-registry container image to instantiate a registry-server with.
6768
// Only used when SourceType = SourceTypeGrpc.
6869
// If present, the address field is ignored.
69-
// +Optional
70+
// +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
74-
// +Optional
80+
// +optional
7581
UpdateStrategy *UpdateStrategy `json:"updateStrategy,omitempty"`
7682

7783
// Secrets represent set of secrets that can be used to access the contents of the catalog.
7884
// It is best to keep this list small, since each will need to be tried for every catalog entry.
79-
// +Optional
85+
// +optional
8086
Secrets []string `json:"secrets,omitempty"`
8187

8288
// Metadata
@@ -86,6 +92,24 @@ 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+
// +optional
100+
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
101+
102+
// Tolerations are the catalog source's pod's tolerations.
103+
// +optional
104+
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
105+
106+
// If specified, indicates the pod's priority.
107+
// If not specified, the pod priority will be default or zero if there is no
108+
// default.
109+
// +optional
110+
PriorityClassName string `json:"priorityClassName,omitempty" protobuf:"bytes,24,opt,name=priorityClassName"`
111+
}
112+
89113
// UpdateStrategy holds all the different types of catalog source update strategies
90114
// Currently only registry polling strategy is implemented
91115
type UpdateStrategy struct {

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.

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)