Skip to content

Commit 0a97de4

Browse files
Merge tag 'v1.28.3' into feature/csiTimeout1.28
2 parents 019e53a + 078818a commit 0a97de4

File tree

53 files changed

+781
-230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+781
-230
lines changed

.github/workflows/release-cpo.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ on:
88
jobs:
99
release:
1010
runs-on: ubuntu-latest
11-
11+
permissions:
12+
contents: write
1213
steps:
1314
- name: Checkout
1415
uses: actions/checkout@v3

.github/workflows/release.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
jobs:
1010
release:
1111
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
1214
steps:
1315
- name: Checkout
1416
uses: actions/checkout@v3
@@ -21,6 +23,6 @@ jobs:
2123
git config user.email "[email protected]"
2224
2325
- name: Run chart-releaser
24-
uses: helm/chart-releaser-action@v1.1.0
26+
uses: helm/chart-releaser-action@v1.6.0
2527
env:
2628
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

.golangci.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
run:
2+
concurrency: 2
23
timeout: 10m0s
34
linters:
45
enable:
56
- gofmt
67
output:
7-
format: line-number
8+
formats:
9+
 - format: line-number
10+
 path: stdout

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ $(BUILD_CMDS): $(SOURCES)
7171
test: unit functional
7272

7373
check: work
74-
go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.56.0 run ./...
74+
go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0 run ./...
7575

7676
unit: work
7777
go test -tags=unit $(shell go list ./... | sed -e '/sanity/ { N; d; }' | sed -e '/tests/ {N; d;}') $(TESTARGS)

charts/cinder-csi-plugin/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apiVersion: v1
2-
appVersion: v1.28.2
2+
appVersion: v1.28.3
33
description: Cinder CSI Chart for OpenStack
44
name: openstack-cinder-csi
5-
version: 2.28.2
5+
version: 2.28.3
66
home: https://github.com/kubernetes/cloud-provider-openstack
77
icon: https://github.com/kubernetes/kubernetes/blob/master/logo/logo.png
88
maintainers:

charts/manila-csi-plugin/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apiVersion: v1
2-
appVersion: v1.28.2
2+
appVersion: v1.28.3
33
description: Manila CSI Chart for OpenStack
44
name: openstack-manila-csi
5-
version: 2.28.2
5+
version: 2.28.3
66
home: http://github.com/kubernetes/cloud-provider-openstack
77
icon: https://github.com/kubernetes/kubernetes/blob/master/logo/logo.png
88
maintainers:

charts/openstack-cloud-controller-manager/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
apiVersion: v1
2-
appVersion: v1.28.2
2+
appVersion: v1.28.3
33
description: Openstack Cloud Controller Manager Helm Chart
44
icon: https://object-storage-ca-ymq-1.vexxhost.net/swift/v1/6e4619c416ff4bd19e1c087f27a43eea/www-images-prod/openstack-logo/OpenStack-Logo-Vertical.png
55
home: https://github.com/kubernetes/cloud-provider-openstack
66
name: openstack-cloud-controller-manager
7-
version: 2.28.4
7+
version: 2.28.5
88
maintainers:
99
- name: eumel8
1010

cmd/cinder-csi-plugin/main.go

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,14 @@ import (
3131
)
3232

3333
var (
34-
endpoint string
35-
nodeID string
36-
cloudConfig []string
37-
cluster string
38-
httpEndpoint string
34+
endpoint string
35+
nodeID string
36+
cloudConfig []string
37+
cluster string
38+
httpEndpoint string
39+
provideControllerService bool
40+
provideNodeService bool
41+
noClient bool
3942
)
4043

4144
func main() {
@@ -64,7 +67,12 @@ func main() {
6467
}
6568

6669
cmd.PersistentFlags().StringVar(&cluster, "cluster", "", "The identifier of the cluster that the plugin is running in.")
67-
cmd.PersistentFlags().StringVar(&httpEndpoint, "http-endpoint", "", "The TCP network address where the HTTP server for diagnostics, including metrics and leader election health check, will listen (example: `:8080`). The default is empty string, which means the server is disabled.")
70+
cmd.PersistentFlags().StringVar(&httpEndpoint, "http-endpoint", "", "The TCP network address where the HTTP server for providing metrics for diagnostics, will listen (example: `:8080`). The default is empty string, which means the server is disabled.")
71+
72+
cmd.PersistentFlags().BoolVar(&provideControllerService, "provide-controller-service", true, "If set to true then the CSI driver does provide the controller service (default: true)")
73+
cmd.PersistentFlags().BoolVar(&provideNodeService, "provide-node-service", true, "If set to true then the CSI driver does provide the node service (default: true)")
74+
cmd.PersistentFlags().BoolVar(&noClient, "node-service-no-os-client", false, "If set to true then the CSI driver node service will not use the OpenStack client (default: false)")
75+
6876
openstack.AddExtraFlags(pflag.CommandLine)
6977

7078
code := cli.Run(cmd)
@@ -73,19 +81,35 @@ func main() {
7381

7482
func handle() {
7583
// Initialize cloud
76-
d := cinder.NewDriver(endpoint, cluster)
84+
d := cinder.NewDriver(&cinder.DriverOpts{Endpoint: endpoint, ClusterID: cluster})
85+
7786
openstack.InitOpenStackProvider(cloudConfig, httpEndpoint)
78-
cloud, err := openstack.GetOpenStackProvider()
79-
if err != nil {
80-
klog.Warningf("Failed to GetOpenStackProvider: %v", err)
81-
return
87+
88+
if provideControllerService {
89+
cloud, err := openstack.GetOpenStackProvider(false)
90+
if err != nil {
91+
klog.Warningf("Failed to GetOpenStackProvider: %v", err)
92+
return
93+
}
94+
95+
d.SetupControllerService(cloud)
8296
}
83-
//Initialize mount
84-
mount := mount.GetMountProvider()
8597

86-
//Initialize Metadata
87-
metadata := metadata.GetMetadataProvider(cloud.GetMetadataOpts().SearchOrder)
98+
if provideNodeService {
99+
cloud, err := openstack.GetOpenStackProvider(noClient)
100+
if err != nil {
101+
klog.Warningf("Failed to GetOpenStackProvider: %v", err)
102+
return
103+
}
104+
105+
//Initialize mount
106+
mount := mount.GetMountProvider()
107+
108+
//Initialize Metadata
109+
metadata := metadata.GetMetadataProvider(cloud.GetMetadataOpts().SearchOrder)
110+
111+
d.SetupNodeService(cloud, mount, metadata)
112+
}
88113

89-
d.SetupDriver(cloud, mount, metadata)
90114
d.Run()
91115
}

cmd/manila-csi-plugin/main.go

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,11 @@ var (
4545
clusterID string
4646

4747
// Runtime options
48-
endpoint string
49-
runtimeConfigFile string
50-
userAgentData []string
48+
endpoint string
49+
runtimeConfigFile string
50+
userAgentData []string
51+
provideControllerService bool
52+
provideNodeService bool
5153
)
5254

5355
func validateShareProtocolSelector(v string) error {
@@ -69,29 +71,45 @@ func main() {
6971
Short: "CSI Manila driver",
7072
Run: func(cmd *cobra.Command, args []string) {
7173
if err := validateShareProtocolSelector(protoSelector); err != nil {
72-
klog.Fatalf(err.Error())
74+
klog.Fatal(err.Error())
7375
}
7476

7577
manilaClientBuilder := &manilaclient.ClientBuilder{UserAgent: "manila-csi-plugin", ExtraUserAgentData: userAgentData}
7678
csiClientBuilder := &csiclient.ClientBuilder{}
7779

78-
d, err := manila.NewDriver(
79-
&manila.DriverOpts{
80-
DriverName: driverName,
81-
NodeID: nodeID,
82-
NodeAZ: nodeAZ,
83-
WithTopology: withTopology,
84-
ShareProto: protoSelector,
85-
ServerCSIEndpoint: endpoint,
86-
FwdCSIEndpoint: fwdEndpoint,
87-
ManilaClientBuilder: manilaClientBuilder,
88-
CSIClientBuilder: csiClientBuilder,
89-
ClusterID: clusterID,
90-
},
91-
)
80+
opts := &manila.DriverOpts{
81+
DriverName: driverName,
82+
WithTopology: withTopology,
83+
ShareProto: protoSelector,
84+
ServerCSIEndpoint: endpoint,
85+
FwdCSIEndpoint: fwdEndpoint,
86+
ManilaClientBuilder: manilaClientBuilder,
87+
CSIClientBuilder: csiClientBuilder,
88+
ClusterID: clusterID,
89+
}
90+
91+
if provideNodeService {
92+
opts.NodeID = nodeID
93+
opts.NodeAZ = nodeAZ
94+
}
9295

96+
d, err := manila.NewDriver(opts)
9397
if err != nil {
94-
klog.Fatalf("driver initialization failed: %v", err)
98+
klog.Fatalf("Driver initialization failed: %v", err)
99+
}
100+
101+
if provideControllerService {
102+
err = d.SetupControllerService()
103+
if err != nil {
104+
klog.Fatalf("Driver controller service initialization failed: %v", err)
105+
}
106+
}
107+
108+
if provideNodeService {
109+
err = d.SetupNodeService()
110+
if err != nil {
111+
klog.Fatalf("Driver node service initialization failed: %v", err)
112+
}
95113
}
96114

97115
runtimeconfig.RuntimeConfigFilename = runtimeConfigFile
@@ -105,10 +123,7 @@ func main() {
105123

106124
cmd.PersistentFlags().StringVar(&driverName, "drivername", "manila.csi.openstack.org", "name of the driver")
107125

108-
cmd.PersistentFlags().StringVar(&nodeID, "nodeid", "", "this node's ID")
109-
if err := cmd.MarkPersistentFlagRequired("nodeid"); err != nil {
110-
klog.Fatalf("Unable to mark flag nodeid to be required: %v", err)
111-
}
126+
cmd.PersistentFlags().StringVar(&nodeID, "nodeid", "", "this node's ID. This value is required if the node service is provided by this CSI driver instance.")
112127

113128
cmd.PersistentFlags().StringVar(&nodeAZ, "nodeaz", "", "this node's availability zone")
114129

@@ -132,6 +147,9 @@ func main() {
132147

133148
cmd.PersistentFlags().StringVar(&clusterID, "cluster-id", "", "The identifier of the cluster that the plugin is running in.")
134149

150+
cmd.PersistentFlags().BoolVar(&provideControllerService, "provide-controller-service", true, "If set to true then the CSI driver does provide the controller service (default: true)")
151+
cmd.PersistentFlags().BoolVar(&provideNodeService, "provide-node-service", true, "If set to true then the CSI driver does provide the node service (default: true)")
152+
135153
code := cli.Run(cmd)
136154
os.Exit(code)
137155
}

docs/cinder-csi-plugin/using-cinder-csi-plugin.md

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,36 @@ In addition to the standard set of klog flags, `cinder-csi-plugin` accepts the f
8888

8989
This will be added as metadata to every Cinder volume created by this plugin.
9090
</dd>
91+
92+
<dt>--http-endpoint &lt;HTTP server&gt;</dt>
93+
<dd>
94+
This argument is optional.
95+
96+
The TCP network address where the HTTP server for providing metrics for diagnostics, will listen (example: `:8080`).
97+
98+
The default is empty string, which means the server is disabled.
99+
</dd>
100+
101+
<dt>--provide-controller-service &lt;enabled&gt;</dt>
102+
<dd>
103+
If set to true then the CSI driver does provide the controller service.
104+
105+
The default is to provide the controller service.
106+
</dd>
107+
108+
<dt>--provide-node-service &lt;enabled&gt;</dt>
109+
<dd>
110+
If set to true then the CSI driver does provide the node service.
111+
112+
The default is to provide the node service.
113+
</dd>
114+
115+
<dt>--node-service-no-os-client &lt;disabled&gt;</dt>
116+
<dd>
117+
If set to true then the CSI driver does not provide the OpenStack client in the node service.
118+
119+
The default is to provide the OpenStack client in the node service.
120+
</dd>
91121
</dl>
92122

93123
## Driver Config
@@ -104,7 +134,7 @@ Implementation of `cinder-csi-plugin` relies on following OpenStack services.
104134
For Driver configuration, parameters must be passed via configuration file specified in `$CLOUD_CONFIG` environment variable.
105135
The following sections are supported in configuration file.
106136

107-
### Global
137+
### Global
108138
For Cinder CSI Plugin to authenticate with OpenStack Keystone, required parameters needs to be passed in `[Global]` section of the file. For all supported parameters, please refer [Global](../openstack-cloud-controller-manager/using-openstack-cloud-controller-manager.md#global) section.
109139

110140
### Block Storage
@@ -186,7 +216,7 @@ cinder.csi.openstack.org true true false <
186216
mountPath: /etc/cacert
187217
readOnly: true
188218
189-
volumes:
219+
volumes:
190220
....
191221
- name: cacert
192222
hostPath:
@@ -244,7 +274,7 @@ helm install --namespace kube-system --name cinder-csi ./charts/cinder-csi-plugi
244274
| StorageClass `parameters` | `availability` | `nova` | String. Volume Availability Zone |
245275
| StorageClass `parameters` | `type` | Empty String | String. Name/ID of Volume type. Corresponding volume type should exist in cinder |
246276
| VolumeSnapshotClass `parameters` | `force-create` | `false` | Enable to support creating snapshot for a volume in in-use status |
247-
| Inline Volume `volumeAttributes` | `capacity` | `1Gi` | volume size for creating inline volumes|
277+
| Inline Volume `volumeAttributes` | `capacity` | `1Gi` | volume size for creating inline volumes|
248278
| Inline Volume `VolumeAttributes` | `type` | Empty String | Name/ID of Volume type. Corresponding volume type should exist in cinder |
249279

250280
## Local Development
@@ -256,14 +286,14 @@ To build the plugin, run
256286
```
257287
$ export ARCH=amd64 # Defaults to amd64
258288
$ make build-cmd-cinder-csi-plugin
259-
```
289+
```
260290

261291
To build cinder-csi-plugin image
262292

263293
```
264294
$ export ARCH=amd64 # Defaults to amd64
265-
$ make image-cinder-csi-plugin
266-
```
295+
$ make build-local-image-cinder-csi-plugin
296+
```
267297

268298
### Testing
269299

@@ -274,7 +304,7 @@ To run all unit tests:
274304
$ make test
275305
```
276306
#### Sanity Tests
277-
Sanity tests ensures the CSI spec conformance of the driver. For more info, refer [Sanity check](https://github.com/kubernetes-csi/csi-test/tree/master/pkg/sanity)
307+
Sanity tests ensures the CSI spec conformance of the driver. For more info, refer [Sanity check](https://github.com/kubernetes-csi/csi-test/tree/master/pkg/sanity)
278308

279309
Run sanity tests for cinder CSI driver using:
280310

@@ -288,5 +318,5 @@ Optionally, to test the driver csc tool could be used. please refer, [usage guid
288318

289319
Starting from Kubernetes 1.21, OpenStack Cinder CSI migration is supported as beta feature and is `ON` by default. Cinder CSI driver must be installed on clusters on OpenStack for Cinder volumes to work. If you have persistence volumes that are created with in-tree `kubernetes.io/cinder` plugin, you could migrate to use `cinder.csi.openstack.org` Container Storage Interface (CSI) Driver.
290320

291-
* The CSI Migration feature for Cinder, when enabled, shims all plugin operations from the existing in-tree plugin to the `cinder.csi.openstack.org` CSI Driver.
321+
* The CSI Migration feature for Cinder, when enabled, shims all plugin operations from the existing in-tree plugin to the `cinder.csi.openstack.org` CSI Driver.
292322
* For more info, please refer [Migrate to CCM with CSI Migration](../openstack-cloud-controller-manager/migrate-to-ccm-with-csimigration.md#migrate-from-in-tree-cloud-provider-to-openstack-cloud-controller-manager-and-enable-csimigration) guide

0 commit comments

Comments
 (0)