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

Fix bug where coredns 1.8.3 needs more permissions #130

Merged
merged 2 commits into from
Jun 15, 2021

Conversation

yorinasub17
Copy link
Contributor

@yorinasub17 yorinasub17 commented Jun 15, 2021

eks/sync.go Outdated
corednsConfigMap, err := getCorednsConfigMap(clientset)
if err != nil {
return err
}
// Need to check config for backwards incompatibility if updating to version >= 1.7.0. The keyword upstream was
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: I would probably word this comment as

The keyword "upstream" or `upstream`

to be clear that upstream is the keyword.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! 7cb60c0

// Need to check config for backwards incompatibility if updating to version >= 1.7.0. The keyword upstream was
// removed in 1.7 series of coredns, but is used in earlier versions.
compareVal, err := semverStringCompare(coreDNSVersion, "1.7.0-eksbuild.1")
compareVal170, err := semverStringCompare(coreDNSVersion, "1.7.0-eksbuild.1")
if err != nil {
return err
}
// Looking for 1 or 0 here, since we want to know when coreDNSVersion is >= 1.7.0
Copy link
Contributor

@rhoboat rhoboat Jun 15, 2021

Choose a reason for hiding this comment

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

NIT: Since annotated versions are considered <, the comparison is actually against 1.7.0-eksbuild.1, which is < 1.7.0. I don't know if it really matters in this comment, but it strikes me as slightly inaccurate. Do I understand correctly?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it could be argued that it doesn't matter for the sake of this comment, since 1.7.0-eksbuild.1 is still 1.7.0 colloquially.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This doesn't really matter, because all the EKS coredns versions are always published with the annotation, so the comment is accurate in the context of EKS.

rhoboat
rhoboat previously approved these changes Jun 15, 2021
Copy link
Contributor

@rhoboat rhoboat left a comment

Choose a reason for hiding this comment

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

LGTM! Left minor nits, feel free to take or leave. Assuming tests pass in the other PR, 👍 .

NIT: On the whole, I wonder about these updates scaling. I like that these two new update...Compatibility functions are named for both the version and the thing being updated. I wonder if it is easier in the long run to process compatibility updates for coredns in a slightly different way, where maybe, based on a single semverStringCompare, you run all the updates that are needed. Again, definitely not critical now.

@yorinasub17
Copy link
Contributor Author

yorinasub17 commented Jun 15, 2021

NIT: On the whole, I wonder about these updates scaling. I like that these two new update...Compatibility functions are named for both the version and the thing being updated.

I don't think we should worry too much about this. EKS is only going to maintain support for a handful of kubernetes versions (as evidenced by the fact that they continue to roll off the oldest version everytime they add support for a new version). And the number of versions that need special treatment will be even less than that.

Furthermore, this command is going to be deprecated real soon when we switch to using managed add-ons, which will encapsulate this logic at the AWS API level.

Copy link
Contributor

@rhoboat rhoboat left a comment

Choose a reason for hiding this comment

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

LGTM!

@yorinasub17
Copy link
Contributor Author

I wonder if it is easier in the long run to process compatibility updates for coredns in a slightly different way, where maybe, based on a single semverStringCompare, you run all the updates that are needed.

Can you elaborate what you are thinking here? I don't think I fully understand what you are proposing here. I'm having a hard time figuring out how you can reduce the checks down to a single semverStringCompare given the number of path ways that one updates their kubernetes cluster (and thus you can end up with needing to run both updates because you are hopping from <1.7.0 to >1.8.3).

@yorinasub17
Copy link
Contributor Author

Thanks for the review! I'm waiting on the integration testing build to pass before merging this in.

@rhoboat
Copy link
Contributor

rhoboat commented Jun 15, 2021

I wonder if it is easier in the long run to process compatibility updates for coredns in a slightly different way, where maybe, based on a single semverStringCompare, you run all the updates that are needed.

Can you elaborate what you are thinking here? I don't think I fully understand what you are proposing here. I'm having a hard time figuring out how you can reduce the checks down to a single semverStringCompare given the number of path ways that one updates their kubernetes cluster (and thus you can end up with needing to run both updates because you are hopping from <1.7.0 to >1.8.3).

Good question. I was thinking the way to know which (how many) updates to apply would be derived from the difference in versions. 🤔 I am not sure if that's possible. I think the .Compare function might only return -1, 0, 1.

@yorinasub17
Copy link
Contributor Author

Good question. I was thinking the way to know which (how many) updates to apply would be derived from the difference in versions. 🤔 I am not sure if that's possible. I think the .Compare function might only return -1, 0, 1.

Wouldn't that be much more confusing as a maintainer? E.g., you now have to do the math to update the -N number everytime a new backward incompatible update is released.

@yorinasub17
Copy link
Contributor Author

Ok integration testing branch passed, so will go ahead and merge this in! Thanks for the review!

@yorinasub17 yorinasub17 merged commit 9def8a0 into master Jun 15, 2021
@yorinasub17 yorinasub17 deleted the yori-coredns-update branch June 15, 2021 20:45
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.

CoreDNS 1.8.3 update requires clusterrole patch
2 participants