Skip to content

Commit

Permalink
Merge pull request ceph#237 from red-hat-storage/sync_ds--release-v3.10
Browse files Browse the repository at this point in the history
Syncing latest changes from release-v3.10 for ceph-csi
  • Loading branch information
openshift-merge-bot[bot] authored Dec 20, 2023
2 parents 9033b8d + 298c242 commit 9647e47
Show file tree
Hide file tree
Showing 15 changed files with 52 additions and 25 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ environments.

| Ceph CSI Version | Container Orchestrator Name | Version Tested |
| -----------------| --------------------------- | -------------------|
| v3.10.1 | Kubernetes | v1.26, v1.27, v1.28|
| v3.10.0 | Kubernetes | v1.26, v1.27, v1.28|
| v3.9.0 | Kubernetes | v1.25, v1.26, v1.27|

Expand Down Expand Up @@ -128,6 +129,7 @@ in the Kubernetes documentation.
| Ceph CSI Release/Branch | Container image name | Image Tag |
| ----------------------- | ---------------------------- | --------- |
| devel (Branch) | quay.io/cephcsi/cephcsi | canary |
| v3.10.1 (Release) | quay.io/cephcsi/cephcsi | v3.10.1 |
| v3.10.0 (Release) | quay.io/cephcsi/cephcsi | v3.10.0 |
| v3.9.0 (Release) | quay.io/cephcsi/cephcsi | v3.9.0 |

Expand Down
2 changes: 1 addition & 1 deletion build.env
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# get proporly expanded.
#
# cephcsi image version
CSI_IMAGE_VERSION=v3.10-canary
CSI_IMAGE_VERSION=v3.10.1

# cephcsi upgrade version
CSI_UPGRADE_VERSION=v3.9.0
Expand Down
4 changes: 2 additions & 2 deletions charts/ceph-csi-cephfs/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ nodeplugin:
plugin:
image:
repository: quay.io/cephcsi/cephcsi
tag: v3.10.0
tag: v3.10.1
pullPolicy: IfNotPresent
resources: {}

Expand Down Expand Up @@ -198,7 +198,7 @@ provisioner:
name: resizer
enabled: true
image:
repository: gcr.io/k8s-staging-sig-storage/csi-resizer
repository: registry.k8s.io/sig-storage/csi-resizer
tag: v1.9.2
pullPolicy: IfNotPresent
resources: {}
Expand Down
4 changes: 2 additions & 2 deletions charts/ceph-csi-rbd/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ nodeplugin:
plugin:
image:
repository: quay.io/cephcsi/cephcsi
tag: v3.10.0
tag: v3.10.1
pullPolicy: IfNotPresent
resources: {}

Expand Down Expand Up @@ -248,7 +248,7 @@ provisioner:
name: resizer
enabled: true
image:
repository: gcr.io/k8s-staging-sig-storage/csi-resizer
repository: registry.k8s.io/sig-storage/csi-resizer
tag: v1.9.2
pullPolicy: IfNotPresent
resources: {}
Expand Down
2 changes: 2 additions & 0 deletions deploy/cephcsi/image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ FROM ${BASE_IMAGE} as updated_base
RUN dnf config-manager --disable \
tcmu-runner,tcmu-runner-source,tcmu-runner-noarch,ceph-iscsi,ganesha || true

RUN mkdir /etc/selinux || true && touch /etc/selinux/config

RUN dnf -y update --nobest \
&& dnf -y install nfs-utils \
&& dnf clean all \
Expand Down
6 changes: 3 additions & 3 deletions deploy/cephfs/kubernetes/csi-cephfsplugin-provisioner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ spec:
- name: socket-dir
mountPath: /csi
- name: csi-resizer
image: gcr.io/k8s-staging-sig-storage/csi-resizer:v1.9.2
image: registry.k8s.io/sig-storage/csi-resizer:v1.9.2
args:
- "--csi-address=$(ADDRESS)"
- "--v=1"
Expand Down Expand Up @@ -94,7 +94,7 @@ spec:
- name: socket-dir
mountPath: /csi
- name: csi-cephfsplugin
image: quay.io/cephcsi/cephcsi:v3.10-canary
image: quay.io/cephcsi/cephcsi:v3.10.1
args:
- "--nodeid=$(NODE_ID)"
- "--type=cephfs"
Expand Down Expand Up @@ -142,7 +142,7 @@ spec:
- name: ceph-csi-encryption-kms-config
mountPath: /etc/ceph-csi-encryption-kms-config/
- name: liveness-prometheus
image: quay.io/cephcsi/cephcsi:v3.10-canary
image: quay.io/cephcsi/cephcsi:v3.10.1
args:
- "--type=liveness"
- "--endpoint=$(CSI_ENDPOINT)"
Expand Down
4 changes: 2 additions & 2 deletions deploy/cephfs/kubernetes/csi-cephfsplugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ spec:
capabilities:
add: ["SYS_ADMIN"]
allowPrivilegeEscalation: true
image: quay.io/cephcsi/cephcsi:v3.10-canary
image: quay.io/cephcsi/cephcsi:v3.10.1
args:
- "--nodeid=$(NODE_ID)"
- "--type=cephfs"
Expand Down Expand Up @@ -124,7 +124,7 @@ spec:
securityContext:
privileged: true
allowPrivilegeEscalation: true
image: quay.io/cephcsi/cephcsi:v3.10-canary
image: quay.io/cephcsi/cephcsi:v3.10.1
args:
- "--type=liveness"
- "--endpoint=$(CSI_ENDPOINT)"
Expand Down
6 changes: 3 additions & 3 deletions deploy/nfs/kubernetes/csi-nfsplugin-provisioner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ spec:
- name: socket-dir
mountPath: /csi
- name: csi-resizer
image: gcr.io/k8s-staging-sig-storage/csi-resizer:v1.9.2
image: registry.k8s.io/sig-storage/csi-resizer:v1.9.2
args:
- "--csi-address=$(ADDRESS)"
- "--v=1"
Expand Down Expand Up @@ -88,7 +88,7 @@ spec:
- name: socket-dir
mountPath: /csi
- name: csi-nfsplugin
image: quay.io/cephcsi/cephcsi:v3.10-canary
image: quay.io/cephcsi/cephcsi:v3.10.1
args:
- "--nodeid=$(NODE_ID)"
- "--type=nfs"
Expand Down Expand Up @@ -120,7 +120,7 @@ spec:
- name: keys-tmp-dir
mountPath: /tmp/csi/keys
- name: liveness-prometheus
image: quay.io/cephcsi/cephcsi:v3.10-canary
image: quay.io/cephcsi/cephcsi:v3.10.1
args:
- "--type=liveness"
- "--endpoint=$(CSI_ENDPOINT)"
Expand Down
2 changes: 1 addition & 1 deletion deploy/nfs/kubernetes/csi-nfsplugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ spec:
capabilities:
add: ["SYS_ADMIN"]
allowPrivilegeEscalation: true
image: quay.io/cephcsi/cephcsi:v3.10.0
image: quay.io/cephcsi/cephcsi:v3.10.1
args:
- "--nodeid=$(NODE_ID)"
- "--type=nfs"
Expand Down
8 changes: 4 additions & 4 deletions deploy/rbd/kubernetes/csi-rbdplugin-provisioner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ spec:
- name: socket-dir
mountPath: /csi
- name: csi-resizer
image: gcr.io/k8s-staging-sig-storage/csi-resizer:v1.9.2
image: registry.k8s.io/sig-storage/csi-resizer:v1.9.2
args:
- "--csi-address=$(ADDRESS)"
- "--v=1"
Expand All @@ -116,7 +116,7 @@ spec:
- name: socket-dir
mountPath: /csi
- name: csi-rbdplugin
image: quay.io/cephcsi/cephcsi:v3.10-canary
image: quay.io/cephcsi/cephcsi:v3.10.1
args:
- "--nodeid=$(NODE_ID)"
- "--type=rbd"
Expand Down Expand Up @@ -172,7 +172,7 @@ spec:
mountPath: /run/secrets/tokens
readOnly: true
- name: csi-rbdplugin-controller
image: quay.io/cephcsi/cephcsi:v3.10-canary
image: quay.io/cephcsi/cephcsi:v3.10.1
args:
- "--type=controller"
- "--v=5"
Expand All @@ -193,7 +193,7 @@ spec:
- name: ceph-config
mountPath: /etc/ceph/
- name: liveness-prometheus
image: quay.io/cephcsi/cephcsi:v3.10-canary
image: quay.io/cephcsi/cephcsi:v3.10.1
args:
- "--type=liveness"
- "--endpoint=$(CSI_ENDPOINT)"
Expand Down
4 changes: 2 additions & 2 deletions deploy/rbd/kubernetes/csi-rbdplugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ spec:
capabilities:
add: ["SYS_ADMIN"]
allowPrivilegeEscalation: true
image: quay.io/cephcsi/cephcsi:v3.10-canary
image: quay.io/cephcsi/cephcsi:v3.10.1
args:
- "--nodeid=$(NODE_ID)"
- "--pluginpath=/var/lib/kubelet/plugins"
Expand Down Expand Up @@ -134,7 +134,7 @@ spec:
securityContext:
privileged: true
allowPrivilegeEscalation: true
image: quay.io/cephcsi/cephcsi:v3.10-canary
image: quay.io/cephcsi/cephcsi:v3.10.1
args:
- "--type=liveness"
- "--endpoint=$(CSI_ENDPOINT)"
Expand Down
24 changes: 19 additions & 5 deletions internal/csi-addons/networkfence/fencing.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"errors"
"fmt"
"net"
"regexp"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -210,11 +211,24 @@ func (ac *activeClient) fetchIP() (string, error) {
// example: "inst": "client.4305 172.21.9.34:0/422650892",
// then returning value will be 172.21.9.34
clientInfo := ac.Inst
parts := strings.Fields(clientInfo)
if len(parts) >= 2 {
lastColonIndex := strings.LastIndex(parts[1], ":")
firstPart := parts[1][:lastColonIndex]
ip := net.ParseIP(firstPart)

// Attempt to extract the IP address using a regular expression
// the regular expression aims to match either a complete IPv6
// address or a complete IPv4 address follows by any prefix (v1 or v2)
// if exists
// (?:v[0-9]+:): this allows for an optional prefix starting with "v"
// followed by one or more digits and a colon.
// The ? outside the group makes the entire prefix section optional.
// (?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}: this allows to check for
// standard IPv6 address.
// |: Alternation operator to allow matching either the IPv6 pattern
// with a prefix or the IPv4 pattern.
// '(?:\d+\.){3}\d+: This part matches a standard IPv4 address.
re := regexp.MustCompile(`(?:v[0-9]+:)?([0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4}){7}|(?:\d+\.){3}\d+)`)
ipMatches := re.FindStringSubmatch(clientInfo)

if len(ipMatches) > 0 {
ip := net.ParseIP(ipMatches[1])
if ip != nil {
return ip.String(), nil
}
Expand Down
5 changes: 5 additions & 0 deletions internal/csi-addons/networkfence/fencing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ func TestFetchIP(t *testing.T) {
expectedIP: "2001:db8:85a3::8a2e:370:7334",
expectedErr: false,
},
{
clientInfo: "client.24152 v1:100.64.0.7:0/3658550259",
expectedIP: "100.64.0.7",
expectedErr: false,
},
{
clientInfo: "",
expectedIP: "",
Expand Down
2 changes: 2 additions & 0 deletions scripts/Dockerfile.devel
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ RUN source /build.env \
RUN dnf config-manager --disable \
tcmu-runner,tcmu-runner-source,tcmu-runner-noarch,ceph-iscsi,ganesha || true

RUN mkdir /etc/selinux || true && touch /etc/selinux/config

RUN dnf -y install \
git \
make \
Expand Down
2 changes: 2 additions & 0 deletions scripts/Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ ENV \

COPY build.env /

RUN mkdir /etc/selinux || true && touch /etc/selinux/config

RUN source /build.env \
&& \
( test -n "${GOARCH}" && exit 0; echo -e "\n\nMissing GOARCH argument for building image, install Golang or run: make containerized-test GOARCH=amd64\n\n"; exit 1 ) \
Expand Down

0 comments on commit 9647e47

Please sign in to comment.