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

support ipv6 #1769

Merged
merged 1 commit into from Jun 20, 2018
Merged

support ipv6 #1769

merged 1 commit into from Jun 20, 2018

Conversation

zmlcc
Copy link
Contributor

@zmlcc zmlcc commented Jun 5, 2018

Close #1630 by accident, reopen here

@jbw976 I notice there is a significant change in master branch:
all ceph related components were called in the ceph subcommand
So the backwards incompatibility of flag and env vars is considered acceptable.
After upgrading there should be no pods that are using the old command and old flags and env vars.

Description of your changes:

join host and port using net.JoinHostPort

rename NetworkInfo.PublicAddrIPv4 to NetworkInfo.PublicAddr
rename NetworkInfo.ClusterAddrIPv4 to NetworkInfo.ClusterAddr
rename command flag public-ipv4 to public-ip
rename command flag private-ipv4 to private-ip
rename ROOK_PUBLIC_IPV4 to ROOK_PUBLIC_IP
rename ROOK_PRIVATE_IPV4 to ROOK_PRIVATE_IP

Which issue is resolved by this Pull Request:
Resolves #1629

@zmlcc zmlcc mentioned this pull request Jun 5, 2018
@zmlcc
Copy link
Contributor Author

zmlcc commented Jun 5, 2018

jenkins Failed because All nodes of label ‘gce_1.9.x’ are offline

@galexrt
Copy link
Member

galexrt commented Jun 5, 2018

@zmlcc We are currently experiencing issues with our Jenkins CI.
The issue should hopefully soon be resolved. I'll let you know when the issue is fixed and the CI has re-run for your PR.

/cc @jbw976

@zmlcc
Copy link
Contributor Author

zmlcc commented Jun 7, 2018

Does Jenkins CI work ?

Copy link
Member

@jbw976 jbw976 left a comment

Choose a reason for hiding this comment

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

Thanks for your continued effort @zmlcc. I actually do think there is still upgrade/migration impact. In the process described in the upgrade user guide, the ceph components only get their container version updated, e.g. with something like kubectl -n rook set image replicaset/rook-ceph-mon0 rook-ceph-mon=rook/ceph:master. This means that there will be pods still using the legacy commands and flags. You can see that the legacy ceph commands (commands that are NOT under the new ceph subcommand) are still supported by being directly added to the main rook command here: https://github.com/rook/rook/blob/master/cmd/rook/main.go#L40

I think we still need migration support with this flag name change. Perhaps just keep both the old and new name flags and probably an error check to make sure that both are not specified. What do you think?

Jenkinsfile Outdated
@@ -204,3 +204,4 @@ def notifySlack(String buildStatus) {
}
}
}

Copy link
Member

Choose a reason for hiding this comment

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

i think this extra blank line can be removed now

@jbw976
Copy link
Member

jbw976 commented Jun 7, 2018

oh and yes, Jenkins CI should be working again now, we will see how the test run goes after we resolve the migration/upgrade support issue.

@zmlcc
Copy link
Contributor Author

zmlcc commented Jun 8, 2018

@jbw976 Thanks for your explanation
I have made some changes to support legacy flags public-ipv4 / private-ipv4
Please review it

@zmlcc
Copy link
Contributor Author

zmlcc commented Jun 12, 2018

@jbw976 Any comment?

Copy link
Member

@jbw976 jbw976 left a comment

Choose a reason for hiding this comment

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

Thank you for adding migration logic, the Rook community will appreciate this attention to keeping things working across releases.

I think we should also update the PendingReleaseNotes.md to add these flags to the deprecated section.

if err := flags.VerifyRequiredFlags(mdsCmd, required); err != nil {
return err
}

renamed := [][2]string{{"public-ip", "public-ipv4"}, {"private-ip", "private-ipv4"}}
Copy link
Member

Choose a reason for hiding this comment

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

could the set of renamed flags be defined in just one place? (perhaps the ceph root command)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

define verifyRenamedFlags function in ceph.go and call it in each ceph subcommand

if err := flags.VerifyRequiredFlags(mgrCmd, required); err != nil {
return err
}

renamed := [][2]string{{"public-ip", "public-ipv4"}, {"private-ip", "private-ipv4"}}
if err := flags.VerifyRenamedFlags(mdsCmd, renamed); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

the mdsCmd is accidentally being checked here when you want to use the command that this file is for. this issue exists for all the other commands.

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 for your reminder, I corrected all the mistakes

@@ -37,6 +37,22 @@ func VerifyRequiredFlags(cmd *cobra.Command, requiredFlags []string) error {
return createRequiredFlagError(cmd.Name(), missingFlags)
}

func VerifyRenamedFlags(cmd *cobra.Command, renamedFlags [][2]string) error {
Copy link
Member

Choose a reason for hiding this comment

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

this function might be easier to read/maintain (especially where it is called and where it is tested) if it used a struct instead of a 2 element slice of strings. For example renamedFlags []RenamedFlag, where the type RenamedFlag is defined as:

type RenamedFlag struct {
    NewFlagName string
    OldFlagName string
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Refactored under your suggestion

@zmlcc
Copy link
Contributor Author

zmlcc commented Jun 14, 2018

@jbw976 I update the codes under your suggestion. Please review.

deprecate NetworkInfo.PublicAddrIPv4, use NetworkInfo.PublicAddr instead
deprecate NetworkInfo.ClusterAddrIPv4, use NetworkInfo.ClusterAddr instead
deprecate command flag public-ipv4, use public-ip instead
deprecate command flag private-ipv4, use private-ip instead
change ROOK_PUBLIC_IPV4 to ROOK_PUBLIC_IP
change ROOK_PRIVATE_IPV4 to ROOK_PRIVATE_IP

Signed-off-by: Zhang Miaolei <zmlcc@outlook.com>
@zmlcc
Copy link
Contributor Author

zmlcc commented Jun 19, 2018

@jbw976 Any comment? I notice jenkins check changed from success to failure due to expired

Copy link
Member

@jbw976 jbw976 left a comment

Choose a reason for hiding this comment

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

Thank you for incorporating the feedback @zmlcc! I'll poke the Jenkins server and try to get a green build for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support ipv6
3 participants