-
Notifications
You must be signed in to change notification settings - Fork 11
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 Milestone Job integration tests for Helm Chart #171
Conversation
8419795
to
da7ffc1
Compare
sed -e "s#{{ SECRETS_PROVIDER_ROLE }}#${SECRETS_PROVIDER_ROLE:-"secrets-provider-role"}#g" \ | ||
-e "s#{{ SECRETS_PROVIDER_ROLE_BINDING }}#${SECRETS_PROVIDER_ROLE_BINDING:-"secrets-provider-role-binding"}#g" \ | ||
-e "s#{{ SERVICE_ACCOUNT_CREATE }}#${SERVICE_ACCOUNT_CREATE:-"true"}#g" \ | ||
-e "s#{{ SERVICE_ACCOUNT }}#${SERVICE_ACCOUNT:-"secrets-provider-service-account"}#g" \ | ||
-e "s#{{ K8S_SECRETS }}#${K8S_SECRETS:-"test-k8s-secret"}#g" \ | ||
-e "s#{{ CONJUR_ACCOUNT }}#${CONJUR_ACCOUNT:-"cucumber"}#g" \ | ||
-e "s#{{ CONJUR_APPLIANCE_URL }}#${CONJUR_APPLIANCE_URL:-"https://conjur-follower.${CONJUR_NAMESPACE_NAME}.svc.cluster.local/api"}#g" \ | ||
-e "s#{{ CONJUR_AUTHN_URL }}#${CONJUR_AUTHN_URL:-"https://conjur-follower.${CONJUR_NAMESPACE_NAME}.svc.cluster.local/api/authn-k8s/${AUTHENTICATOR_ID}"}#g" \ | ||
-e "s#{{ CONJUR_AUTHN_LOGIN }}# ${CONJUR_AUTHN_LOGIN:-"host/conjur/authn-k8s/${AUTHENTICATOR_ID}/apps/${APP_NAMESPACE_NAME}/*/*"}#g" \ | ||
-e "s#{{ SECRETS_PROVIDER_SSL_CONFIG_MAP }}# ${SECRETS_PROVIDER_SSL_CONFIG_MAP:-"secrets-provider-ssl-config-map"}#g" \ | ||
"secrets-provider-chart/ci/test-values-template.yaml" > "secrets-provider-chart/ci/test-values.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.
This looks messy.
You can make use of envsubst, which is a GNU tool, instead of this.
See for more info: https://stackoverflow.com/a/14157575
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 agree but since we are moving to BDD in the near future and this PR has been open for a while this seems less pressing.
This is part of a greater refactoring effort that could be addressed during our RD Boost days
0f7dcb1
to
e530601
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.
Nice work
Please go over the .sh files and ask yourself - if it was written in any other language, would I keep the code as it is now? would it pass your code review if it was ruby/js/go?
31b5d7b
to
0d25e50
Compare
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: test-k8s-secret-two |
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.
@sigalsax what's the purpose of this k8s secret? can't we use the one that we already have?
05e6d11
to
2b148ea
Compare
2b148ea
to
e45e7e9
Compare
verify_secret_value_in_pod $pod_name "TEST_SECRET" "supersecret" | ||
} | ||
|
||
function deploy_chart { |
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 prefer not having function in the test it self. We can use those functions in other tests as well now or in the future.
For example you always run fill_helm_chart and helm install maybe with different parameters but i prefer this file will be clean.
Moving from clean files to BDD in the future will be easier as well.
65170a5
to
b3b4036
Compare
- Adds integration tests as detailed in [solution design](https://github.com/cyberark/secrets-provider-for-k8s/blob/master/design/milestone_1_2_design_doc.md) - Adds helper utils needed to build K8s resource and Helm charts integration-tests-job-milestone (#171)
3d2c675
to
15d208d
Compare
- Adds ability to deploy the Secrets Provider via Helm for development environment - Updates reload script to support Helm flow - Adds cleanup of Helm charts between runs - Adds documentation on how to deploy with Helm
- Adds props for Helm tests including create Conjur and K8s/Openshift resources for test use - Adds ci folder for overriding Helm chart defaults dynamically
- Adds integration tests as detailed in [solution design](https://github.com/cyberark/secrets-provider-for-k8s/blob/master/design/milestone_1_2_design_doc.md) - Adds helper utils needed to build K8s resource and Helm charts integration-tests-job-milestone (#171)
7dcb1c8
to
5490d28
Compare
- Adds integration tests as detailed in [solution design](https://github.com/cyberark/secrets-provider-for-k8s/blob/master/design/milestone_1_2_design_doc.md) - Adds helper utils needed to build K8s resource and Helm charts integration-tests-job-milestone (#171)
8cc4ddf
to
d35a65c
Compare
if (( $duration >= $retryIntervalMin && $duration <= $retryIntervalMax )); then | ||
echo 0 | ||
else | ||
echo 1 |
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.
We need to add here the times in logs. If we will fail we need to understand the reason.
884c2ca
to
39db4c6
Compare
39db4c6
to
7444d4e
Compare
Code Climate has analyzed commit 7444d4e and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 86.6% (0.0% change). View more on Code Climate. |
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 from test perspective
This PR adds integration tests for the Milestone Job for the Secrets Provider
** NOTE that tests will not on Jenkins because Helm chart was not pushed.
You can run tests manually by:
You need Helm chart locally to run helm chart successfully. you can check out locally via
git checkout origin/helm-chart-phase-2 -- secrets-provider
Run
./bin/start --oss --gke