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

feat: add dnsConfig to Atlantis #397

Merged
merged 11 commits into from
Jun 18, 2024

Conversation

sirpalmeirao
Copy link
Contributor

what

Adds dnsConfig property on Atlantis.

why

Allows dns resolution for specific domains.

tests

unit tests made successfully.

Installed plugin: unittest

### Chart [ atlantis ] ./charts/atlantis

 PASS  test pvc charts/atlantis/tests/pvc_test.yaml
 PASS  test secret-api for api secret   charts/atlantis/tests/secret-api_test.yaml
 PASS  test secret-aws for aws  charts/atlantis/tests/secret-aws_test.yaml
 PASS  test secret-basic-auth for git basic-auth secret charts/atlantis/tests/secret-basic-auth_test.yaml
 PASS  test secret-gitconfig for gitconfig      charts/atlantis/tests/secret-gitconfig_test.yaml
 PASS  test secret-netrc for netrc      charts/atlantis/tests/secret-netrc_test.yaml
 PASS  test secret-service-account for serviceAccountSecrets    charts/atlantis/tests/secret-service-account_test.yaml
 PASS  test secret-webhook for git webhook secret       charts/atlantis/tests/secret-webhook_test.yaml
 PASS  test service     charts/atlantis/tests/service_test.yaml
 PASS  test statefulset charts/atlantis/tests/statefulset_test.yaml

references

@sirpalmeirao sirpalmeirao marked this pull request as ready for review June 14, 2024 10:49
@sirpalmeirao sirpalmeirao requested a review from a team as a code owner June 14, 2024 10:49
@GMartinez-Sisti
Copy link
Member

Hi @sirpalmeirao, thanks for the contribution 😄 Can you please bump minor on Chart.yaml since this is a new feature?

@sirpalmeirao
Copy link
Contributor Author

Hey @GMartinez-Sisti sure. Already made that change. 🙏

@sirpalmeirao
Copy link
Contributor Author

dnsPolicy added:

### Chart [ atlantis ] ./charts/atlantis

 PASS  test pvc charts/atlantis/tests/pvc_test.yaml
 PASS  test secret-api for api secret   charts/atlantis/tests/secret-api_test.yaml
 PASS  test secret-aws for aws  charts/atlantis/tests/secret-aws_test.yaml
 PASS  test secret-basic-auth for git basic-auth secret charts/atlantis/tests/secret-basic-auth_test.yaml
 PASS  test secret-gitconfig for gitconfig      charts/atlantis/tests/secret-gitconfig_test.yaml
 PASS  test secret-netrc for netrc      charts/atlantis/tests/secret-netrc_test.yaml
 PASS  test secret-service-account for serviceAccountSecrets    charts/atlantis/tests/secret-service-account_test.yaml
 PASS  test secret-webhook for git webhook secret       charts/atlantis/tests/secret-webhook_test.yaml
 PASS  test service     charts/atlantis/tests/service_test.yaml
 PASS  test statefulset charts/atlantis/tests/statefulset_test.yaml

Charts:      1 passed, 1 total
Test Suites: 10 passed, 10 total
Tests:       84 passed, 84 total
Snapshot:    0 passed, 0 total
Time:        354.283208ms

Copy link
Member

@GMartinez-Sisti GMartinez-Sisti left a comment

Choose a reason for hiding this comment

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

Hi @sirpalmeirao, the CI failed because helm-docs needs to be match the result of the check. We prefer to have specific values for keys so they are not comments. WDYT of this method? If the suggested logic does what I think it will, there will be no changes for existing deployments, unless dnsPolicy is changed and dnsConfig is populated.

charts/atlantis/values.yaml Outdated Show resolved Hide resolved
charts/atlantis/templates/statefulset.yaml Outdated Show resolved Hide resolved
sirpalmeirao and others added 3 commits June 18, 2024 11:18
Co-authored-by: Gabriel Martinez <19713226+GMartinez-Sisti@users.noreply.github.com>
Co-authored-by: Gabriel Martinez <19713226+GMartinez-Sisti@users.noreply.github.com>
@sirpalmeirao
Copy link
Contributor Author

sirpalmeirao commented Jun 18, 2024

Hi @sirpalmeirao, the CI failed because helm-docs needs to be match the result of the check. We prefer to have specific values for keys so they are not comments. WDYT of this method? If the suggested logic does what I think it will, there will be no changes for existing deployments, unless dnsPolicy is changed and dnsConfig is populated.

Regarding the method LGTM! 👍
I've made some changes and add the choices to the dnsPolicy on the schema file to avoid people to put values that are not acceptable. Also I change the conditional clause so that ClusterFirst don't show when we put as the value of the variable dnsPolicy since it is the default and add a fail to warn people that when you put dnsPolicy to None you must configure dnsConfig as well. Example:

Error: execution error at (atlantis/templates/statefulset.yaml:49:10): dnsPolicy is set to 'None', but dnsConfig is not provided

Use --debug flag to render out invalid YAML

unit tests:

unittest        0.3.6   Unit test for helm chart in YAML with ease to keep your chart functional and robust.

### Chart [ atlantis ] ./charts/atlantis

 PASS  test pvc charts/atlantis/tests/pvc_test.yaml
 PASS  test secret-api for api secret   charts/atlantis/tests/secret-api_test.yaml
 PASS  test secret-aws for aws  charts/atlantis/tests/secret-aws_test.yaml
 PASS  test secret-basic-auth for git basic-auth secret charts/atlantis/tests/secret-basic-auth_test.yaml
 PASS  test secret-gitconfig for gitconfig      charts/atlantis/tests/secret-gitconfig_test.yaml
 PASS  test secret-netrc for netrc      charts/atlantis/tests/secret-netrc_test.yaml
 PASS  test secret-service-account for serviceAccountSecrets    charts/atlantis/tests/secret-service-account_test.yaml
 PASS  test secret-webhook for git webhook secret       charts/atlantis/tests/secret-webhook_test.yaml
 PASS  test service     charts/atlantis/tests/service_test.yaml
 PASS  test statefulset charts/atlantis/tests/statefulset_test.yaml

Charts:      1 passed, 1 total
Test Suites: 10 passed, 10 total
Tests:       84 passed, 84 total
Snapshot:    0 passed, 0 total
Time:        342.748125ms

Copy link
Member

@GMartinez-Sisti GMartinez-Sisti left a comment

Choose a reason for hiding this comment

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

Thanks @sirpalmeirao

@GMartinez-Sisti GMartinez-Sisti merged commit 7b0c398 into runatlantis:main Jun 18, 2024
2 checks passed
@sirpalmeirao sirpalmeirao deleted the dnsconfig branch June 19, 2024 10:44
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.

None yet

2 participants