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

feat: add vcluster e2e cluster provider #450

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

crandles
Copy link
Contributor

@crandles crandles commented Aug 29, 2024

addition of vcluster provider; interested to see if the CI fails. vcluster needs a "host" cluster to launch into, so I've followed an existing example where a real cluster or kind cluster are utilized as necessary:

if os.Getenv("REAL_CLUSTER") == "true" {

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR enables a new E2EClusterProvider for vcluster based clusters.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., Usage docs, etc.:

NA

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Aug 29, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @crandles. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 29, 2024
@crandles crandles force-pushed the add-vcluster branch 2 times, most recently from 9f6fc49 to c1c98a4 Compare August 29, 2024 12:03
@crandles crandles marked this pull request as ready for review August 29, 2024 13:10
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 29, 2024
@vladimirvivien
Copy link
Contributor

@crandles this is awesome and thanks for the contribution.
At first glance it looks Okay, but I will ask @harshanarayana to take a look as well since he's the E2E provider expert 😉

Copy link
Contributor

@vladimirvivien vladimirvivien left a comment

Choose a reason for hiding this comment

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

This is a great start. I left some comments.

echo.SetEnv("KUBECONFIG", c.hostKubeCfg)
}

p := echo.RunProc(command)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think @harshanarayana has some util wrapper for running procs that should be considered here.

}
return c
}
func (c *Cluster) Create(ctx context.Context, args ...string) (string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@crandles does this vcluster create function will only work for kind "real" clusters (i don't know much about vclusters). If that is the case, you may wanna consider making that clear in naming (i.e. third_party/kind_vcluster).

Copy link
Contributor Author

@crandles crandles Aug 31, 2024

Choose a reason for hiding this comment

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

No, this doesn't require kind, this should work in any host k8s cluster.

I set it up via kind in the example so that it could presumably execute successfully (doubting there's a real cluster to access otherwise within CI).

I'd expect normal usage would be against your preferred existing AWS or Google flavored kubernetes cluster.

Copy link
Contributor

@vladimirvivien vladimirvivien left a comment

Choose a reason for hiding this comment

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

This looks good to me.
LGTM

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: crandles, vladimirvivien

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 Sep 11, 2024
@vladimirvivien
Copy link
Contributor

/retest

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 11, 2024
@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@crandles
Copy link
Contributor Author

Updated copyright, verify-boilerplate passes locally now.

@vladimirvivien
Copy link
Contributor

/retest

@k8s-ci-robot
Copy link
Contributor

@crandles: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-e2e-framework-verify 3cd2451 link true /test pull-e2e-framework-verify

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-sigs/prow repository. I understand the commands that are listed here.

@crandles
Copy link
Contributor Author

golangci appears to be passing now for thew new code I've added, though errirng for some existing LOC:

third_party/helm/helm.go:240:9: SA1006: printf-style function with dynamic format string and no further arguments should use print-style function instead (staticcheck)
		err = fmt.Errorf(missingHelm)
		      ^
third_party/flux/flux_setup.go:47:16: SA1006: printf-style function with dynamic format string and no further arguments should use print-style function instead (staticcheck)
			return ctx, fmt.Errorf(NoFluxInstallationFoundMsg)
			            ^
third_party/flux/flux_setup.go:61:16: SA1006: printf-style function with dynamic format string and no further arguments should use print-style function instead (staticcheck)
			return ctx, fmt.Errorf(NoFluxInstallationFoundMsg)
			            ^
pkg/env/env.go:229:11: printf: non-constant format string in call to (*testing.common).Skipf (govet)
		t.Skipf(message)
		        ^
pkg/env/env.go:513:22: printf: non-constant format string in call to (*testing.common).Skipf (govet)
					internalT.Skipf(message)

Assuming that won't block this PR.

@vladimirvivien
Copy link
Contributor

@harshanarayana and @cpanato any idea why golangci failing on previously working code ?

@crandles
Copy link
Contributor Author

crandles commented Sep 28, 2024

errors were primarily for:

SA1006: printf-style function with dynamic format string and no further arguments should use print-style function instead (staticcheck)

It's possible that I'm using a different toolchain version, but as the warning seemed fair, I've fixed it via cf9cbf2

make verify now passes locally.

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. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants