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

WIP: Update docs on updating clusterctl API version upgrade tests #4996

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

willie-yao
Copy link
Contributor

What type of PR is this?
/kind documentation

What this PR does / why we need it:
This PR updates documentation on how to update the clusterctl API version upgrade tests on a new release. Previously the docs were pointing to the wrong place for updating versions, as well as not including guidance on how to update the cluster-template-prow.yaml that the test was using.

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 #

Special notes for your reviewer:

  • cherry-pick candidate

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/documentation Categorizes issue or PR as related to documentation. labels Jul 17, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from willie-yao. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 17, 2024
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jul 17, 2024
Update the [API version upgrade tests](https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/v1.12.1/test/e2e/capi_test.go#L214) to use the oldest supported release versions of CAPI and CAPZ after the release is cut as "Init" provider versions. See [this PR](https://github.com/kubernetes-sigs/cluster-api-provider-azure/pull/4433) for more details.
Update the provider versions for the [API version upgrade tests](https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/v1.16.0/test/e2e/common.go#L94-L95) to use the latest patch release of the previous two minor releases. See [this PR](https://github.com/kubernetes-sigs/cluster-api-provider-azure/pull/4873) for more details.

The two versioned prow templates within `test/e2e/data/infrastructure-azure` should be updated to `templates/test/ci/cluster-template-prow.yaml` at the respective version. For example, if we're updating `v1.14.4` to `v1.14.5`, then `cluster-template-prow.yaml` should be moved from `test/e2e/data/infrastructure-azure/v1.14.4` to `test/e2e/data/infrastructure-azure/v1.14.5`, and contain the same contents as `templates/test/ci/cluster-template-prow.yaml`.
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this describes the nuance that the template in test/e2e/data/infrastructure-azure/v* needs to keep its AzureClusterIdentity and not use the one from templates/test/ci/cluster-template-prow.yaml. Instead of updating this doc for now, I'd rather see if we can get kustomize to start generating these templates and automatically take care of that. Explaining that in plain language here is going to make this too cumbersome IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I can pivot this PR to get kustomize to generate it, since leaving these docs are outdated as-is. So the template is templates/test/ci/cluster-template-prow.yaml but with the AzureClusterIdentity from test/e2e/data/infrastructure-azure/v*?

Copy link
Contributor

Choose a reason for hiding this comment

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

The formula we'd want is templates/test/ci/cluster-template-prow.yaml + this patch:

diff --git a/test/e2e/data/infrastructure-azure/v1.15.1/cluster-template-prow.yaml b/test/e2e/data/infrastructure-azure/v1.15.1/cluster-template-prow.yaml
index abcfffe4f..af51d864c 100644
--- a/test/e2e/data/infrastructure-azure/v1.15.1/cluster-template-prow.yaml
+++ b/test/e2e/data/infrastructure-azure/v1.15.1/cluster-template-prow.yaml
@@ -381,9 +381,10 @@ metadata:
   namespace: default
 spec:
   allowedNamespaces: {}
-  clientID: ${AZURE_CLIENT_ID_USER_ASSIGNED_IDENTITY}
+  clientID: ${AZURE_CLIENT_ID_CLOUD_PROVIDER}
+  resourceID: /subscriptions/${AZURE_SUBSCRIPTION_ID}/resourceGroups/${CI_RG:=capz-ci}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/${USER_IDENTITY:=cloud-provider-user-identity}
   tenantID: ${AZURE_TENANT_ID}
-  type: WorkloadIdentity
+  type: UserAssignedMSI
 ---
 apiVersion: addons.cluster.x-k8s.io/v1beta1
 kind: ClusterResourceSet

Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't super critical though, so maybe opening an issue for now is best while we iron out the rest of the failing tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created an issue #4997. Should I close this PR or just include the changes on line 204 to the docs so that it points to the correct files?

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's stand by to see how things shake out in #4992

Copy link

codecov bot commented Jul 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 51.18%. Comparing base (334aef3) to head (12bba90).
Report is 43 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4996   +/-   ##
=======================================
  Coverage   51.18%   51.18%           
=======================================
  Files         274      274           
  Lines       24625    24625           
=======================================
  Hits        12605    12605           
  Misses      11234    11234           
  Partials      786      786           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@willie-yao willie-yao changed the title Update docs on updating clusterctl API version upgrade tests WIP: Update docs on updating clusterctl API version upgrade tests Jul 17, 2024
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/documentation Categorizes issue or PR as related to documentation. release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

4 participants