Skip to content

Commit ca90e3e

Browse files
committed
Rename envVar package to overrides
An upcoming change will allow OLM users to set the Volume and VolumeMounts in operator deployments via the subscription config field. There is a fair amount of code that resides in the envvar package that could be reused.
1 parent 4591895 commit ca90e3e

File tree

12 files changed

+34
-34
lines changed

12 files changed

+34
-34
lines changed

pkg/controller/install/deployment.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ var _ StrategyInstaller = &StrategyDeploymentInstaller{}
5858
// initializes it for install.
5959
//
6060
// Before a deployment is created on the cluster, we can run a series of
61-
// initializer functions that will properly initialize the deployment object.
61+
// overrides functions that will properly initialize the deployment object.
6262
type DeploymentInitializerFunc func(deployment *appsv1.Deployment) error
6363

6464
// DeploymentInitializerFuncChain defines a chain of DeploymentInitializerFunc.
6565
type DeploymentInitializerFuncChain []DeploymentInitializerFunc
6666

67-
// Apply runs series of initializer functions that will properly initialize
67+
// Apply runs series of overrides functions that will properly initialize
6868
// the deployment object.
6969
func (c DeploymentInitializerFuncChain) Apply(deployment *appsv1.Deployment) (err error) {
7070
for _, initializer := range c {

pkg/controller/operators/olm/operator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import (
3434
"github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/informers/externalversions"
3535
"github.com/operator-framework/operator-lifecycle-manager/pkg/controller/certs"
3636
"github.com/operator-framework/operator-lifecycle-manager/pkg/controller/install"
37-
"github.com/operator-framework/operator-lifecycle-manager/pkg/controller/operators/olm/envvar"
37+
"github.com/operator-framework/operator-lifecycle-manager/pkg/controller/operators/olm/overrides"
3838
"github.com/operator-framework/operator-lifecycle-manager/pkg/controller/registry/resolver"
3939
csvutility "github.com/operator-framework/operator-lifecycle-manager/pkg/lib/csv"
4040
"github.com/operator-framework/operator-lifecycle-manager/pkg/lib/event"
@@ -476,7 +476,7 @@ func newOperatorWithConfig(ctx context.Context, config *operatorConfig) (*Operat
476476
op.RegisterQueueInformer(informer)
477477
}
478478

479-
proxyEnvInjector := envvar.NewDeploymentInitializer(op.logger, proxyQuerierInUse, op.lister)
479+
proxyEnvInjector := overrides.NewDeploymentInitializer(op.logger, proxyQuerierInUse, op.lister)
480480
op.resolver = &install.StrategyResolver{
481481
ProxyInjectorBuilderFunc: proxyEnvInjector.GetDeploymentInitializer,
482482
}

pkg/controller/operators/olm/envvar/config.go renamed to pkg/controller/operators/olm/overrides/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package envvar
1+
package overrides
22

33
import (
44
"fmt"

pkg/controller/operators/olm/envvar/initializer.go renamed to pkg/controller/operators/olm/overrides/initializer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package envvar
1+
package overrides
22

33
import (
44
"fmt"

pkg/controller/operators/olm/envvar/inject.go renamed to pkg/controller/operators/olm/overrides/inject.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package envvar
1+
package overrides
22

33
import (
44
"errors"

pkg/controller/operators/olm/envvar/inject_test.go renamed to pkg/controller/operators/olm/overrides/inject_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package envvar_test
1+
package overrides_test
22

33
import (
44
"testing"
55

6-
"github.com/operator-framework/operator-lifecycle-manager/pkg/controller/operators/olm/envvar"
6+
"github.com/operator-framework/operator-lifecycle-manager/pkg/controller/operators/olm/overrides"
77

88
"github.com/stretchr/testify/assert"
99
corev1 "k8s.io/api/core/v1"
@@ -229,7 +229,7 @@ func TestInjectEnvIntoDeployment(t *testing.T) {
229229

230230
for _, tt := range tests {
231231
t.Run(tt.name, func(t *testing.T) {
232-
envvar.InjectEnvIntoDeployment(tt.podSpec, tt.envVar)
232+
overrides.InjectEnvIntoDeployment(tt.podSpec, tt.envVar)
233233

234234
podSpecWant := tt.expected
235235
podSpecGot := tt.podSpec

pkg/package-server/provider/manifests/prometheus/0.14.0/alertmanager.crd.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,11 +1436,11 @@ spec:
14361436
pending:
14371437
description: Pending is a list of initializers that must execute
14381438
in order before this object is visible. When the last pending
1439-
initializer is removed, and no failing result is set, the
1439+
overrides is removed, and no failing result is set, the
14401440
initializers struct will be set to nil and the object is considered
14411441
as initialized and visible to all clients.
14421442
items:
1443-
description: Initializer is information about an initializer
1443+
description: Initializer is information about an overrides
14441444
that has not yet completed.
14451445
properties:
14461446
name:
@@ -1937,12 +1937,12 @@ spec:
19371937
pending:
19381938
description: Pending is a list of initializers that
19391939
must execute in order before this object is visible.
1940-
When the last pending initializer is removed, and
1940+
When the last pending overrides is removed, and
19411941
no failing result is set, the initializers struct
19421942
will be set to nil and the object is considered as
19431943
initialized and visible to all clients.
19441944
items:
1945-
description: Initializer is information about an initializer
1945+
description: Initializer is information about an overrides
19461946
that has not yet completed.
19471947
properties:
19481948
name:

pkg/package-server/provider/manifests/prometheus/0.14.0/prometheus.crd.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,11 +1524,11 @@ spec:
15241524
pending:
15251525
description: Pending is a list of initializers that must execute
15261526
in order before this object is visible. When the last pending
1527-
initializer is removed, and no failing result is set, the
1527+
overrides is removed, and no failing result is set, the
15281528
initializers struct will be set to nil and the object is considered
15291529
as initialized and visible to all clients.
15301530
items:
1531-
description: Initializer is information about an initializer
1531+
description: Initializer is information about an overrides
15321532
that has not yet completed.
15331533
properties:
15341534
name:
@@ -2439,12 +2439,12 @@ spec:
24392439
pending:
24402440
description: Pending is a list of initializers that
24412441
must execute in order before this object is visible.
2442-
When the last pending initializer is removed, and
2442+
When the last pending overrides is removed, and
24432443
no failing result is set, the initializers struct
24442444
will be set to nil and the object is considered as
24452445
initialized and visible to all clients.
24462446
items:
2447-
description: Initializer is information about an initializer
2447+
description: Initializer is information about an overrides
24482448
that has not yet completed.
24492449
properties:
24502450
name:

pkg/package-server/provider/manifests/prometheus/0.15.0/alertmanager.crd.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,11 +1436,11 @@ spec:
14361436
pending:
14371437
description: Pending is a list of initializers that must execute
14381438
in order before this object is visible. When the last pending
1439-
initializer is removed, and no failing result is set, the
1439+
overrides is removed, and no failing result is set, the
14401440
initializers struct will be set to nil and the object is considered
14411441
as initialized and visible to all clients.
14421442
items:
1443-
description: Initializer is information about an initializer
1443+
description: Initializer is information about an overrides
14441444
that has not yet completed.
14451445
properties:
14461446
name:
@@ -1937,12 +1937,12 @@ spec:
19371937
pending:
19381938
description: Pending is a list of initializers that
19391939
must execute in order before this object is visible.
1940-
When the last pending initializer is removed, and
1940+
When the last pending overrides is removed, and
19411941
no failing result is set, the initializers struct
19421942
will be set to nil and the object is considered as
19431943
initialized and visible to all clients.
19441944
items:
1945-
description: Initializer is information about an initializer
1945+
description: Initializer is information about an overrides
19461946
that has not yet completed.
19471947
properties:
19481948
name:

pkg/package-server/provider/manifests/prometheus/0.15.0/prometheus.crd.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,11 +1524,11 @@ spec:
15241524
pending:
15251525
description: Pending is a list of initializers that must execute
15261526
in order before this object is visible. When the last pending
1527-
initializer is removed, and no failing result is set, the
1527+
overrides is removed, and no failing result is set, the
15281528
initializers struct will be set to nil and the object is considered
15291529
as initialized and visible to all clients.
15301530
items:
1531-
description: Initializer is information about an initializer
1531+
description: Initializer is information about an overrides
15321532
that has not yet completed.
15331533
properties:
15341534
name:
@@ -2439,12 +2439,12 @@ spec:
24392439
pending:
24402440
description: Pending is a list of initializers that
24412441
must execute in order before this object is visible.
2442-
When the last pending initializer is removed, and
2442+
When the last pending overrides is removed, and
24432443
no failing result is set, the initializers struct
24442444
will be set to nil and the object is considered as
24452445
initialized and visible to all clients.
24462446
items:
2447-
description: Initializer is information about an initializer
2447+
description: Initializer is information about an overrides
24482448
that has not yet completed.
24492449
properties:
24502450
name:

0 commit comments

Comments
 (0)