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

improve kubeconfig/gcp handling of credentials in e2e tests #1404

Merged

Conversation

xrstf
Copy link
Contributor

@xrstf xrstf commented Aug 15, 2022

What this PR does / why we need it:
This PR ensures that we always inject a base64-encoded kubeconfig in the kubevirt config, even if (in the future) an unencoded kubeconfig was provided in the e2e tests / via env vars. The same careful handling was added to the GCP SA, which also needs to be base64-encoded, which was never mentioned anywhere.

Nothing changes for the users. This only affects our testing.

/kind cleanup
Does this PR introduce a user-facing change? Then add your Release Note here:

NONE

@kubermatic-bot kubermatic-bot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. approved Indicates a PR has been approved by an approver from all required OWNERS files. sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 15, 2022
Copy link
Member

@xmudrii xmudrii left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@kubermatic-bot kubermatic-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 15, 2022
@xrstf
Copy link
Contributor Author

xrstf commented Aug 15, 2022

/hold

@kubermatic-bot kubermatic-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 15, 2022
@kubermatic-bot kubermatic-bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 15, 2022
@kubermatic-bot kubermatic-bot added sig/osm Denotes a PR or issue as being assigned to SIG OSM. and removed approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 15, 2022
@xrstf xrstf changed the title make it clear where and how to base64 encode the kubevirt kubeconfig make it clear where and how to base64 encode the kubevirt kubeconfig / GCP SA Aug 15, 2022
@kubermatic-bot kubermatic-bot 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 Aug 15, 2022
@ahmedwaleedmalik
Copy link
Member

This PR ensures that we always inject a base64-encoded kubeconfig in the kubevirt config, even if (in the future) an unencoded kubeconfig was provided (which is what 99% of users will have at hand)

This statement is quite misleading. You are not mentioning that your change is only applicable to our "E2E tests". So for a normal user, this will have no effect.

@xrstf
Copy link
Contributor Author

xrstf commented Aug 15, 2022

So for a normal user, this will have no effect.

Yes, and that's a feature. I did not intend to break people's stuff. I only intend to fix our e2e stuff.

Copy link
Member

@xmudrii xmudrii left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@kubermatic-bot kubermatic-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 15, 2022
@xmudrii
Copy link
Member

xmudrii commented Aug 15, 2022

/lgtm cancel

@kubermatic-bot kubermatic-bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 15, 2022
@xrstf
Copy link
Contributor Author

xrstf commented Aug 15, 2022

/unhold

@kubermatic-bot kubermatic-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 15, 2022
@kubermatic-bot kubermatic-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 15, 2022
@kubermatic-bot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 47025ed3837e133f31bc7eda7bbbfb3b1b884503

Copy link
Member

@ahmedwaleedmalik ahmedwaleedmalik left a comment

Choose a reason for hiding this comment

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

/approve

@kubermatic-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahmedwaleedmalik, xmudrii, xrstf

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

@kubermatic-bot kubermatic-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 15, 2022
@xrstf xrstf changed the title make it clear where and how to base64 encode the kubevirt kubeconfig / GCP SA improve kubeconfig/gcp handling of credentials in e2e tests Aug 15, 2022
@xrstf
Copy link
Contributor Author

xrstf commented Aug 15, 2022

/override pull-machine-controller-e2e-openstack
/override pull-machine-controller-e2e-openstack-project-auth
/override pull-machine-controller-e2e-ubuntu-upgrade
/override pull-machine-controller-e2e-vsphere

@kubermatic-bot
Copy link
Contributor

@xrstf: Overrode contexts on behalf of xrstf: pull-machine-controller-e2e-openstack, pull-machine-controller-e2e-openstack-project-auth, pull-machine-controller-e2e-ubuntu-upgrade, pull-machine-controller-e2e-vsphere

In response to this:

/override pull-machine-controller-e2e-openstack
/override pull-machine-controller-e2e-openstack-project-auth
/override pull-machine-controller-e2e-ubuntu-upgrade
/override pull-machine-controller-e2e-vsphere

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.

@kubermatic-bot kubermatic-bot merged commit 41d490b into kubermatic:master Aug 15, 2022
@xrstf xrstf deleted the migrate-kubevirt-kubeconfig-handling branch August 15, 2022 12:17
@xrstf
Copy link
Contributor Author

xrstf commented Aug 15, 2022

/cherrypick release/v1.43

@xrstf
Copy link
Contributor Author

xrstf commented Aug 15, 2022

/cherrypick release/v1.45

@xrstf
Copy link
Contributor Author

xrstf commented Aug 15, 2022

/cherrypick release/v1.42

@kubermatic-bot
Copy link
Contributor

@xrstf: #1404 failed to apply on top of branch "release/v1.43":

Applying: make it clear where and how to base64 encode the kubevirt kubeconfig
Using index info to reconstruct a base tree...
M	docs/cloud-provider.md
M	examples/kubevirt-machinedeployment.yaml
M	test/e2e/provisioning/all_e2e_test.go
M	test/e2e/provisioning/testdata/machinedeployment-kubevirt.yaml
Falling back to patching base and 3-way merge...
Auto-merging test/e2e/provisioning/testdata/machinedeployment-kubevirt.yaml
CONFLICT (content): Merge conflict in test/e2e/provisioning/testdata/machinedeployment-kubevirt.yaml
Auto-merging test/e2e/provisioning/all_e2e_test.go
Auto-merging examples/kubevirt-machinedeployment.yaml
CONFLICT (content): Merge conflict in examples/kubevirt-machinedeployment.yaml
Auto-merging docs/cloud-provider.md
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 make it clear where and how to base64 encode the kubevirt kubeconfig
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:

/cherrypick release/v1.43

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.

@kubermatic-bot
Copy link
Contributor

@xrstf: #1404 failed to apply on top of branch "release/v1.45":

Applying: make it clear where and how to base64 encode the kubevirt kubeconfig
Using index info to reconstruct a base tree...
M	docs/cloud-provider.md
M	examples/kubevirt-machinedeployment.yaml
M	test/e2e/provisioning/all_e2e_test.go
M	test/e2e/provisioning/testdata/machinedeployment-kubevirt.yaml
Falling back to patching base and 3-way merge...
Auto-merging test/e2e/provisioning/testdata/machinedeployment-kubevirt.yaml
CONFLICT (content): Merge conflict in test/e2e/provisioning/testdata/machinedeployment-kubevirt.yaml
Auto-merging test/e2e/provisioning/all_e2e_test.go
Auto-merging examples/kubevirt-machinedeployment.yaml
CONFLICT (content): Merge conflict in examples/kubevirt-machinedeployment.yaml
Auto-merging docs/cloud-provider.md
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 make it clear where and how to base64 encode the kubevirt kubeconfig
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:

/cherrypick release/v1.45

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.

@kubermatic-bot
Copy link
Contributor

@xrstf: #1404 failed to apply on top of branch "release/v1.42":

Applying: make it clear where and how to base64 encode the kubevirt kubeconfig
Using index info to reconstruct a base tree...
M	docs/cloud-provider.md
M	examples/kubevirt-machinedeployment.yaml
M	test/e2e/provisioning/all_e2e_test.go
M	test/e2e/provisioning/testdata/machinedeployment-kubevirt.yaml
Falling back to patching base and 3-way merge...
Auto-merging test/e2e/provisioning/testdata/machinedeployment-kubevirt.yaml
CONFLICT (content): Merge conflict in test/e2e/provisioning/testdata/machinedeployment-kubevirt.yaml
Auto-merging test/e2e/provisioning/all_e2e_test.go
Auto-merging examples/kubevirt-machinedeployment.yaml
CONFLICT (content): Merge conflict in examples/kubevirt-machinedeployment.yaml
Auto-merging docs/cloud-provider.md
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 make it clear where and how to base64 encode the kubevirt kubeconfig
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:

/cherrypick release/v1.42

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.

xrstf added a commit to xrstf/machine-controller that referenced this pull request Aug 15, 2022
xrstf added a commit to xrstf/machine-controller that referenced this pull request Aug 15, 2022
xrstf added a commit to xrstf/machine-controller that referenced this pull request Aug 15, 2022
xrstf added a commit to xrstf/machine-controller that referenced this pull request Aug 15, 2022
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. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management. sig/osm Denotes a PR or issue as being assigned to SIG OSM. 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.

4 participants