Skip to content

Commit cd2eca5

Browse files
author
dkokkino
committed
Create static secret to replace sycretsync
- Previously the csi-manila-secrets secret in the openshift-manila-csi-driver namespace required secretsync.go to generate the secret dynamically. Since we are changing how the authentication occurs for the manila driver that process can be replaced with a static secret asset.
1 parent f92e0d2 commit cd2eca5

File tree

7 files changed

+43
-164
lines changed

7 files changed

+43
-164
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: csi-manila-secrets
5+
namespace: openshift-manila-csi-driver
6+
stringData:
7+
os-cloud: openstack
8+
os-cloudsFile: /etc/openstack/clouds.yaml
9+
os-useClouds: "true"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Generated file. Do not edit. Update using "make update".
2+
#
3+
# Loaded from overlays/openstack-manila/base/config_secret.yaml
4+
#
5+
#
6+
7+
apiVersion: v1
8+
kind: Secret
9+
metadata:
10+
name: csi-manila-secrets
11+
namespace: openshift-manila-csi-driver
12+
stringData:
13+
os-cloud: openstack
14+
os-cloudsFile: /etc/openstack/clouds.yaml
15+
os-useClouds: "true"

assets/overlays/openstack-manila/generated/hypershift/manifests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ controllerStaticAssetNames:
55
- controller_sa.yaml
66
- service.yaml
77
guestStaticAssetNames:
8+
- config_secret.yaml
89
- csidriver.yaml
910
- lease_leader_election_binding.yaml
1011
- lease_leader_election_role.yaml
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Generated file. Do not edit. Update using "make update".
2+
#
3+
# Loaded from overlays/openstack-manila/base/config_secret.yaml
4+
#
5+
#
6+
7+
apiVersion: v1
8+
kind: Secret
9+
metadata:
10+
name: csi-manila-secrets
11+
namespace: openshift-manila-csi-driver
12+
stringData:
13+
os-cloud: openstack
14+
os-cloudsFile: /etc/openstack/clouds.yaml
15+
os-useClouds: "true"

assets/overlays/openstack-manila/generated/standalone/manifests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ controllerStaticAssetNames:
1010
- service.yaml
1111
- servicemonitor.yaml
1212
guestStaticAssetNames:
13+
- config_secret.yaml
1314
- csidriver.yaml
1415
- lease_leader_election_binding.yaml
1516
- lease_leader_election_role.yaml

pkg/driver/openstack-manila/openstack_manila.go

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
"github.com/openshift/csi-operator/pkg/driver/common/operator"
1717
"github.com/openshift/csi-operator/pkg/generator"
1818
"github.com/openshift/csi-operator/pkg/openstack-manila/client"
19-
"github.com/openshift/csi-operator/pkg/openstack-manila/secret"
2019
"github.com/openshift/csi-operator/pkg/openstack-manila/util"
2120
"github.com/openshift/csi-operator/pkg/operator/config"
2221
"github.com/openshift/library-go/pkg/controller/factory"
@@ -105,6 +104,7 @@ func GetOpenStackManilaGeneratorConfig() *generator.CSIDriverGeneratorConfig {
105104
"overlays/openstack-manila/base/csidriver.yaml",
106105
"overlays/openstack-manila/base/volumesnapshotclass.yaml",
107106
"overlays/openstack-manila/base/node_nfs.yaml",
107+
"overlays/openstack-manila/base/config_secret.yaml",
108108
),
109109
},
110110
}
@@ -190,11 +190,7 @@ func GetOpenStackManilaOperatorControllerConfig(ctx context.Context, flavour gen
190190
}
191191

192192
cfg.PreconditionInformers = []factory.Informer{c.GetCSIDriverInformer().Informer(), c.GetStorageClassInformer().Informer()}
193-
secretSyncer, err := createSecretSyncer(c)
194-
if err != nil {
195-
return nil, err
196-
}
197-
cfg.ExtraControlPlaneControllers = append(cfg.ExtraControlPlaneControllers, configMapSyncer, secretSyncer, nfsCSIDriverController)
193+
cfg.ExtraControlPlaneControllers = append(cfg.ExtraControlPlaneControllers, configMapSyncer, nfsCSIDriverController)
198194

199195
cfg.ExtraReplacementsFunc = func() []string {
200196
pairs := []string{}
@@ -327,19 +323,6 @@ func withCABundleDaemonSetHook(c *clients.Clients) (csidrivernodeservicecontroll
327323
return hook, informers
328324
}
329325

330-
func createSecretSyncer(c *clients.Clients) (factory.Controller, error) {
331-
secretSyncController := secret.NewSecretSyncController(
332-
c.OperatorClient,
333-
c.KubeClient,
334-
c.ControlPlaneKubeInformers,
335-
c.ControlPlaneNamespace,
336-
c.GuestNamespace,
337-
resyncInterval,
338-
c.EventRecorder)
339-
340-
return secretSyncController, nil
341-
}
342-
343326
func createConfigMapSyncer(c *clients.Clients) (factory.Controller, error) {
344327
// sync config map with OpenStack CA certificate to the operand namespace,
345328
// so the driver can get it as a ConfigMap volume.

pkg/openstack-manila/secret/secretsync.go

Lines changed: 0 additions & 145 deletions
This file was deleted.

0 commit comments

Comments
 (0)