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

Fix KUBERNETES_VERSION unset if CLUSTER_TEMPLATE set #2346

Conversation

lzhecheng
Copy link
Contributor

@lzhecheng lzhecheng commented Jun 2, 2022

Signed-off-by: Zhecheng Li [email protected]

What type of PR is this?
/kind bug

What this PR does / why we need it:

  • If CLUSTER_TEMPLATE is set, the ci-entrypoint.sh logic
    leads to KUBERNETES_VERSION error like "vlatest".
  • Dump AZURE_LOCATION abd kubectl get node result.
  • Not overwrite original K8S_FEATURE_GATES if TEST_WINDOWS is true
    related: Deprecate aks-engine e2e test cloud-provider-azure#919
    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:

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

Fix: If CLUSTER_TEMPLATE is set, the ci-entrypoint.sh logic, leads to KUBERNETES_VERSION error like "vlatest". Dump AZURE_LOCATION abd kubectl get node, pod results. Not overwrite original K8S_FEATURE_GATES if TEST_WINDOWS is true

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 2, 2022
@lzhecheng
Copy link
Contributor Author

/cc @CecileRobertMichon @jackfrancis

@lzhecheng lzhecheng force-pushed the fix-k8s-version-unset-if-cluster-template-set branch from 7e2ca9b to 5226265 Compare June 2, 2022 03:54
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 2, 2022
@jackfrancis
Copy link
Contributor

Thanks @lzhecheng!

Can we merge #2325 first, as that follows-up test-infra changes that have recently landed.

Then we can address the issue of separating "choosing a template" from "choosing a kubernetes version" in this script.

@Jont828
Copy link
Contributor

Jont828 commented Jun 2, 2022

@jackfrancis Would that require a rebase of this PR or would the logic mostly stay the same?

@jackfrancis
Copy link
Contributor

A rebase is almost certainly going to be required. :/

@lzhecheng
Copy link
Contributor Author

@jackfrancis sure :)

@lzhecheng
Copy link
Contributor Author

/retest

@@ -58,10 +58,26 @@ setup() {
if [[ -z "${CLUSTER_TEMPLATE:-}" ]]; then
select_cluster_template
fi
if [[ -n "${CI_VERSION:-}" ]] || [[ -n "${USE_CI_ARTIFACTS:-}" ]] || [[ "${KUBERNETES_VERSION:-}" =~ "latest" ]]; then
GOPATH="$(go env GOPATH)"
if ls "${GOPATH}"/src/k8s.io/kubernetes; then
Copy link
Contributor

Choose a reason for hiding this comment

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

#2325 has merged, this should be good to go after rebase

Copy link
Contributor

Choose a reason for hiding this comment

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

@lzhecheng thank you for your patience ❤️

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 4, 2022
@lzhecheng lzhecheng force-pushed the fix-k8s-version-unset-if-cluster-template-set branch from 5226265 to 1ad9a35 Compare June 4, 2022 01:29
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 4, 2022
@lzhecheng lzhecheng changed the title Fix KUBERNETES_VERSION unset if CLUSTER_TEMPLATE set [WIP] Fix KUBERNETES_VERSION unset if CLUSTER_TEMPLATE set Jun 4, 2022
@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 Jun 4, 2022
@lzhecheng lzhecheng force-pushed the fix-k8s-version-unset-if-cluster-template-set branch 2 times, most recently from 64d9080 to 501a956 Compare June 5, 2022 02:54
@lzhecheng
Copy link
Contributor Author

/retest

@lzhecheng lzhecheng force-pushed the fix-k8s-version-unset-if-cluster-template-set branch from 501a956 to c55b59e Compare June 6, 2022 02:49
@lzhecheng lzhecheng changed the title [WIP] Fix KUBERNETES_VERSION unset if CLUSTER_TEMPLATE set Fix KUBERNETES_VERSION unset if CLUSTER_TEMPLATE set Jun 6, 2022
@lzhecheng lzhecheng force-pushed the fix-k8s-version-unset-if-cluster-template-set branch from c55b59e to 13bf413 Compare June 7, 2022 01:46
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 7, 2022
@lzhecheng lzhecheng force-pushed the fix-k8s-version-unset-if-cluster-template-set branch 7 times, most recently from 829fa85 to c3a7573 Compare June 7, 2022 09:00
@lzhecheng
Copy link
Contributor Author

ci-entrypoint is failing:

# Create workload Cluster.
cluster.cluster.x-k8s.io/capz-hwobgi created
azurecluster.infrastructure.cluster.x-k8s.io/capz-hwobgi created
error: error parsing STDIN: error converting YAML to JSON: yaml: line 12: did not find expected node content
make[1]: *** [Makefile:285: create-workload-cluster] Error 1
make[1]: Leaving directory '/home/prow/go/src/sigs.k8s.io/cluster-api-provider-azure'

Thanks. Now it is fixed.

Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

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

Looks great, thanks @lzhecheng. Just one more comment about the on_exit get pods/nodes returning a non-zero exit code.

/assign @jackfrancis

* If CLUSTER_TEMPLATE is set, the ci-entrypoint.sh logic
  leads to KUBERNETES_VERSION error like "vlatest".
* Dump AZURE_LOCATION abd kubectl get node result.
* Not overwrite original K8S_FEATURE_GATES if TEST_WINDOWS is true

Signed-off-by: Zhecheng Li <[email protected]>
@lzhecheng lzhecheng force-pushed the fix-k8s-version-unset-if-cluster-template-set branch from c3a7573 to 3f3ff9f Compare June 7, 2022 14:47
Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 7, 2022
Copy link
Contributor

@jackfrancis jackfrancis left a comment

Choose a reason for hiding this comment

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

/lgtm

I like the way these iterations are trending, thanks @lzhecheng!

@jackfrancis
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jackfrancis

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 7, 2022
@k8s-ci-robot k8s-ci-robot merged commit 96a16ef into kubernetes-sigs:main Jun 7, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.4 milestone Jun 7, 2022
@lzhecheng lzhecheng deleted the fix-k8s-version-unset-if-cluster-template-set branch June 8, 2022 00:59
@jackfrancis
Copy link
Contributor

/cherry-pick release-1.3

@k8s-infra-cherrypick-robot

@jackfrancis: #2346 failed to apply on top of branch "release-1.3":

Applying: Fix KUBERNETES_VERSION unset if CLUSTER_TEMPLATE set * If CLUSTER_TEMPLATE is set, the ci-entrypoint.sh logic leads to KUBERNETES_VERSION error like "vlatest". * Dump AZURE_LOCATION abd kubectl get node result. * Not overwrite original K8S_FEATURE_GATES if TEST_WINDOWS is true
Using index info to reconstruct a base tree...
M	scripts/ci-entrypoint.sh
Falling back to patching base and 3-way merge...
Auto-merging scripts/ci-entrypoint.sh
CONFLICT (content): Merge conflict in scripts/ci-entrypoint.sh
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Fix KUBERNETES_VERSION unset if CLUSTER_TEMPLATE set * If CLUSTER_TEMPLATE is set, the ci-entrypoint.sh logic leads to KUBERNETES_VERSION error like "vlatest". * Dump AZURE_LOCATION abd kubectl get node result. * Not overwrite original K8S_FEATURE_GATES if TEST_WINDOWS is true
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.3

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants