-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add the yaml env load #835
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.
Great initiative !!!!
need to update the readme file how to run podman using -v yaml file
.gitignore
Outdated
@@ -218,3 +218,4 @@ empty_test_environment_variables.py | |||
/cloud_governance/policy/send_mail.py | |||
cloudsensei/.env.txt | |||
.vscode | |||
cloud_governance/main/env.yaml |
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.
Where did u put this file
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.
inside the main folder
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.
Sorry I dont see it
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.
I added to .gitignore file that's why it is hidden.
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.
@athiruma ,
cloud_governance/main/env.yaml
: remove from .gitignore and it should be filled with default/empty values
cloud_governance/main/test_env.yaml
: add to .gitignore and it should be filled with real values
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.
No need to maintain 2 files, we can use test_env.yaml. In the readme, we will mention creating a copy of
cp test_env.yaml env_yaml
and change appropriate values.
9e2f76f
to
11092cd
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.
Pls add to readme file how to run the container using env.yaml instead of passing environment variable to the container
cloud_governance/main/test_env.yaml
Outdated
@@ -0,0 +1,167 @@ | |||
policy: "" |
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.
I think it should be env.yaml
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.
The one should copy to env.yaml and pass only defined values.
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.
@athiruma, do you want to update readme documentation with yaml option ?
59f3a65
to
7525c93
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.
@athiruma, Can you pls add e2e test that using yaml file ?
7525c93
to
b0d6eb7
Compare
Added |
b0d6eb7
to
ca3ed59
Compare
Will never override existing attributes. | ||
""" | ||
|
||
for yaml_file_path in (os.path.join(os.path.curdir, 'env.yaml'), self.DEFAULT_CONF_PATH): |
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.
searching file in current env.yaml
&& DEFAULT_CONF_PATH=/tmp/env.yaml
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.
/LGTM
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.
/LGTM
@@ -384,7 +384,15 @@ jobs: | |||
AWS_ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }} | |||
AWS_SECRET_ACCESS_KEY: ${{ secrets.SECRET_ACCESS_KEY }} | |||
run: | | |||
sudo podman run --rm --name cloud-governance -e policy=${{ matrix.policy }} -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY -e AWS_DEFAULT_REGION=${{ matrix.region }} -e dry_run=yes -e policy_output=s3://${{ secrets.BUCKET }}/test/${{ matrix.region }} -e log_level=INFO ${{ secrets.QUAY_PUBLIC_CLOUD_GOVERNANCE_REPOSITORY }} |
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.
@athiruma, I think we should run both yaml and env variabale, WDYT ?
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.
yeah it helps.
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.
Pls open new PR and double the e2e test yaml + env
Total should be 104 tests
Type of change
Note: Fill x in []
Description
Add environment variables load by yaml file.
For security reasons, all pull requests need to be approved first before running any automated CI