Skip to content

Commit a95563b

Browse files
YashwantGohokarvbhargav875anchaubemrunalpagnisAkarshES
authored
Oke oss release 1.25.0 (#416)
* JIRA:task/OKE-22216 Add mount option support to FSS CSI driver * Make lb flex shape value formats consistent for all lb shape related annotations * cherrypick 2d9a7ba * Rebase with latest code from 1.24 * Removed MockMounter as it has been replace by FakeMounter * Fixed incorrect commit introduce during merge * JIRA: OKE-17462 Add dynamic provisioning support for FSS in CSI commit aa4d9710adccbf12b83a922c0a30a973a8b36a49 Author: Vijay Bhargav Eshappa <vijay.bhargav.eshappa@oracle.com> Date: Sat Aug 27 16:11:33 2022 +0530 Add provisioner for FSS dynamic provisioning commit 067b4352b395a9b94df13cdb3d66b2fb6bc4cc8d Author: mpagnis <mrunal.pagnis@oracle.com> Date: Fri Aug 19 17:06:27 2022 +0530 JIRA: OKE-22216 Add mount option support to FSS CSI driver. Add e2e commit 1cb90812ae03e783afaf02cafaa93ebdd2b75f4e Author: mpagnis <mrunal.pagnis@oracle.com> Date: Fri Aug 19 16:34:44 2022 +0530 JIRA: OKE-22216 Add mount option support to FSS CSI driver 1.24 provisioner changes * OKE-24022 : Enable publishing CSI metrics in 1.22 - 1.24 clusters * task/OKE-22696 Improve logging with storage plugins code * OKE-20995 : Return suitable error message when volumeMode is set to block * OKE-23391 - Immediate Volume Binding mode is not working as expected in kubernetes 1.25 * Update Kubernetes dependencies to v1.25.4 * cherrypick "check if there are in-progress work requests for lb & nlb and send service to exponential backoff if present * OKE-24203: Emit new metrics CTX_TIMEOUT when AwaitWorkRequest context times out OKE-24203: Treat context deadline exceeded as retryable error Unit Tests for LB & NLB AwaitWorkRequest * JIRA: OKE-24691 CSI driver PV attachment regex bug fix * fixed go.mod and cherrypick errors * fixed go.mod -2 * fixed go.mod -3 * fixed go.mod -4 * made changes to release workflow * made changes to release workflow * changed manifests for testing * Changed image to 1.25.0, removed commented code and reverted release workflow. * Changed image tag to latest * Changed image tag to latest 2 * Added CSIDriver for bv with fsGroupPolicy: File --------- Co-authored-by: Vijay Bhargav Eshappa <vijay.bhargav.eshappa@oracle.com> Co-authored-by: Anish <anish.chaube@oracle.com> Co-authored-by: mpagnis <mrunal.pagnis@oracle.com> Co-authored-by: Akarsh Ellore Sreenath <akarsh.ellore.sreenath@oracle.com> Co-authored-by: Pranav Sriram <pranav.sriram@oracle.com> Co-authored-by: l-technicore <lalit.s.singh@oracle.com>
1 parent e371c85 commit a95563b

File tree

3,469 files changed

+156429
-95808
lines changed

Some content is hidden

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

3,469 files changed

+156429
-95808
lines changed

.github/workflows/makefile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Set up Go 1.x
1313
uses: actions/setup-go@v2
1414
with:
15-
go-version: 1.18
15+
go-version: 1.19
1616
id: go
1717

1818
- name: Check out code into the Go module directory

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ COPY --from=0 /go/src/github.com/oracle/oci-cloud-controller-manager/image/* /us
3434

3535
RUN yum install -y util-linux \
3636
&& yum install -y e2fsprogs \
37+
&& yum install -y xfsprogs \
3738
&& yum clean all
3839

3940
COPY --from=0 /go/src/github.com/oracle/oci-cloud-controller-manager/dist/* /usr/local/bin/

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ else
3838
VERSION ?= ${VERSION}
3939
endif
4040

41-
RELEASE = v1.24.0
41+
RELEASE = v1.25.0
4242

4343
GOOS ?= linux
4444
ARCH ?= amd64

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.24
1+
1.25

cmd/oci-csi-controller-driver/csi-controller-driver/oci-csi-controller-driver.go

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,32 @@ import (
2121
"go.uber.org/zap"
2222
)
2323

24+
const (
25+
bvCsiDriver = "BV"
26+
)
27+
2428
//StartControllerDriver main function to start CSI Controller Driver
25-
func StartControllerDriver(csioptions csioptions.CSIOptions) {
29+
func StartControllerDriver(csioptions csioptions.CSIOptions, csiDriver driver.CSIDriver) {
2630

2731
logger := logging.Logger().Sugar()
2832
logger.Sync()
2933

30-
drv, err := driver.NewControllerDriver(logger.Named("BV").With(zap.String("component", "csi-controller")), csioptions.Endpoint, csioptions.Kubeconfig, csioptions.Master,
31-
true, driver.BlockVolumeDriverName, driver.BlockVolumeDriverVersion)
34+
logger = logger.Named(string(csiDriver)).With(zap.String("component", "csi-controller"))
35+
var drv *driver.Driver
36+
var err error
37+
38+
if csiDriver == bvCsiDriver {
39+
controllerDriverConfig := &driver.ControllerDriverConfig{CsiEndpoint: csioptions.Endpoint, CsiKubeConfig: csioptions.Kubeconfig, CsiMaster: csioptions.Master, EnableControllerServer: true, DriverName: driver.BlockVolumeDriverName, DriverVersion: driver.BlockVolumeDriverVersion}
40+
drv, err = driver.NewControllerDriver(logger, *controllerDriverConfig)
41+
} else {
42+
controllerDriverConfig := &driver.ControllerDriverConfig{CsiEndpoint: csioptions.FssEndpoint, CsiKubeConfig: csioptions.Kubeconfig, CsiMaster: csioptions.Master, EnableControllerServer: true, DriverName: driver.FSSDriverName, DriverVersion: driver.FSSDriverVersion}
43+
drv, err = driver.NewControllerDriver(logger, *controllerDriverConfig)
44+
}
3245
if err != nil {
33-
logger.With(zap.Error(err)).Fatal("Failed to create controller driver.")
46+
logger.With(zap.Error(err)).Fatal("Failed to create %s controller driver.", csiDriver)
3447
}
35-
3648
if err := drv.Run(); err != nil {
37-
logger.With(zap.Error(err)).Fatal("Failed to run the CSI driver.")
49+
logger.With(zap.Error(err)).Fatal("Failed to run the CSI driver for %s.", csiDriver)
3850
}
3951

4052
logger.Info("CSI driver exited")

cmd/oci-csi-controller-driver/csioptions/csioptions.go

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,27 @@ package csioptions
1616

1717
import (
1818
"flag"
19+
"strings"
1920
"time"
21+
22+
"go.uber.org/zap"
23+
)
24+
25+
const (
26+
fssAddressSuffix = "-fss.sock"
27+
fssVolumeNameAppendedPrefix = "-fss"
2028
)
2129

22-
//CSIOptions structure which contains flag values
30+
// CSIOptions structure which contains flag values
2331
type CSIOptions struct {
2432
Master string
2533
Kubeconfig string
2634
CsiAddress string
2735
Endpoint string
36+
FssCsiAddress string
37+
FssEndpoint string
2838
VolumeNamePrefix string
39+
FssVolumeNamePrefix string
2940
VolumeNameUUIDLength int
3041
ShowVersion bool
3142
RetryIntervalStart time.Duration
@@ -47,14 +58,17 @@ type CSIOptions struct {
4758
EnableResizer bool
4859
}
4960

50-
//NewCSIOptions initializes the flag
61+
// NewCSIOptions initializes the flag
5162
func NewCSIOptions() *CSIOptions {
5263
csioptions := CSIOptions{
5364
Master: *flag.String("master", "", "kube master"),
5465
Kubeconfig: *flag.String("kubeconfig", "", "cluster kube config"),
55-
CsiAddress: *flag.String("csi-address", "/run/csi/socket", "Address of the CSI driver socket."),
56-
Endpoint: *flag.String("csi-endpoint", "unix://tmp/csi.sock", "CSI endpoint"),
66+
CsiAddress: *flag.String("csi-address", "/run/csi/socket", "Address of the CSI BV driver socket."),
67+
Endpoint: *flag.String("csi-endpoint", "unix://tmp/csi.sock", "CSI BV endpoint"),
68+
FssCsiAddress: *flag.String("fss-csi-address", "/run/fss/socket", "Address of the CSI FSS driver socket."),
69+
FssEndpoint: *flag.String("fss-csi-endpoint", "unix://tmp/csi-fss.sock", "CSI FSS endpoint"),
5770
VolumeNamePrefix: *flag.String("csi-volume-name-prefix", "pvc", "Prefix to apply to the name of a created volume."),
71+
FssVolumeNamePrefix: *flag.String("fss-csi-volume-name-prefix", "pvc", "Prefix to apply to the name of a volume created for FSS."),
5872
VolumeNameUUIDLength: *flag.Int("csi-volume-name-uuid-length", -1, "Truncates generated UUID of a created volume to this length. Defaults behavior is to NOT truncate."),
5973
ShowVersion: *flag.Bool("csi-version", false, "Show version."),
6074
RetryIntervalStart: *flag.Duration("csi-retry-interval-start", time.Second, "Initial retry interval of failed provisioning or deletion. It doubles with each failure, up to retry-interval-max."),
@@ -76,3 +90,20 @@ func NewCSIOptions() *CSIOptions {
7690
}
7791
return &csioptions
7892
}
93+
94+
// GetFssAddress returns the fssAddress based on csiAddress
95+
func GetFssAddress(csiAddress, defaultAddress string) string {
96+
logger := zap.L().Sugar()
97+
address := strings.Split(csiAddress, ".sock")
98+
if len(address) != 2 || !strings.HasSuffix(csiAddress, ".sock") {
99+
logger.Errorf("failed to parse csi-address : %s. Defaulting to : %s", csiAddress, defaultAddress)
100+
return defaultAddress
101+
}
102+
fssAddress := address[0] + fssAddressSuffix
103+
return fssAddress
104+
}
105+
106+
// GetFssVolumeNamePrefix returns the fssVolumeNamePrefix based on csiVolumeNamePrefix
107+
func GetFssVolumeNamePrefix(csiVolumeNamePrefix string) string {
108+
return csiVolumeNamePrefix + fssVolumeNameAppendedPrefix
109+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
package csioptions
2+
3+
import (
4+
"testing"
5+
)
6+
7+
func Test_GetFssAddress(t *testing.T) {
8+
testCases := map[string]struct {
9+
csiAddress string
10+
expectedFssAddress string
11+
defaultAddress string
12+
}{
13+
"Valid csi address": {
14+
csiAddress: "/var/run/shared-tmpfs/csi.sock",
15+
expectedFssAddress: "/var/run/shared-tmpfs/csi-fss.sock",
16+
defaultAddress: "/var/run/shared-tmpfs/csi-fss.sock",
17+
},
18+
"Invalid csi address": {
19+
csiAddress: "/var/run/shared-tmpfs/csi.sock.sock",
20+
expectedFssAddress: "/var/run/shared-tmpfs/csi-fss.sock",
21+
defaultAddress: "/var/run/shared-tmpfs/csi-fss.sock",
22+
},
23+
"Valid csi endpoint": {
24+
csiAddress: "unix:///var/run/shared-tmpfs/csi.sock",
25+
expectedFssAddress: "unix:///var/run/shared-tmpfs/csi-fss.sock",
26+
defaultAddress: "unix:///var/run/shared-tmpfs/csi-fss.sock",
27+
},
28+
"Invalid csi endpoint": {
29+
csiAddress: "unix:///var/run/shared-tmpfs/csi-fss.sock.sock",
30+
expectedFssAddress: "unix:///var/run/shared-tmpfs/csi-fss.sock",
31+
defaultAddress: "unix:///var/run/shared-tmpfs/csi-fss.sock",
32+
},
33+
}
34+
for name, tc := range testCases {
35+
t.Run(name, func(t *testing.T) {
36+
fssAddress := GetFssAddress(tc.csiAddress, tc.defaultAddress)
37+
if tc.expectedFssAddress != fssAddress {
38+
t.Errorf("Expected \n%+v\n but got \n%+v", tc.expectedFssAddress, fssAddress)
39+
}
40+
})
41+
}
42+
}
43+
44+
func Test_GetFssVolumeNamePrefix(t *testing.T) {
45+
testCases := map[string]struct {
46+
csiPrefix string
47+
expectedPrefix string
48+
}{
49+
"Valid csi address": {
50+
csiPrefix: "csi",
51+
expectedPrefix: "csi-fss",
52+
},
53+
}
54+
for name, tc := range testCases {
55+
t.Run(name, func(t *testing.T) {
56+
fssVolumeNamePrefix := GetFssVolumeNamePrefix(tc.csiPrefix)
57+
if tc.expectedPrefix != fssVolumeNamePrefix {
58+
t.Errorf("Expected \n%+v\n but got \n%+v", tc.expectedPrefix, fssVolumeNamePrefix)
59+
}
60+
})
61+
}
62+
}

cmd/oci-csi-controller-driver/main.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,23 @@ package main
1616

1717
import (
1818
"flag"
19+
"time"
20+
1921
csicontrollerdriver "github.com/oracle/oci-cloud-controller-manager/cmd/oci-csi-controller-driver/csi-controller-driver"
2022
"github.com/oracle/oci-cloud-controller-manager/cmd/oci-csi-controller-driver/csioptions"
23+
"github.com/oracle/oci-cloud-controller-manager/pkg/csi/driver"
2124
"github.com/oracle/oci-cloud-controller-manager/pkg/logging"
2225
"github.com/oracle/oci-cloud-controller-manager/pkg/util/signals"
2326
"go.uber.org/zap"
2427
"k8s.io/apimachinery/pkg/util/wait"
2528
"k8s.io/client-go/kubernetes"
2629
"k8s.io/client-go/tools/clientcmd"
27-
"time"
2830
)
2931

3032
func main() {
3133
csiOptions := csioptions.CSIOptions{}
3234
flag.StringVar(&csiOptions.Endpoint, "endpoint", "unix://tmp/csi.sock", "CSI endpoint")
35+
flag.StringVar(&csiOptions.FssEndpoint, "fss-csi-endpoint", "unix://tmp/csi-fss.sock", "CSI FSS endpoint")
3336
flag.StringVar(&csiOptions.Master, "master", "", "kube master")
3437
flag.StringVar(&csiOptions.Kubeconfig, "kubeconfig", "", "cluster kubeconfig")
3538
flag.Parse()
@@ -51,6 +54,7 @@ func main() {
5154
return
5255
}
5356
logger.With("endpoint", csiOptions.Endpoint).Infof("Starting controller driver go routine.")
54-
go csicontrollerdriver.StartControllerDriver(csiOptions)
57+
go csicontrollerdriver.StartControllerDriver(csiOptions, driver.BV)
58+
go csicontrollerdriver.StartControllerDriver(csiOptions, driver.FSS)
5559
<-stopCh
5660
}

0 commit comments

Comments
 (0)