Skip to content

fix: clean balancer #249

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

Merged
merged 9 commits into from
Jun 29, 2023
Merged

fix: clean balancer #249

merged 9 commits into from
Jun 29, 2023

Conversation

osamamagdy
Copy link

@osamamagdy osamamagdy commented May 20, 2023

Thank you for submitting a pull request to the WrongSecrets Party!

What kind of changes does this PR include?

Checklist:

  • All the contributions made are solely the work of me and my co-authors
  • I tested the changes in this PR (if applicable)
  • I added tests to ensure my change works (if applicable)
  • The PR passes pre-commit hooks and automated tests

Description:

  • Added package.json so we can test with some frequent commands like helm template and helm install --dry-run which will be npm run template and npm run dry-run respectively.
  • Added a test-values.yaml file to try how values can be overridden by other values different than the original values.yaml
  • Generating test.tmp.yaml which is the generated k8s manifests by helm to detect any changes I can make by mistake in the future ( we don't want to change the generated manifests during the clean-up process)
  • Removing hardcoded securityContext from the balancer deployment in both the container specs and pod specs (taken from values files)
  • Making the env section a loop that iterates over all env values in values files

@osamamagdy osamamagdy force-pushed the cleanup-helm-chart branch 2 times, most recently from 5fd17cc to 53507ac Compare May 20, 2023 09:28
@osamamagdy
Copy link
Author

The file test.tmp.yaml fails the pre-commit check as it contains multiple files. Can we make this file the only exception?

Copy link
Collaborator

@commjoen commjoen left a comment

Choose a reason for hiding this comment

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

Hi @osamamagdy ! Love the steps forward!
Here are my 2 cents. @bendehaan can you please have a look at them and see if you agree ? (Eg balancer things in deployment and helm chart, while namespaced things need to undergo exactly this transformation to all things config.json). And then maybe extract more from code (hardcoded) for the namespaced objects and move to the config.json?)

@bendehaan
Copy link
Collaborator

The file test.tmp.yaml fails the pre-commit check as it contains multiple files. Can we make this file the only exception?

We could specifically set --allow-multiple-documents just for this file. That would mean changing the pre-commit config to something like this (note, untested 🙃):

      - id: check-yaml
        exclude: ^helm/wrongsecrets-ctf-party/templates/|^test.tmp.yaml)
      - id: check-yaml
        include: ^test.tmp.yaml
        with: 
          - --allow-multiple-documents

Signed-off-by: osamamagdy <[email protected]>
@osamamagdy osamamagdy force-pushed the cleanup-helm-chart branch from 53507ac to bb5dba6 Compare May 26, 2023 11:36
@osamamagdy osamamagdy requested a review from commjoen May 26, 2023 11:38
@osamamagdy
Copy link
Author

The file test.tmp.yaml fails the pre-commit check as it contains multiple files. Can we make this file the only exception?

We could specifically set --allow-multiple-documents just for this file. That would mean changing the pre-commit config to something like this (note, untested 🙃):

      - id: check-yaml
        exclude: ^helm/wrongsecrets-ctf-party/templates/|^test.tmp.yaml)
      - id: check-yaml
        include: ^test.tmp.yaml
        with: 
          - --allow-multiple-documents

@bendehaan I applied those changes but I gues it won't take effect until you merge it first

@bendehaan
Copy link
Collaborator

I applied those changes but I gues it won't take effect until you merge it first

@osamamagdy made some changes to the pre-commit config, should work now :)

@osamamagdy osamamagdy force-pushed the cleanup-helm-chart branch from e93db11 to 5517382 Compare June 4, 2023 21:08
@osamamagdy osamamagdy force-pushed the cleanup-helm-chart branch from 5517382 to ebaf779 Compare June 17, 2023 16:15
@osamamagdy osamamagdy force-pushed the cleanup-helm-chart branch from ebaf779 to e20976f Compare June 19, 2023 13:43
@commjoen
Copy link
Collaborator

Can you please update with master, resolve teh conflicts so we can do the final review please?

@osamamagdy
Copy link
Author

osamamagdy commented Jun 24, 2023

Can you please update with master, resolve teh conflicts so we can do the final review please?

@commjoen Done

Copy link
Collaborator

@bendehaan bendehaan left a comment

Choose a reason for hiding this comment

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

Nice progress! Could you add the two test files to gitignore? You don't have to delete them, but that way they won't clutter the public repository.

@osamamagdy osamamagdy force-pushed the cleanup-helm-chart branch from 8284bff to b2c5e75 Compare June 24, 2023 09:34
@osamamagdy
Copy link
Author

osamamagdy commented Jun 24, 2023

Nice progress! Could you add the two test files to gitignore? You don't have to delete them, but that way they won't clutter the public repository.

@bendehaan If there are no other issues with this PR, I will delete them completely before merging (not needed with closing the PR).
@commjoen Are there any other issues?

Signed-off-by: osamamagdy <[email protected]>
@osamamagdy osamamagdy force-pushed the cleanup-helm-chart branch from b2c5e75 to 2a269f8 Compare June 26, 2023 10:07
@osamamagdy
Copy link
Author

@bendehaan I deleted the two tests files

@commjoen commjoen merged commit 153e419 into OWASP:main Jun 29, 2023
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.

3 participants