Skip to content

Commit 9ac168a

Browse files
Merge pull request #413 from rajashekhargundeti/oke-oss-release_1.24.1
Oke oss release 1.24.1
2 parents e371c85 + 9e7e28b commit 9ac168a

File tree

2,545 files changed

+128352
-68725
lines changed

Some content is hidden

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

2,545 files changed

+128352
-68725
lines changed

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.24.1
4242

4343
GOOS ?= linux
4444
ARCH ?= amd64

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
}

go.mod

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ require (
4141
github.com/kubernetes-csi/csi-lib-utils v0.11.0
4242
github.com/onsi/ginkgo v1.16.5
4343
github.com/onsi/gomega v1.17.0
44-
github.com/oracle/oci-go-sdk/v50 v50.1.0
4544
github.com/pkg/errors v0.9.1
4645
github.com/prometheus/client_golang v1.12.1
4746
github.com/spf13/cobra v1.4.0 // indirect
@@ -69,6 +68,8 @@ require (
6968
sigs.k8s.io/sig-storage-lib-external-provisioner/v8 v8.0.0
7069
)
7170

71+
require github.com/oracle/oci-go-sdk/v65 v65.22.0
72+
7273
require (
7374
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
7475
github.com/NYTimes/gziphandler v1.1.1 // indirect
@@ -89,6 +90,7 @@ require (
8990
github.com/go-openapi/jsonpointer v0.19.5 // indirect
9091
github.com/go-openapi/jsonreference v0.19.6 // indirect
9192
github.com/go-openapi/swag v0.21.1 // indirect
93+
github.com/gofrs/flock v0.8.1 // indirect
9294
github.com/gogo/protobuf v1.3.2 // indirect
9395
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
9496
github.com/google/gnostic v0.6.8 // indirect
@@ -119,7 +121,7 @@ require (
119121
github.com/prometheus/client_model v0.2.0 // indirect
120122
github.com/prometheus/common v0.33.0 // indirect
121123
github.com/prometheus/procfs v0.7.3 // indirect
122-
github.com/sony/gobreaker v0.4.2-0.20210216022020-dd874f9dd33b // indirect
124+
github.com/sony/gobreaker v0.5.0 // indirect
123125
github.com/spf13/afero v1.6.0 // indirect
124126
github.com/spf13/cast v1.3.1 // indirect
125127
github.com/spf13/jwalterweatherman v1.1.0 // indirect

go.sum

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg78
232232
github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
233233
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
234234
github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
235+
github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw=
236+
github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
235237
github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
236238
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
237239
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
@@ -502,8 +504,8 @@ github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.m
502504
github.com/opencontainers/selinux v1.10.0 h1:rAiKF8hTcgLI3w0DHm6i0ylVVcOrlgR1kK99DRLDhyU=
503505
github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI=
504506
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
505-
github.com/oracle/oci-go-sdk/v50 v50.1.0 h1:6WyLNxEmnUuc1fYYVTuIeH2iQiGVdwlE//qSuYF7bK4=
506-
github.com/oracle/oci-go-sdk/v50 v50.1.0/go.mod h1:5tboHcoGIrAUerGgH3Sdc6eJdhw5YyywE78g99hzHpw=
507+
github.com/oracle/oci-go-sdk/v65 v65.22.0 h1:lCv8gxFOVI8sG0vCjxZ8CuXy3QOUM+JspcAdzsPkjcs=
508+
github.com/oracle/oci-go-sdk/v65 v65.22.0/go.mod h1:oyMrMa1vOzzKTmPN+kqrTR9y9kPA2tU1igN3NUSNTIE=
507509
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
508510
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
509511
github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ=
@@ -561,8 +563,8 @@ github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9
561563
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
562564
github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js=
563565
github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0=
564-
github.com/sony/gobreaker v0.4.2-0.20210216022020-dd874f9dd33b h1:br+bPNZsJWKicw/5rALEo67QHs5weyD5tf8WST+4sJ0=
565-
github.com/sony/gobreaker v0.4.2-0.20210216022020-dd874f9dd33b/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY=
566+
github.com/sony/gobreaker v0.5.0 h1:dRCvqm0P490vZPmy7ppEk2qCnCieBooFJ+YoXGYB+yg=
567+
github.com/sony/gobreaker v0.5.0/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY=
566568
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
567569
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
568570
github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY=

hack/existing-standalone-cluster-env-template.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ export NSG_OCIDS=""
5858
# https://docs.oracle.com/en-us/iaas/Content/File/Tasks/securitylistsfilestorage.htm
5959
# Mandatory
6060
export FSS_VOLUME_HANDLE=""
61+
export MNT_TARGET_ID=""
62+
export MNT_TARGET_SUBNET_ID=""
63+
export MNT_TARGET_COMPARTMENT_ID=""
6164

6265
# For debugging the tests in existing cluster, do not turn it off by default.
6366
# Optional

hack/run_e2e_test.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ check-env "CLOUD_CONFIG" $CLOUD_CONFIG
2626
check-env "ADLOCATION" $ADLOCATION
2727
check-env "NSG_OCIDS" $NSG_OCIDS
2828
check-env "FSS_VOLUME_HANDLE" $FSS_VOLUME_HANDLE
29+
check-env "MNT_TARGET_ID" $MNT_TARGET_ID
30+
check-env "MNT_TARGET_SUBNET_ID" $MNT_TARGET_SUBNET_ID
31+
check-env "MNT_TARGET_COMPARTMENT_ID" $MNT_TARGET_COMPARTMENT_ID
2932

3033
function set_image_pull_repo_and_delete_namespace_flag () {
3134
if [ -z "$IMAGE_PULL_REPO" ]; then
@@ -44,6 +47,9 @@ function run_e2e_tests_existing_cluster() {
4447
--delete-namespace=${DELETE_NAMESPACE} \
4548
--image-pull-repo=${IMAGE_PULL_REPO} \
4649
--cmek-kms-key=${CMEK_KMS_KEY} \
50+
--mnt-target-id=${MNT_TARGET_ID} \
51+
--mnt-target-subnet-id=${MNT_TARGET_SUBNET_ID} \
52+
--mnt-target-compartment-id=${MNT_TARGET_COMPARTMENT_ID} \
4753
--nsg-ocids=${NSG_OCIDS} \
4854
--reserved-ip=${RESERVED_IP} \
4955
--architecture=${ARCHITECTURE} \
@@ -85,6 +91,9 @@ function set_focus () {
8591

8692
echo "CLUSTER_KUBECONFIG is ${CLUSTER_KUBECONFIG}"
8793
echo "CLOUD_CONFIG is ${CLOUD_CONFIG}"
94+
echo "MNT_TARGET_ID is ${MNT_TARGET_ID}"
95+
echo "MNT_TARGET_SUBNET_ID is ${MNT_TARGET_SUBNET_ID}"
96+
echo "MNT_TARGET_COMPARTMENT_ID is ${MNT_TARGET_COMPARTMENT_ID}"
8897

8998
function run_tests () {
9099
set_image_pull_repo_and_delete_namespace_flag

0 commit comments

Comments
 (0)