kubernetes-sigs / e2e-framework

A Go framework for end-to-end testing of components running in Kubernetes clusters.
Apache License 2.0
526 stars 101 forks source link

provider: added k3d provider and node lifecycle handlers #441

Open harshanarayana opened 4 months ago

harshanarayana commented 4 months ago

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR enables a new E2EClusterProvider for k3d based infra.

This change includes the following changes and features.
  1. Added a new Interface type E2EClusterProviderWithImageLoaderAndNodeLifecycle which can be used to setup providers that extend the cluster lifecycle function around the nodes.
  2. Enabled a k3d based provider with support for Node lifecycle management.
  3. Existing Image loader related function and interfaces were augmented with args ...string to be able to provide additional arguments in case if the image load handlers need some of the additional config.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

I have also extended the E2EClusterProviderWithImageLoader 's Image load related methods to take an additional arg ...string value to account for additional options that one can pass while performing image load operation alone.

This comes in handy with k3d where it provides a few different mode of loading images and cleanup workflows.

This change also doesn't break any existing API contract extended by the envfuncs.

Does this PR introduce a user-facing change?

enabled a new `E2eClusterProvider` for `k3d` that can be used as a new cluster provider for running e2e tests.

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

NA
harshanarayana commented 4 months ago

/cc @cpanato

harshanarayana commented 4 months ago

go install of k3d is failing due to an issue similar to https://github.com/k3d-io/k3d/issues/1324

harshanarayana commented 4 months ago

/hold

Holding this under the k3d install issue is resolved.

harshanarayana commented 4 months ago

/unhold

k8s-ci-robot commented 4 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cpanato, harshanarayana

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: - ~~[OWNERS](https://github.com/kubernetes-sigs/e2e-framework/blob/main/OWNERS)~~ [cpanato,harshanarayana] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
harshanarayana commented 4 months ago

/hold

harshanarayana commented 4 months ago

Holding this until @cpanato @vladimirvivien @ShwethaKumbla also takes look

harshanarayana commented 4 months ago

/retest

k8s-ci-robot commented 4 months ago

New changes are detected. LGTM label has been removed.

harshanarayana commented 4 months ago

@vladimirvivien PTAL. I has pushed the requested changes.

harshanarayana commented 3 months ago

@vladimirvivien PTAL when you can. Addressed the required changes in the message for wait for control plane.