-
Notifications
You must be signed in to change notification settings - Fork 430
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
Use CAAPH to install cloud-provider-azure in tests #4413
Use CAAPH to install cloud-provider-azure in tests #4413
Conversation
Need to run more tests on this after the holidays but opening for a first round of review |
862a0be
to
44c4e3e
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4413 +/- ##
=======================================
Coverage 61.96% 61.96%
=======================================
Files 188 188
Lines 18768 18768
=======================================
Hits 11630 11630
Misses 6500 6500
Partials 638 638 ☔ View full report in Codecov by Sentry. |
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.
Looking good so far!
Btw if you decide to set default placeholder for the CI artifact environment variables at the BeforeEach
, I added it to azure_test.go, capi_test.go, conformance_test.go, and azure_selfhosted.go. If not, disregard the previous sentence.
scripts/ci-entrypoint.sh
Outdated
export CLOUD_CONFIG="" | ||
export CONFIG_SECRET_NAME="azure-cloud-provider" | ||
export ENABLE_DYNAMIC_RELOADING=true | ||
copy_secret || return 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.
Q: What is the return 1
part for?
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.
It was in the original install_cloud_provider_azure
function to allow retrying the operation for transient failures:
# Any retryable operation in this function must return a non-zero exit code on failure so that we can
# retry it using a `until install_cloud_provider_azure; do sleep 5; done` pattern;
# and any statement must be idempotent so that subsequent retry attempts can make forward progress.
Since we're no longer retrying the function (it's part of setup now), I changed it to use until directly (the copy_secret
function itself returns 1 on failure).
--set cloudNodeManager.imageName="${CNM_IMAGE_NAME}" | ||
--set-string cloudControllerManager.imageTag="${IMAGE_TAG_CCM}" | ||
--set-string cloudNodeManager.imageTag="${IMAGE_TAG_CNM}") | ||
if [[ -n "${LOAD_CLOUD_CONFIG_FROM_SECRET:-}" ]]; then |
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.
Do we still want to use E2E_ARGS="-kubetest.use-ci-artifacts"
as the variable configuring the CI artifacts?
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.
should_build_ccm
already encompasses E2E_ARGS="-kubetest.use-ci-artifacts"
and other cases where we want to use a CI version of CCM in the context of ci-entrypoint.sh
https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/main/hack/util.sh#L44
imageName: ${CCM_IMAGE_NAME:-""} | ||
imageRepository: ${IMAGE_REGISTRY:-""} | ||
imageTag: ${IMAGE_TAG_CCM:-""} | ||
logVerbosity: ${CCM_LOG_VERBOSITY:-4} |
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'd need to verify this, but I'm not sure that envsubst supports setting default values when the variable isn't set (like in bash/zsh).
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.
logVerbosity: ${CCM_LOG_VERBOSITY:-4} | ||
replicas: ${CCM_COUNT:-1} | ||
enableDynamicReloading: ${ENABLE_DYNAMIC_RELOADING:-false} | ||
cloudNodeManager: |
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.
If it's possible to use bash if
logic, an alternative would be to move the CI artifacts field behind an if statement and leave it blank if it's false.
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.
It might be possible to use if
blocks but I'm not sure we'd gain in simplicity, having both addon versions as separate HelmChartProxies would also allow testing both versions side by side in the future.
So far no comments from my side. Please ping me if there's anything wrong in CI. |
ad6f9d6
to
37fc796
Compare
Squashed commits and removed [WIP], this is ready for review! |
/assign @Jont828 |
/retest |
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
Glad to see this is at the finish line!
LGTM label has been added. Git tree hash: 4151c263e6d72809ab59c931999dec5c52eac3c2
|
/test pull-cluster-api-provider-azure-e2e-optional |
templates/test/ci/cluster-template-prow-intree-cloud-provider.yaml
Outdated
Show resolved
Hide resolved
test/e2e/data/infrastructure-azure/v1beta1/bases/cloud-provider-azure-ci.yaml
Outdated
Show resolved
Hide resolved
@CecileRobertMichon Could you also please fill out the rest of the PR description? Mostly for posterity. |
/test pull-cluster-api-provider-azure-e2e-optional |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nojnhuh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
/hold cancel |
/retest apiversion test should be fixed now |
/hold for the upgrade test |
the upgrade test failed 🤔 /retest in case it's a flake, will look into it in parallel... |
Update: it was not a flake. The release name was different than the one we were using previously which caused issues with the upgrade test. Renamed to match the previous naming in the latest commit which should fix 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.
/lgtm
/hold for squash in addition to the upgrade test
LGTM label has been added. Git tree hash: 9a205db17a3d7f5b53ff6a67cb6696a01070b76b
|
/lgtm |
/retest |
@CecileRobertMichon tests passed, PSAYEC (please squash at your earliest convenience) |
1e00fa0
to
27ec5ec
Compare
/hold cancel squashed! |
/lgtm |
@CecileRobertMichon: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
What type of PR is this?
/kind cleanup
What this PR does / why we need it: Switch to using https://github.com/kubernetes-sigs/cluster-api-addon-provider-helm to install cloud-provider-azure components in test templates.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #3736
Special notes for your reviewer:
TODOs:
Release note: