From 94cc046c968cd8984b4e74c885e9e2bb0051f7d1 Mon Sep 17 00:00:00 2001 From: Frank Kloeker Date: Tue, 1 Dec 2020 18:57:28 +0100 Subject: [PATCH] OTC Adapation OCCM 1.19.2 * remove InsertHeaders for ELB * remove Description for EIP * make all EVS in Cinder CSI as multiattach feature --- .travis.yml | 36 +++++++++++++++++++ .../openstack/openstack_loadbalancer.go | 8 +++-- pkg/csi/cinder/openstack/openstack_volumes.go | 1 + 3 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..6551d21f7d --- /dev/null +++ b/.travis.yml @@ -0,0 +1,36 @@ +--- +sudo: required +dist: bionic + +language: go + +env: + - GO111MODULE=on + +go: + - 1.14.x + +addons: + apt: + packages: + - docker.io + +services: + - docker + +script: + - sudo systemctl unmask docker + - sudo systemctl start docker + - echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USER" --password-stdin + - TAG=`git describe --match=$(git rev-parse --short=8 HEAD) --always --dirty --abbrev=8` + - go version + - go mod edit --replace github.com/gophercloud/gophercloud=github.com/mcsps/gophercloud@e9621d586645ac903f74ddddaf1d342f5bed6a0c + - make image-controller-manager + - docker images + - docker tag k8scloudprovider/openstack-cloud-controller-manager:${TAG}-dirty mcsps/cloud-provider-opentelekomcloud:1.19 + - docker push mcsps/cloud-provider-opentelekomcloud:1.19 + - make image-cinder-csi-plugin + - docker images + - docker tag k8scloudprovider/cinder-csi-plugin:${TAG}-dirty mcsps/cinder-csi-plugin:1.19 + - docker push mcsps/cinder-csi-plugin:1.19 + diff --git a/pkg/cloudprovider/providers/openstack/openstack_loadbalancer.go b/pkg/cloudprovider/providers/openstack/openstack_loadbalancer.go index c5973d250b..8c14a3a9d3 100644 --- a/pkg/cloudprovider/providers/openstack/openstack_loadbalancer.go +++ b/pkg/cloudprovider/providers/openstack/openstack_loadbalancer.go @@ -1135,7 +1135,7 @@ func (lbaas *LbaasV2) ensureOctaviaListener(lbID string, oldListeners []listener klog.V(4).Infof("Forcing to use %q protocol for listener because %q annotation is set", listeners.ProtocolHTTP, ServiceAnnotationLoadBalancerXForwardedFor) listenerCreateOpt.Protocol = listeners.ProtocolHTTP } - listenerCreateOpt.InsertHeaders = map[string]string{annotationXForwardedFor: "true"} + // listenerCreateOpt.InsertHeaders = map[string]string{annotationXForwardedFor: "true"} } if len(svcConf.allowedCIDR) > 0 { @@ -1159,6 +1159,7 @@ func (lbaas *LbaasV2) ensureOctaviaListener(lbID string, oldListeners []listener updateOpts.ConnLimit = &svcConf.connLimit listenerChanged = true } +/* updateOpts.InsertHeaders = &listener.InsertHeaders listenerKeepClientIP := listener.InsertHeaders[annotationXForwardedFor] == "true" if svcConf.keepClientIP != listenerKeepClientIP { @@ -1169,6 +1170,7 @@ func (lbaas *LbaasV2) ensureOctaviaListener(lbID string, oldListeners []listener } listenerChanged = true } +*/ if openstackutil.IsOctaviaFeatureSupported(lbaas.lb, openstackutil.OctaviaFeatureTimeout) { if svcConf.timeoutClientData != listener.TimeoutClientData { updateOpts.TimeoutClientData = &svcConf.timeoutClientData @@ -1665,7 +1667,7 @@ func (lbaas *LbaasV2) EnsureLoadBalancer(ctx context.Context, clusterName string "annotation is set", listeners.ProtocolHTTP, ServiceAnnotationLoadBalancerXForwardedFor) listenerCreateOpt.Protocol = listeners.ProtocolHTTP } - listenerCreateOpt.InsertHeaders = map[string]string{"X-Forwarded-For": "true"} + //listenerCreateOpt.InsertHeaders = map[string]string{"X-Forwarded-For": "true"} } listenerCreateOpt.TimeoutClientData = &timeoutClientData @@ -1961,7 +1963,7 @@ func (lbaas *LbaasV2) EnsureLoadBalancer(ctx context.Context, clusterName string floatIPOpts := floatingips.CreateOpts{ FloatingNetworkID: floatingNetworkID, PortID: portID, - Description: fmt.Sprintf("Floating IP for Kubernetes external service %s from cluster %s", serviceName, clusterName), + // Description: fmt.Sprintf("Floating IP for Kubernetes external service %s from cluster %s", serviceName, clusterName), } if floatingSubnetID != "" { diff --git a/pkg/csi/cinder/openstack/openstack_volumes.go b/pkg/csi/cinder/openstack/openstack_volumes.go index f8746dec10..abb3d1ada9 100644 --- a/pkg/csi/cinder/openstack/openstack_volumes.go +++ b/pkg/csi/cinder/openstack/openstack_volumes.go @@ -66,6 +66,7 @@ func (os *OpenStack) CreateVolume(name string, size int, vtype, availability str VolumeType: vtype, AvailabilityZone: availability, Description: volumeDescription, + Multiattach: true, SnapshotID: snapshotID, SourceVolID: sourcevolID, }