
Without this change, sometimes leaked goroutines were reported for test/integration/scheduler_perf. The one that caused the cleanup to get delayed was this one: goleak.go:50: found unexpected goroutines: [Goroutine 2704 in state chan receive, 2 minutes, with k8s.io/client-go/tools/cache.(*Reflector).watch on top of the stack: goroutine 2704 [chan receive, 2 minutes]: k8s.io/client-go/tools/cache.(*Reflector).watch(0xc00453f590, {0x0, 0x0}, 0x1f?, 0xc00a128080?) /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/client-go/tools/cache/reflector.go:388 +0x5b3 k8s.io/client-go/tools/cache.(*Reflector).ListAndWatch(0xc00453f590, 0xc006e94900) /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/client-go/tools/cache/reflector.go:324 +0x3bd k8s.io/client-go/tools/cache.(*Reflector).Run.func1() /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/client-go/tools/cache/reflector.go:279 +0x45 k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0xc007aafee0) /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:157 +0x49 k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0xc003e18150?, {0x75e37c0, 0xc00389c280}, 0x1, 0xc006e94900) /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:158 +0xcf k8s.io/client-go/tools/cache.(*Reflector).Run(0xc00453f590, 0xc006e94900) /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/client-go/tools/cache/reflector.go:278 +0x257 k8s.io/apimachinery/pkg/util/wait.(*Group).StartWithChannel.func1() /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:58 +0x3f k8s.io/apimachinery/pkg/util/wait.(*Group).Start.func1() /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:75 +0x74 created by k8s.io/apimachinery/pkg/util/wait.(*Group).Start /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:73 +0xe5 watch() was stuck in an exponential backoff timeout. Logging confirmed that: I0309 21:14:21.756149 1572727 reflector.go:387] k8s.io/client-go/informers/factory.go:150: watch of *v1.PersistentVolumeClaim returned Get "https://127.0.0.1:38269/api/v1/persistentvolumeclaims?allowWatchBookmarks=true&resourceVersion=1&timeout=7m47s&timeoutSeconds=467&watch=true": dial tcp 127.0.0.1:38269: connect: connection refused - backing off
External Repository Staging Area
This directory is the staging area for packages that have been split to their own repository. The content here will be periodically published to respective top-level k8s.io repositories.
Repositories currently staged here:
k8s.io/api
k8s.io/apiextensions-apiserver
k8s.io/apimachinery
k8s.io/apiserver
k8s.io/cli-runtime
k8s.io/client-go
k8s.io/cloud-provider
k8s.io/cluster-bootstrap
k8s.io/code-generator
k8s.io/component-base
k8s.io/component-helpers
k8s.io/controller-manager
k8s.io/cri-api
k8s.io/csi-translation-lib
k8s.io/dynamic-resource-allocation
k8s.io/kms
k8s.io/kube-aggregator
k8s.io/kube-controller-manager
k8s.io/kube-proxy
k8s.io/kube-scheduler
k8s.io/kubectl
k8s.io/kubelet
k8s.io/legacy-cloud-providers
k8s.io/metrics
k8s.io/mount-utils
k8s.io/noderesourcetopology-api
k8s.io/pod-security-admission
k8s.io/sample-apiserver
k8s.io/sample-cli-plugin
k8s.io/sample-controller
The code in the staging/ directory is authoritative, i.e. the only copy of the code. You can directly modify such code.
Using staged repositories from Kubernetes code
Kubernetes code uses the repositories in this directory via symlinks in the
vendor/k8s.io
directory into this staging area. For example, when
Kubernetes code imports a package from the k8s.io/client-go
repository, that
import is resolved to staging/src/k8s.io/client-go
relative to the project
root:
// pkg/example/some_code.go
package example
import (
"k8s.io/client-go/dynamic" // resolves to staging/src/k8s.io/client-go/dynamic
)
Once the change-over to external repositories is complete, these repositories
will actually be vendored from k8s.io/<package-name>
.
Creating a new repository in staging
Adding the staging repository in kubernetes/kubernetes
:
-
Send an email to the SIG Architecture mailing list and the mailing list of the SIG which would own the repo requesting approval for creating the staging repository.
-
Once approval has been granted, create the new staging repository.
-
Add a symlink to the staging repo in
vendor/k8s.io
. -
Update
import-restrictions.yaml
to add the list of other staging repos that this new repo can import. -
Add all mandatory template files to the staging repo as mentioned in https://github.com/kubernetes/kubernetes-template-project.
-
Make sure that the
.github/PULL_REQUEST_TEMPLATE.md
andCONTRIBUTING.md
files mention that PRs are not directly accepted to the repo. -
Ensure that
docs.go
file is added. Refer to #kubernetes/kubernetes#91354 for reference. -
NOTE: Do not edit go.mod or go.sum in the new repo (staging/src/k8s.io//) manually. Run the following instead:
./hack/update-vendor.sh
Creating the published repository
-
Create an issue in the
kubernetes/org
repo to request creation of the respective published repository in the Kubernetes org. The published repository must have an initial empty commit. It also needs specific access rules and branch settings. See #kubernetes/org#58 for an example. -
Setup branch protection and enable access to the
stage-bots
team by adding the repo inprow/config.yaml
. See #kubernetes/test-infra#9292 for an example. -
Once the repository has been created in the Kubernetes org, update the publishing-bot to publish the staging repository by updating:
-
rules.yaml
: Make sure that the list of dependencies reflects the staging repos in theGodeps.json
file. -
repos.sh
: Add the staging repo in the list of repos to be published.
-
-
Add the staging and published repositories as a subproject for the SIG that owns the repos in
sigs.yaml
. -
Add the repo to the list of staging repos in this
README.md
file.