-
Notifications
You must be signed in to change notification settings - Fork 9
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
Refactor update-ips script #1853
Conversation
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.
Dear god 😱 1090 lines of tests for this script, props to you to for doing this
b39b80d
to
3cb297c
Compare
Would it be possible in this PR to also add support for plain IPs for s3 instead of a domain? With the current script it produces a python exception. There have been some cases on-prem where we only get an IP. |
I don't want to introduce any functional changes as part of the refactoring. But I would be fine doing it as a separate change. Do we have an issue for it? |
No never created one, but I'll do it now. |
Issue here #1857 |
46d4c1a
to
4bef2fa
Compare
One functional change has been made: |
e832126
to
a85654c
Compare
@linus-astrom proposed elsewhere to sort IPs which I thought was a good idea. Currently they are not sorted, with this they should be. b30859e Let me know what the rest of you think! |
f6ca7ae
to
f0ff3a6
Compare
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.
Huge improvement!
Would love it if you could dry-run on a few of your environments to verify that nothing diffs (except for maybe the IPs being reordered due to the new sorting). Especially those with Swift and/or RClone enabled! |
Tested it on a few environments and it works well, including Swift + Rclone 👍 |
57986d6
to
85f5e02
Compare
Warning
This is public repository, ensure not to disclose:
What kind of PR is this?
Required: Mark one of the following that is applicable:
Optional: Mark one or more of the following that are applicable:
Important
Breaking changes should be marked
kind/admin-change
orkind/dev-change
depending on typeCritical security fixes should be marked with
kind/security
What does this PR do / why do we need this PR?
Additional information to reviewers
Currently only added unit tests for the current state of the script and improved the error handling:
I wanted to a fairly extensive test coverage before I start refactoring to not accidentally break the script. However, due to the code complexity I had to do it more or less line by line because it was too hard to parse the functionality in a more cohesive way.
Would appreciate someone taking a look. At least checking the title of the test cases to see if it is covering the script appropriately.
Screenshots
Checklist
NetworkPolicy Dashboard