-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
FC volume plugin: Support WWID for volume identifier #48741
Conversation
Hi @mtanino. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/ok-to-test |
@mtanino: you can't request testing unless you are a kubernetes member. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@@ -648,15 +648,22 @@ func validateISCSIVolumeSource(iscsi *api.ISCSIVolumeSource, fldPath *field.Path | |||
|
|||
func validateFCVolumeSource(fc *api.FCVolumeSource, fldPath *field.Path) field.ErrorList { | |||
allErrs := field.ErrorList{} | |||
if len(fc.TargetWWNs) < 1 { | |||
allErrs = append(allErrs, field.Required(fldPath.Child("targetWWNs"), "")) | |||
if len(fc.TargetWWNs) < 1 && len(fc.WWIDs) < 1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd appreciate an unit test for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
} else { | ||
if *fc.Lun < 0 || *fc.Lun > 255 { | ||
allErrs = append(allErrs, field.Invalid(fldPath.Child("lun"), fc.Lun, validation.InclusiveRangeError(0, 255))) | ||
if len(fc.TargetWWNs) != 0 && len(fc.WWIDs) != 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd appreciate an unit test for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
/ok-to-test |
// Optional: FC volume World Wide Identifiers (WWIDs) | ||
// Either WWIDs or TargetWWNs and Lun must be set, but not both simultaneously. | ||
// +optional | ||
WWIDs []string `json:"WWIDs,omitempty" protobuf:"bytes,5,rep,name=WWIDs"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
json fields must be lowercase, i.e. probably json:"wwids,omitempty"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'+ the same for protobuf field
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
/test pull-kubernetes-verify |
These should be modified only when apps/v1beta1/types.go, batch/v1/types.go or extensions/v1beta1/types.go change and I do not see any such change in your PR. I guess your |
@jsafrane
I'm not sure but after hack/update-all.sh again, these three files were still regenerated. |
@mtanino, now it looks much better, please run |
pkg/volume/fc/fc_util.go
Outdated
disk, err := io.EvalSymlinks(dev_id + name) | ||
if err != nil { | ||
glog.V(2).Infof("fc: failed to find a corresponding disk from symlink[%s], error %v", dev_id+name, err) | ||
return "", "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to me that continue
would be more appropriate here - there is a weird symlink there, but that should not stop the plugin from trying the other links in the directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my understanding, fc_path is unique under /dev/by-id.
Therefore, if symlink evaluation or checkDiskExist of scsi-3600508b400105e210000900000490000 fails, checking other links seems meaning less.
Also seems strings.Contains causes unexpected behavior because there is a possibility that choose partitioned device such as sda1, sda2, etc. I think we should check whether name matches fc_path completely.
ex.
lrwxrwxrwx 1 root root 9 Jul 7 19:47 scsi-3600508b400105e210000900000490000 -> ../../sdb
lrwxrwxrwx 1 root root 9 Jul 7 19:45 scsi-35000c500676fb68f -> ../../sda
lrwxrwxrwx 1 root root 10 Jul 7 19:45 scsi-35000c500676fb68f-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jul 7 19:45 scsi-35000c500676fb68f-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Jul 7 19:45 scsi-35000c500676fb68f-part3 -> ../../sda3
lrwxrwxrwx 1 root root 10 Jul 7 19:45 scsi-35000c500676fb68f-part4 -> ../../sda4
lrwxrwxrwx 1 root root 10 Jul 7 19:45 scsi-35000c500676fb68f-part5 -> ../../sda5
lrwxrwxrwx 1 root root 9 Jul 7 19:45 wwn-0x5000c500676fb68f -> ../../sda
lrwxrwxrwx 1 root root 10 Jul 7 19:45 wwn-0x5000c500676fb68f-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jul 7 19:45 wwn-0x5000c500676fb68f-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Jul 7 19:45 wwn-0x5000c500676fb68f-part3 -> ../../sda3
lrwxrwxrwx 1 root root 10 Jul 7 19:45 wwn-0x5000c500676fb68f-part4 -> ../../sda4
lrwxrwxrwx 1 root root 10 Jul 7 19:45 wwn-0x5000c500676fb68f-part5 -> ../../sda5
lrwxrwxrwx 1 root root 9 Mar 31 13:20 wwn-0x5001480000000000 -> ../../sr0
Any thought?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, with name == fs_path
I see that return
is correct here
pkg/volume/fc/fc_util.go
Outdated
err = checkDiskExist(b, disk, wwid) | ||
if err != nil { | ||
glog.V(2).Infof("fc: failed to get wwid from disk[%s], error %v", dev_id+name, err) | ||
return "", "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dtto, continue
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scratch the previous comment, return
is correct here
/approve for federation. Al federation changes in this PR are auto generated. |
/test pull-kubernetes-node-e2e |
/test pull-kubernetes-e2e-gce-etcd3 |
/retest |
/lgtm |
/assign @thockin |
/approve |
This PR adds World Wide Identifier (WWID) parameter to FCVolumeSource as an unique volume identifier. fixes kubernetes#48639
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jsafrane, mtanino, nikhiljindal, rootfs, thockin Associated issue: 48639 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/retest |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue |
What this PR does / why we need it:
This PR adds World Wide Identifier (WWID) parameter to FCVolumeSource as an unique volume identifier.
Which issue this PR fixes: fixes #48639
Special notes for your reviewer:
/cc @rootfs @jsafrane @msau42
Release note: