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

apps sc & wc: improve dry-run and deploy scripts #431

Merged
merged 1 commit into from
Jun 14, 2021

Conversation

robinelastisys
Copy link
Contributor

@robinelastisys robinelastisys commented May 5, 2021

What this PR does / why we need it:
The dry-run.sh and deploy scripts we currently use will not check against the actual state of the cluster. We are now adding commando flags to enable the option of using sync if a user want to.

Which issue this PR fixes
fixes #382

Message to reviewers
Im not sure if this is the right way to do it. This was the closest i could figure out. Feel free to point me out in the right direction if needed.

Checklist:

  • Added relevant notes to WIP-CHANGELOG.md
  • Proper commit message prefix on all commits
  • Some test is done to check if the problem still persists.

@robinelastisys robinelastisys self-assigned this May 5, 2021
@robinelastisys robinelastisys force-pushed the Improve-dry-run-and-apply-scripts branch 2 times, most recently from 42e1130 to 1fdb78d Compare May 5, 2021 13:29
Copy link
Contributor

@simonklb simonklb left a comment

Choose a reason for hiding this comment

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

Mostly looking for explanations. Otherwise this looks fine!

bin/dry-run.bash Outdated Show resolved Hide resolved
scripts/deploy-sc.sh Outdated Show resolved Hide resolved
WIP-CHANGELOG.md Outdated Show resolved Hide resolved
@robinelastisys robinelastisys force-pushed the Improve-dry-run-and-apply-scripts branch from 1fdb78d to 1740d56 Compare May 5, 2021 14:30
bin/dry-run.bash Outdated Show resolved Hide resolved
bin/dry-run.bash Outdated Show resolved Hide resolved
@robinelastisys robinelastisys force-pushed the Improve-dry-run-and-apply-scripts branch 2 times, most recently from 003800c to dacf6f7 Compare May 6, 2021 08:24
@lentzi90 lentzi90 removed their request for review May 7, 2021 09:56
@robinelastisys
Copy link
Contributor Author

We had a meeting with the outcome:

The changes could be activated by using a command flag

@robinelastisys robinelastisys force-pushed the Improve-dry-run-and-apply-scripts branch 2 times, most recently from 193f254 to 34d6e2f Compare June 1, 2021 12:30
@robinelastisys
Copy link
Contributor Author

Now i have presented a start of a solution. Not the most beautiful but it works. "apply-sync" and "dry-run-sync".

Copy link
Contributor

@Xartos Xartos left a comment

Choose a reason for hiding this comment

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

Would it be possible to instead of introducing a new command, having a flag instread? Like

$ bin/ck8s apply --sync

I guess something like getops would be something but that doesn't support long arguments (only single letter). If it's not feasable I'm okey with this approach as well.

I would also like to rename the dry-run-sync to dry-run-kubectl since it has nothing to do with sync.
There's also some formatting issues I have commented on

bin/ck8s Outdated Show resolved Hide resolved
bin/apps.bash Outdated Show resolved Hide resolved
bin/apps.bash Outdated Show resolved Hide resolved
bin/apps.bash Outdated Show resolved Hide resolved
bin/apps.bash Outdated Show resolved Hide resolved
bin/apps.bash Outdated Show resolved Hide resolved
bin/dry-run.bash Outdated Show resolved Hide resolved
bin/dry-run.bash Outdated Show resolved Hide resolved
@robinelastisys robinelastisys force-pushed the Improve-dry-run-and-apply-scripts branch 2 times, most recently from 1a5bfc9 to c1d537e Compare June 3, 2021 12:12
@robinelastisys
Copy link
Contributor Author

robinelastisys commented Jun 3, 2021

So, now i have done a lot of changes.

  1. I changed from apply-sync and dry-run-sync to --sync and --kubectl.
  2. I changed the if-cases to go by "${1:-""}" instead of if-case series.
  3. I did some string checks at the entry point of apps.bash and in deploy-wc & sc for further development if/when more flags come.
  4. Reverted indention of ck8s.

@robinelastisys robinelastisys force-pushed the Improve-dry-run-and-apply-scripts branch from c1d537e to 3d0e2f4 Compare June 3, 2021 12:56
Copy link
Contributor

@Xartos Xartos left a comment

Choose a reason for hiding this comment

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

This really starts to look good! There are still some things left though.

scripts/deploy-wc.sh Outdated Show resolved Hide resolved
bin/dry-run.bash Outdated Show resolved Hide resolved
bin/ck8s Show resolved Hide resolved
@robinelastisys robinelastisys force-pushed the Improve-dry-run-and-apply-scripts branch 6 times, most recently from e2b5dc8 to f21e149 Compare June 7, 2021 11:45
Copy link
Contributor

@Xartos Xartos left a comment

Choose a reason for hiding this comment

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

Just some minor details

bin/apps.bash Outdated Show resolved Hide resolved
bin/apps.bash Outdated Show resolved Hide resolved
bin/apps.bash Outdated Show resolved Hide resolved
bin/apps.bash Outdated Show resolved Hide resolved
@robinelastisys robinelastisys force-pushed the Improve-dry-run-and-apply-scripts branch from f21e149 to 157b988 Compare June 10, 2021 09:02
@robinelastisys
Copy link
Contributor Author

robinelastisys commented Jun 10, 2021

Done! Looks a lot smoother now indeed! 😄 👍

@robinelastisys robinelastisys force-pushed the Improve-dry-run-and-apply-scripts branch from 157b988 to 63e8cbd Compare June 10, 2021 09:09
Copy link
Contributor

@Xartos Xartos left a comment

Choose a reason for hiding this comment

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

I only have some formatting issues now but otherwise this looks great!

bin/ck8s Outdated Show resolved Hide resolved
bin/ck8s Outdated Show resolved Hide resolved
bin/ck8s Outdated Show resolved Hide resolved
bin/apps.bash Outdated Show resolved Hide resolved
bin/apps.bash Outdated Show resolved Hide resolved
bin/dry-run.bash Outdated Show resolved Hide resolved
bin/dry-run.bash Outdated Show resolved Hide resolved
bin/dry-run.bash Outdated Show resolved Hide resolved
scripts/clean-wc.sh Outdated Show resolved Hide resolved
scripts/deploy-sc.sh Outdated Show resolved Hide resolved
@robinelastisys robinelastisys force-pushed the Improve-dry-run-and-apply-scripts branch from 63e8cbd to 0945230 Compare June 10, 2021 12:25
@robinelastisys
Copy link
Contributor Author

Done! 😄

Copy link
Contributor

@Xartos Xartos left a comment

Choose a reason for hiding this comment

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

Just the last few things 😅

bin/ck8s Outdated Show resolved Hide resolved
bin/dry-run.bash Outdated Show resolved Hide resolved
bin/apps.bash Outdated Show resolved Hide resolved
bin/ck8s Outdated Show resolved Hide resolved
bin/ck8s Outdated Show resolved Hide resolved
bin/ck8s Outdated Show resolved Hide resolved
WIP-CHANGELOG.md Outdated Show resolved Hide resolved
@robinelastisys robinelastisys force-pushed the Improve-dry-run-and-apply-scripts branch from 0945230 to 614f212 Compare June 10, 2021 14:18
bin/ck8s Outdated Show resolved Hide resolved
bin/ck8s Outdated Show resolved Hide resolved
bin/ck8s Outdated Show resolved Hide resolved
@robinelastisys robinelastisys force-pushed the Improve-dry-run-and-apply-scripts branch from 614f212 to 6d257c3 Compare June 11, 2021 09:07
@OlleLarsson
Copy link
Contributor

Please resolve some of the comments that's been fixed. A bit cumbersome to overview the pr ;)

bin/apps.bash Show resolved Hide resolved
bin/apps.bash Show resolved Hide resolved
@robinelastisys robinelastisys force-pushed the Improve-dry-run-and-apply-scripts branch from 6d257c3 to a182ce7 Compare June 11, 2021 09:23
Copy link
Contributor

@viktor-f viktor-f left a comment

Choose a reason for hiding this comment

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

LGTM, well done!

Copy link
Contributor

@simonklb simonklb left a comment

Choose a reason for hiding this comment

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

LGTM! Nice :)

@robinelastisys robinelastisys force-pushed the Improve-dry-run-and-apply-scripts branch from a182ce7 to 233757e Compare June 14, 2021 06:55
Copy link
Contributor

@Xartos Xartos left a comment

Choose a reason for hiding this comment

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

LGTM! Great work

@robinelastisys robinelastisys force-pushed the Improve-dry-run-and-apply-scripts branch from ec021a6 to 63039ac Compare June 14, 2021 07:14
@robinelastisys robinelastisys merged commit d0d9748 into main Jun 14, 2021
@robinelastisys robinelastisys deleted the Improve-dry-run-and-apply-scripts branch June 14, 2021 07:17
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.

[1] Improve diff in dryrun script
5 participants