Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CephFS: Update fetchIP() to add support for IPv6 address #4230

Merged
merged 2 commits into from
Nov 8, 2023
Merged

CephFS: Update fetchIP() to add support for IPv6 address #4230

merged 2 commits into from
Nov 8, 2023

Conversation

riya-singhal31
Copy link
Contributor

@riya-singhal31 riya-singhal31 commented Nov 6, 2023

the current fetchIP() function works for IPv4 addresses, this commit updates the same to support IPv6 too.
fixes: #4192

@riya-singhal31 riya-singhal31 changed the title [WIP]CephFS: Update fetchIP() to add support for IPv6 address CephFS: Update fetchIP() to add support for IPv6 address Nov 6, 2023
ip := strings.Split(parts[1], ":")[0]

return ip, nil
// use a regular expression to find an IPv4 or IPv6 address in the string
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use net.ParseIP to find the IP address from string https://go.dev/play/p/PSqKE6XxZtO

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Madhu-1 for sharing, updated the code with net.ParseIP and a few additional parsing as the expected format of clientInfo is "inst": "client.4305 172.21.9.34:0/422650892"
PTAL

@@ -68,6 +68,11 @@ func TestFetchIP(t *testing.T) {
expectedIP: "172.21.9.34",
expectedErr: false,
},
{
clientInfo: "client.4305 2001:0db8:85a3:0000:0000:8a2e:0370:7334:0/422650892",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you confirm that Ceph uses this format with IPv6 addresses?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the official documentation of ceph
As the inst listed in ceph tell mds.0 client ls for the IPv4 address,
'"inst": "client.4305 172.21.9.34:0/422650892",
So IPv6 should also be the same only like the client id and then..
I'll check with ceph for more clarity on this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked with Xiubo and Kotresh, the given syntax is fine!

@riya-singhal31
Copy link
Contributor Author

@Mergifyio queue

Copy link
Contributor

mergify bot commented Nov 8, 2023

queue

🛑 The pull request has been removed from the queue default

The queue conditions cannot be satisfied due to failing checks.

You can take a look at Queue: Embarked in merge queue check runs for more details.

In case of a failure due to a flaky test, you should first retrigger the CI.
Then, re-embark the pull request into the merge queue by posting the comment
@mergifyio refresh on the pull request.

@mergify mergify bot added the ok-to-test Label to trigger E2E tests label Nov 8, 2023
@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/upgrade-tests-cephfs

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.26

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/upgrade-tests-rbd

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e-helm/k8s-1.26

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.27

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e/k8s-1.26

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e-helm/k8s-1.27

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.28

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e/k8s-1.27

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e-helm/k8s-1.28

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e/k8s-1.28

@riya-singhal31 riya-singhal31 added the component/cephfs Issues related to CephFS label Nov 8, 2023
@ceph-csi-bot ceph-csi-bot removed the ok-to-test Label to trigger E2E tests label Nov 8, 2023
@riya-singhal31
Copy link
Contributor Author

@Mergifyio rebase

Signed-off-by: Riya Singhal <rsinghal@redhat.com>
Signed-off-by: Riya Singhal <rsinghal@redhat.com>
Copy link
Contributor

mergify bot commented Nov 8, 2023

rebase

✅ Branch has been successfully rebased

@riya-singhal31
Copy link
Contributor Author

@Mergifyio queue

Copy link
Contributor

mergify bot commented Nov 8, 2023

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at 2598300

@mergify mergify bot added the ok-to-test Label to trigger E2E tests label Nov 8, 2023
@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.27

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.28

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/upgrade-tests-cephfs

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.26

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e-helm/k8s-1.28

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e-helm/k8s-1.27

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/upgrade-tests-rbd

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e/k8s-1.28

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e/k8s-1.27

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e-helm/k8s-1.26

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e/k8s-1.26

@ceph-csi-bot ceph-csi-bot removed the ok-to-test Label to trigger E2E tests label Nov 8, 2023
@Madhu-1 Madhu-1 added ci/skip/e2e skip running e2e CI jobs ok-to-test Label to trigger E2E tests labels Nov 8, 2023
@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.26

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e-helm/k8s-1.26

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e/k8s-1.26

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.28

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.27

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/upgrade-tests-cephfs

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e-helm/k8s-1.27

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e-helm/k8s-1.28

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/upgrade-tests-rbd

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e/k8s-1.27

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e/k8s-1.28

@Madhu-1 Madhu-1 removed the ok-to-test Label to trigger E2E tests label Nov 8, 2023
@mergify mergify bot merged commit 2598300 into ceph:devel Nov 8, 2023
47 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/skip/e2e skip running e2e CI jobs component/cephfs Issues related to CephFS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Supporting IPv6 addresses in network fencing procedure for cephFS.
4 participants