Download kubernetes for E2E tests ourselves#86
Merged
knative-prow-robot merged 1 commit intoknative:masterfrom Aug 21, 2018
adrcunha:download-k8s
Merged
Download kubernetes for E2E tests ourselves#86knative-prow-robot merged 1 commit intoknative:masterfrom adrcunha:download-k8s
knative-prow-robot merged 1 commit intoknative:masterfrom
adrcunha:download-k8s
Conversation
…to let the tool magically download kubernetes and start the cluster. To ensure that our tests don't unexpectedly break, we don't pin the kubernetes version to a particular one (knative/serving#1294) but always use `latest`. However, the concept of `latest` for kubetests means "kubernetes head", which can be broken (didn't happen so far) or doesn't support all platforms (OS X is the most common case). Unfortunately, switching to `default` or `release/stable` translates to kubernetes 1.9, which is not recommended for Knative according to the docs. This PR adds the function `download_k8s()`: it will download the latest public, stable GKE binary supported by the test cluster and the client machine. As a bonus, the function knocks out the `kubernetes-test.tar.gz` package; this 1.2GB package is not used by Knative tests, and is a severe burden on slower connections (anedoctal evidence: 20+ min download on my home network). Fixes #40. Bonus: fixes #80.
Collaborator
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: adrcunha The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
kubetest is …
Contributor
|
/lgtm |
adrcunha
added a commit
that referenced
this pull request
Aug 22, 2018
`kubectl` 1.11 doesn't recognize the `--username` and `--password` flags anymore. Because the `prow-tests` image uses `kubectl` 1.8, the Prow jobs are not broken (yet). The changes in #86 don't work because the context is not changed (nor restored), but the function works as long as the current user is an owner of the GCP project (which is not the case for Prow E2E test jobs). This change creates and uses a new context for the cluster admin, created the role binding, then switches back to the original context. This is more secure as no ACL changes are required for the current user, nor project wide ACL changes are performed.
Cynocracy
pushed a commit
to Cynocracy/test-infra
that referenced
this pull request
Jun 13, 2020
This starts to sketch common libraries for instantiating informers/listers for a particular GroupVersionResource as one of our duck types.
You can instantiate a duck.InformerFactory like so:
```go
dynaClient, err := dynamic.NewForConfig(cfg)
if err != nil {
logger.Fatalf("Error building dynamic clientset: %v", err)
}
// Cache as the outermost layer so we only register the EventHandler once.
dif := &duck.CachedInformerFactory{
Delegate: &duck.EnqueueInformerFactory{
Delegate: &duck.TypedInformerFactory{
Client: dynaClient,
Type: &duckv1alpha1.Target{},
ResyncPeriod: 30 * time.Second,
StopChannel: stopCh,
},
EventHandler: cache.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) {
// Enqueue, obj is: *duckerv1alpha1.Target
},
UpdateFunc: func(old, new interface{}) {
// Enqueue, old and new are: *duckerv1alpha1.Target
},
},
},
}
```
Then, as you come across new GroupVersionResources that you want to handle:
```go
informer, lister, err := dif.Get(gvr)
if err != nil {
logger.Fatalf("Error starting shared index informer: %v", err)
}
```
With the `duck.TypedInformerFactory` the objects will be returned as the provided `Type:`, so in this example, you could safely write:
```go
elt, err := lister.ByNamespace(ns).Get(name)
if err != nil { ... }
target := elt.(*duckv1alpha1.Target)
// Stuff involving target.
```
knative-prow-updater-robot
pushed a commit
to knative-prow-updater-robot/test-infra
that referenced
this pull request
Jun 5, 2023
Bumps rust from 1.69 to 1.70. --- updated-dependencies: - dependency-name: rust dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current approach for running the E2E tests through
kubetestis to let the tool magically download kubernetes and start the cluster.To ensure that our tests don't unexpectedly break, we don't pin the kubernetes version to a particular one (knative/serving#1294) but always use
latest.However, the concept of
latestfor kubetests means "kubernetes head", which can be broken (didn't happen so far) or doesn't support all platforms (OS X is the most common case).Unfortunately, switching to
defaultorrelease/stabletranslates to kubernetes 1.9, which is not recommended for Knative according to the docs.This PR reverts the default GKE version to latest and adds the function
download_k8s(): it will download the latest public, stable GKE binary supported by the test cluster and the client machine.As a bonus, the function knocks out the
kubernetes-test.tar.gzpackage; this 1.2GB package is not used by Knative tests, and is a severe burden on slower connections (anedoctal evidence: 20+ min download on my home network).Fixes #40.
Bonus 1: fixes #80.
Bonus 2: fixes knative/serving#1914.