Skip to content

Commit 3125d72

Browse files
l-technicoreAkarshESmrunalpagnisYashasG98pranavsriram8
authored
NLB and Block Volume Performance Levels support release to Open Source from release-1.19 branch (#379)
* Add support for NLB lifecycle management in CCM * JIRA: OKE-16175 - Add support for Block Volume Performance Levels with CSI * JIRA: OKE-20067 Bug fix: CSI Expand Volume - PV PVC sync error for requested volume size less than or equal to old size * task/OKE-16737 Made change to not remove nodes from LB backend set if all nodes are not ready * JIRA: OKE-20459 - CSI node driver should work even if vpusPerGB is not set * Open Source Release from branch release-1.19 (nlb, oci-sdk v50) Co-authored-by: Akarsh Ellore Sreenath <[email protected]> Co-authored-by: mpagnis <[email protected]> Co-authored-by: yashg <[email protected]> Co-authored-by: Pranav Sriram <[email protected]>
1 parent 4a90066 commit 3125d72

File tree

1,542 files changed

+48014
-9444
lines changed

Some content is hidden

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

1,542 files changed

+48014
-9444
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ import (
2222
)
2323

2424
//StartControllerDriver main function to start CSI Controller Driver
25-
func StartControllerDriver(csiOptions csioptions.CSIOptions) {
25+
func StartControllerDriver(csioptions csioptions.CSIOptions) {
2626

2727
logger := logging.Logger().Sugar()
2828
logger.Sync()
2929

30-
drv, err := driver.NewControllerDriver(logger.Named("BV"), csiOptions.Endpoint, csiOptions.Kubeconfig, csiOptions.Master,
30+
drv, err := driver.NewControllerDriver(logger.Named("BV").With(zap.String("component", "csi-controller")), csioptions.Endpoint, csioptions.Kubeconfig, csioptions.Master,
3131
true, driver.BlockVolumeDriverName, driver.BlockVolumeDriverVersion)
3232
if err != nil {
3333
logger.With(zap.Error(err)).Fatal("Failed to create controller driver.")

cmd/oci-flexvolume-driver/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ func main() {
4747
"pid", os.Getpid(),
4848
"version", version,
4949
"build", build,
50+
"component", "flexvolume-driver",
5051
)
5152
logger.Debug("OCI Flexvolume driver")
5253
d, err := block.NewOCIFlexvolumeDriver(logger)

cmd/oci-volume-provisioner/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func main() {
4343

4444
logger := log.Sugar()
4545

46-
logger.With("version", version, "build", build).Info("oci-volume-provisioner")
46+
logger.With("version", version, "build", build, "component", "volume-provisioner").Info("oci-volume-provisioner")
4747

4848
// Set up signals so we handle the shutdown signal gracefully.
4949
stopCh := signals.SetupSignalHandler()

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ require (
4040
github.com/kubernetes-csi/csi-lib-utils v0.8.1
4141
github.com/onsi/ginkgo v1.14.1
4242
github.com/onsi/gomega v1.10.2
43-
github.com/oracle/oci-go-sdk/v31 v31.0.0
43+
github.com/oracle/oci-go-sdk/v50 v50.1.0
4444
github.com/pkg/errors v0.9.1
4545
github.com/prometheus/client_golang v1.9.0
4646
github.com/spf13/pflag v1.0.5

go.sum

+6
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,10 @@ github.com/opencontainers/selinux v1.5.1/go.mod h1:yTcKuYAh6R95iDpefGLQaPaRwJFwy
471471
github.com/opencontainers/selinux v1.5.2/go.mod h1:yTcKuYAh6R95iDpefGLQaPaRwJFwyzAJufJyiTt7s0g=
472472
github.com/oracle/oci-go-sdk/v31 v31.0.0 h1:LEstCAlSNcuuPIRUMLuX3UF+V3ID2B1LN4k9Dvbd5tM=
473473
github.com/oracle/oci-go-sdk/v31 v31.0.0/go.mod h1:4MlbGGDlqigjplvUfbVecEqNCN2cYZbdJ8PpAMVAQkw=
474+
github.com/oracle/oci-go-sdk/v49 v49.2.0 h1:l4PUk81EKdTDD4mDg5wrELpdWFqYeE9KYejfNgtsyUI=
475+
github.com/oracle/oci-go-sdk/v49 v49.2.0/go.mod h1:E8q2DXmXnSozLdXHUFF+o3L2gzcWbiFIPFYOYWdqOfc=
476+
github.com/oracle/oci-go-sdk/v50 v50.1.0 h1:6WyLNxEmnUuc1fYYVTuIeH2iQiGVdwlE//qSuYF7bK4=
477+
github.com/oracle/oci-go-sdk/v50 v50.1.0/go.mod h1:5tboHcoGIrAUerGgH3Sdc6eJdhw5YyywE78g99hzHpw=
474478
github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g=
475479
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
476480
github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=
@@ -520,6 +524,8 @@ github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIK
520524
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
521525
github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E=
522526
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
527+
github.com/sony/gobreaker v0.4.2-0.20210216022020-dd874f9dd33b h1:br+bPNZsJWKicw/5rALEo67QHs5weyD5tf8WST+4sJ0=
528+
github.com/sony/gobreaker v0.4.2-0.20210216022020-dd874f9dd33b/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY=
523529
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
524530
github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc=
525531
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=

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

+21-4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@
1616
# The test suites to run (can replace or add tags)
1717
export FOCUS="\[cloudprovider\]"
1818

19+
# Scope can be ARM / AMD / BOTH
20+
# Mandatory
21+
export SCOPE="BOTH"
22+
23+
# A Reserved IP in your compartment for testing LB creation with Reserved IP
24+
# Create a public reserved IP in your compartment using the following link:
25+
# https://docs.oracle.com/en-us/iaas/Content/Network/Tasks/managingpublicIPs.htm#console-reserved
26+
# Set the public reserved IP in the following env-variable:
27+
# Mandatory
28+
export RESERVED_IP=""
29+
1930
# Set path to kubeconfig of existing cluster if it does not exist in default path. Defaults to $HOME/.kube/config.
2031
# Mandatory
2132
export CLUSTER_KUBECONFIG=$HOME/.kube/config
@@ -39,13 +50,19 @@ export CMEK_KMS_KEY=""
3950
# Mandatory
4051
export NSG_OCIDS=""
4152

42-
# VOLUME HANDLE in the format filesystem_ocid:mountTargetIP:export_path
43-
# make sure volume handle is in the same subnet as your nodes
44-
export VOLUME_HANDLE=""
45-
# OPTIONAL
53+
# FSS VOLUME HANDLE in the format filesystem_ocid:mountTargetIP:export_path
54+
# Make sure fss volume handle is in the same subnet as your nodes
55+
# Create a file system, file export path and mount target in your VCN by following
56+
# https://docs.oracle.com/en-us/iaas/Content/File/Tasks/creatingfilesystems.htm#Using_the_Console
57+
# And setup your network for the file system by following:
58+
# https://docs.oracle.com/en-us/iaas/Content/File/Tasks/securitylistsfilestorage.htm
59+
# Mandatory
60+
export FSS_VOLUME_HANDLE=""
4661

4762
# For debugging the tests in existing cluster, do not turn it off by default.
63+
# Optional
4864
# export DELETE_NAMESPACE=false
4965

5066
# By default, public images are used. But if your Cluster's environment cannot access above public images then below option can be used to specify an accessible repo.
67+
# Optional
5168
# export IMAGE_PULL_REPO="accessiblerepo.com/repo/path/"

hack/run_e2e_test.sh

+93-34
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
function check-env {
17+
function check-env () {
1818
if [ -z "$2" ]; then
1919
echo "$1 must be defined"
2020
exit 1
@@ -27,11 +27,13 @@ check-env "ADLOCATION" $ADLOCATION
2727
check-env "NSG_OCIDS" $NSG_OCIDS
2828
check-env "VOLUME_HANDLE" $VOLUME_HANDLE
2929

30-
if [ -z "$IMAGE_PULL_REPO" ]; then
31-
IMAGE_PULL_REPO=""
32-
fi
30+
function set_image_pull_repo_and_delete_namespace_flag () {
31+
if [ -z "$IMAGE_PULL_REPO" ]; then
32+
IMAGE_PULL_REPO=""
33+
fi
3334

34-
DELETE_NAMESPACE=${DELETE_NAMESPACE:-"true"}
35+
DELETE_NAMESPACE=${DELETE_NAMESPACE:-"true"}
36+
}
3537

3638
function run_e2e_tests_existing_cluster() {
3739
ginkgo -v -progress --trace "${FOCUS_OPT}" "${FOCUS_FP_OPT}" \
@@ -44,42 +46,99 @@ function run_e2e_tests_existing_cluster() {
4446
--cmek-kms-key=${CMEK_KMS_KEY} \
4547
--nsg-ocids=${NSG_OCIDS} \
4648
--reserved-ip=${RESERVED_IP} \
47-
--volume-handle=${VOLUME_HANDLE} \
49+
--architecture=${ARCHITECTURE} \
50+
--volume-handle=${FSS_VOLUME_HANDLE}
4851
retval=$?
49-
exit $retval
52+
return $retval
5053
}
5154

52-
# The FOCUS environment variable can be set with a regex to tun selected tests
53-
# e.g. export FOCUS="\[cloudprovider\]"
54-
export FOCUS_OPT=""
55-
export FOCUS_FP_OPT=""
56-
if [ ! -z "${FOCUS}" ]; then
57-
# Because we tag our test descriptions with tags that are surrounded
58-
# by square brackets, we have to escape the brackets when we set the
59-
# FOCUS variable to match on a bracket rather than have it interpreted
60-
# as a regex character class. The check below looks to see if the FOCUS
61-
# has square brackets which aren't yet escaped and fixes them if needed.
62-
re1='^\[.+\]$' # [ccm]
63-
if [[ "${FOCUS}" =~ $re1 ]]; then
64-
echo -E "Escaping square brackes in ${FOCUS} to work as a regex match."
65-
FOCUS=$(echo $FOCUS|sed -e 's/\[/\\[/g' -e 's/\]/\\]/g')
66-
echo -E "Modified FOCUS value to: ${FOCUS}"
67-
fi
55+
function set_focus () {
56+
# The FOCUS environment variable can be set with a regex to tun selected tests
57+
# e.g. export FOCUS="\[cloudprovider\]"
58+
export FOCUS_OPT=""
59+
export FOCUS_FP_OPT=""
60+
if [ ! -z "${FOCUS}" ]; then
61+
# Because we tag our test descriptions with tags that are surrounded
62+
# by square brackets, we have to escape the brackets when we set the
63+
# FOCUS variable to match on a bracket rather than have it interpreted
64+
# as a regex character class. The check below looks to see if the FOCUS
65+
# has square brackets which aren't yet escaped and fixes them if needed.
66+
re1='^\[.+\]$' # [ccm]
67+
if [[ "${FOCUS}" =~ $re1 ]]; then
68+
echo -E "Escaping square brackes in ${FOCUS} to work as a regex match."
69+
FOCUS=$(echo $FOCUS|sed -e 's/\[/\\[/g' -e 's/\]/\\]/g')
70+
echo -E "Modified FOCUS value to: ${FOCUS}"
71+
fi
6872

69-
echo "Running focused tests: ${FOCUS}"
70-
FOCUS_OPT="-focus=${FOCUS}"
73+
echo "Running focused tests: ${FOCUS}"
74+
FOCUS_OPT="-focus=${FOCUS}"
7175

72-
# The FILES environment variable can be defined to interpret the regex as a
73-
# set of files.
74-
# e.g. export FILES="true"
75-
if [[ ! -z "${FILES}" && "${FILES}" == "true" ]]; then
76-
echo "Running focused test regex as filepath expression."
77-
FOCUS_FP_OPT="-regexScansFilePath=${FILES}"
76+
# The FILES environment variable can be defined to interpret the regex as a
77+
# set of files.
78+
# e.g. export FILES="true"
79+
if [[ ! -z "${FILES}" && "${FILES}" == "true" ]]; then
80+
echo "Running focused test regex as filepath expression."
81+
FOCUS_FP_OPT="-regexScansFilePath=${FILES}"
82+
fi
7883
fi
79-
fi
84+
}
8085

8186
echo "CLUSTER_KUBECONFIG is ${CLUSTER_KUBECONFIG}"
8287
echo "CLOUD_CONFIG is ${CLOUD_CONFIG}"
8388

84-
# run the ginko test framework for existing cluster
85-
run_e2e_tests_existing_cluster
89+
function run_tests () {
90+
set_image_pull_repo_and_delete_namespace_flag
91+
set_focus
92+
# run the ginko test framework for existing cluster
93+
# run ARM tests
94+
if [[ "$SCOPE" == "BOTH" || "$SCOPE" == "ARM" ]]; then
95+
run_e2e_tests_existing_cluster
96+
retval_arm=$?
97+
fi
98+
# run AMD tests
99+
if [[ "$SCOPE" == "BOTH" || "$SCOPE" == "AMD" ]]; then
100+
run_e2e_tests_existing_cluster
101+
retval_amd=$?
102+
fi
103+
104+
RED='\033[0;31m'
105+
NC='\033[0m' # No Color
106+
if [[ "$SCOPE" == "BOTH" ]]; then
107+
if [[ $retval_amd == 0 && $retval_arm == 0 ]]; then
108+
printf "ARM and AMD tests are Successful!"
109+
return $retval_amd
110+
fi
111+
112+
if [[ $retval_amd != 0 ]]; then
113+
printf "${RED}AMD Failed${NC}"
114+
return $retval_amd
115+
fi
116+
117+
if [[ $retval_arm != 0 ]]; then
118+
printf "${RED}ARM Failed${NC}"
119+
return $retval_arm
120+
fi
121+
fi
122+
123+
if [[ "$SCOPE" == "ARM" ]]; then
124+
if [[ $retval_arm != 0 ]]; then
125+
printf "${RED}ARM Failed${NC}"
126+
return $retval_arm
127+
else
128+
echo "ARM tests are Successful"
129+
return $retval_arm
130+
fi
131+
fi
132+
133+
if [[ "$SCOPE" == "AMD" ]]; then
134+
if [[ $retval_amd != 0 ]]; then
135+
printf "${RED}AMD Failed${NC}"
136+
return $retval_amd
137+
else
138+
echo "AMD tests are Successful"
139+
return $retval_amd
140+
fi
141+
fi
142+
}
143+
144+
run_tests

pkg/cloudprovider/providers/oci/ccm.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ import (
3636
"github.com/oracle/oci-cloud-controller-manager/pkg/metrics"
3737
"github.com/oracle/oci-cloud-controller-manager/pkg/oci/client"
3838
"github.com/oracle/oci-cloud-controller-manager/pkg/oci/instance/metadata"
39-
"github.com/oracle/oci-go-sdk/v31/common"
40-
"github.com/oracle/oci-go-sdk/v31/core"
39+
"github.com/oracle/oci-go-sdk/v50/common"
40+
"github.com/oracle/oci-go-sdk/v50/core"
4141
)
4242

4343
const (

pkg/cloudprovider/providers/oci/config/config.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import (
1919
"io"
2020
"os"
2121

22-
"github.com/oracle/oci-go-sdk/v31/common"
23-
"github.com/oracle/oci-go-sdk/v31/common/auth"
22+
"github.com/oracle/oci-go-sdk/v50/common"
23+
"github.com/oracle/oci-go-sdk/v50/common/auth"
2424
"github.com/pkg/errors"
2525

2626
"go.uber.org/zap"

pkg/cloudprovider/providers/oci/instances.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
"fmt"
2020
"net"
2121

22-
"github.com/oracle/oci-go-sdk/v31/core"
22+
"github.com/oracle/oci-go-sdk/v50/core"
2323
"k8s.io/apimachinery/pkg/labels"
2424

2525
"github.com/oracle/oci-cloud-controller-manager/pkg/oci/client"

0 commit comments

Comments
 (0)