Skip to content

Commit 4cb99da

Browse files
Merge pull request #1058 from awgreene/sub-config
feat(subscription) Config Volume and VolumeMounts
2 parents 0c9e4bf + 167af94 commit 4cb99da

29 files changed

+7390
-347
lines changed

deploy/chart/templates/0000_50_olm_05-subscription.crd.yaml

Lines changed: 1279 additions & 0 deletions
Large diffs are not rendered by default.

deploy/ocp/manifests/0.12.0/0000_50_olm_05-subscription.crd.yaml

Lines changed: 1279 additions & 0 deletions
Large diffs are not rendered by default.

deploy/upstream/manifests/0.12.0/0000_50_olm_05-subscription.crd.yaml

Lines changed: 1279 additions & 0 deletions
Large diffs are not rendered by default.

deploy/upstream/quickstart/crds.yaml

Lines changed: 1279 additions & 0 deletions
Large diffs are not rendered by default.

doc/design/subscription-config.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Subscription Config
2+
3+
## Configuring Operators deployed by OLM
4+
5+
It is possible to configure how OLM deploys an operator via the `config` field in the [subscription](../../pkg/api/apis/operators/subscription_types.go) object.
6+
7+
Currently, the OLM supports the following configurations:
8+
9+
### Env
10+
11+
The `Env` field defines a list of environment variables that must exist in all containers in the `pod` created by OLM.
12+
13+
> Note: Values defined here will overwrite existing environment varaibles of the same name.
14+
15+
### EnvFrom
16+
17+
The `EnvFrom` field defines a list of sources to populate environment variables in the container.
18+
The keys defined within a source must be a C_IDENTIFIER.
19+
All invalid keys will be reported as an event when the container is starting.
20+
When a key exists in multiple sources, the value associated with the last source will take precedence.
21+
22+
> Note: Values defined by an Env with a duplicate key will take precedence.
23+
24+
### Volumes
25+
26+
The `Volumes` field defines a list of [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) that must exist on the `pod` created by OLM.
27+
28+
> Note: Volumes defined here will overwrite existing Volumes of the same name.
29+
30+
### VolumeMounts
31+
32+
The `VolumeMounts` field defines a list of [volumeMounts](https://kubernetes.io/docs/concepts/storage/volumes/) that must exist in all containers in the `pod` created by OLM. If a `volumeMount` references a `volume` that does not exist, OLM will fail to deploy the operator.
33+
34+
> Note: VolumeMounts defined here will overwrite existing VolumeMounts of the same name.

manifests/0000_50_olm_05-subscription.crd.yaml

Lines changed: 1279 additions & 0 deletions
Large diffs are not rendered by default.

pkg/api/apis/operators/subscription_types.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ type SubscriptionConfig struct {
7373
// +patchMergeKey=name
7474
// +patchStrategy=merge
7575
Env []corev1.EnvVar `json:"env,omitempty"`
76+
77+
// List of Volumes to set in the podSpec.
78+
// +optional
79+
Volumes []corev1.Volume `json:"volumes,omitempty"`
80+
81+
// List of VolumeMounts to set in the container.
82+
// +optional
83+
VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
7684
}
7785

7886
// SubscriptionConditionType indicates an explicit state condition about a Subscription in "abnormal-true"

pkg/api/apis/operators/v1alpha1/subscription_types.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ type SubscriptionConfig struct {
7676
// +patchStrategy=merge
7777
// +optional
7878
Env []corev1.EnvVar `json:"env,omitempty" patchMergeKey:"name" patchStrategy:"merge"`
79+
80+
// List of Volumes to set in the podSpec.
81+
// +optional
82+
Volumes []corev1.Volume `json:"volumes,omitempty"`
83+
84+
// List of VolumeMounts to set in the container.
85+
// +optional
86+
VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
7987
}
8088

8189
// SubscriptionConditionType indicates an explicit state condition about a Subscription in "abnormal-true"

pkg/api/apis/operators/v1alpha1/zz_generated.conversion.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/api/apis/operators/v1alpha1/zz_generated.deepcopy.go

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)