k8s.io/kubernetes@v1.31.0-alpha.0.0.20240520171757-56147500dadc/staging/README.md (about) 1 # External Repository Staging Area 2 3 This directory is the staging area for packages that have been split to their 4 own repository. The content here will be periodically published to respective 5 top-level k8s.io repositories. 6 7 Repositories currently staged here: 8 9 - [`k8s.io/api`](https://github.com/kubernetes/api) 10 - [`k8s.io/apiextensions-apiserver`](https://github.com/kubernetes/apiextensions-apiserver) 11 - [`k8s.io/apimachinery`](https://github.com/kubernetes/apimachinery) 12 - [`k8s.io/apiserver`](https://github.com/kubernetes/apiserver) 13 - [`k8s.io/cli-runtime`](https://github.com/kubernetes/cli-runtime) 14 - [`k8s.io/client-go`](https://github.com/kubernetes/client-go) 15 - [`k8s.io/cloud-provider`](https://github.com/kubernetes/cloud-provider) 16 - [`k8s.io/cluster-bootstrap`](https://github.com/kubernetes/cluster-bootstrap) 17 - [`k8s.io/code-generator`](https://github.com/kubernetes/code-generator) 18 - [`k8s.io/component-base`](https://github.com/kubernetes/component-base) 19 - [`k8s.io/component-helpers`](https://github.com/kubernetes/component-helpers) 20 - [`k8s.io/controller-manager`](https://github.com/kubernetes/controller-manager) 21 - [`k8s.io/cri-api`](https://github.com/kubernetes/cri-api) 22 - [`k8s.io/csi-translation-lib`](https://github.com/kubernetes/csi-translation-lib) 23 - [`k8s.io/dynamic-resource-allocation`](https://github.com/kubernetes/dynamic-resource-allocation) 24 - [`k8s.io/endpointslice`](https://github.com/kubernetes/endpointslice) 25 - [`k8s.io/kms`](https://github.com/kubernetes/kms) 26 - [`k8s.io/kube-aggregator`](https://github.com/kubernetes/kube-aggregator) 27 - [`k8s.io/kube-controller-manager`](https://github.com/kubernetes/kube-controller-manager) 28 - [`k8s.io/kube-proxy`](https://github.com/kubernetes/kube-proxy) 29 - [`k8s.io/kube-scheduler`](https://github.com/kubernetes/kube-scheduler) 30 - [`k8s.io/kubectl`](https://github.com/kubernetes/kubectl) 31 - [`k8s.io/kubelet`](https://github.com/kubernetes/kubelet) 32 - [`k8s.io/metrics`](https://github.com/kubernetes/metrics) 33 - [`k8s.io/mount-utils`](https://github.com/kubernetes/mount-utils) 34 - [`k8s.io/pod-security-admission`](https://github.com/kubernetes/pod-security-admission) 35 - [`k8s.io/sample-apiserver`](https://github.com/kubernetes/sample-apiserver) 36 - [`k8s.io/sample-cli-plugin`](https://github.com/kubernetes/sample-cli-plugin) 37 - [`k8s.io/sample-controller`](https://github.com/kubernetes/sample-controller) 38 39 The code in the staging/ directory is authoritative, i.e. the only copy of the 40 code. You can directly modify such code. 41 42 ## Using staged repositories from Kubernetes code 43 44 Kubernetes code uses the repositories in this directory via a Go workspace and 45 module `replace` statements. For example, when Kubernetes code imports a 46 package from the `k8s.io/client-go` repository, that import is resolved to 47 `staging/src/k8s.io/client-go` relative to the project root: 48 49 ```go 50 // pkg/example/some_code.go 51 package example 52 53 import ( 54 "k8s.io/client-go/dynamic" // resolves to staging/src/k8s.io/client-go/dynamic 55 ) 56 ``` 57 58 ## Creating a new repository in staging 59 60 ### Adding the staging repository in `kubernetes/kubernetes`: 61 62 1. Send an email to the SIG Architecture [mailing 63 list](https://groups.google.com/forum/#!forum/kubernetes-sig-architecture) 64 and the mailing list of the SIG which would own the repo requesting approval 65 for creating the staging repository. 66 67 2. Once approval has been granted, create the new staging repository. 68 69 3. Update 70 [`import-restrictions.yaml`](/staging/publishing/import-restrictions.yaml) 71 to add the list of other staging repos that this new repo can import. 72 73 4. Add all mandatory template files to the staging repo as mentioned in 74 https://github.com/kubernetes/kubernetes-template-project. 75 76 5. Make sure that the `.github/PULL_REQUEST_TEMPLATE.md` and `CONTRIBUTING.md` 77 files mention that PRs are not directly accepted to the repo. 78 79 6. Ensure that `docs.go` file is added. Refer to 80 [#kubernetes/kubernetes#91354](https://github.com/kubernetes/kubernetes/blob/release-1.24/staging/src/k8s.io/client-go/doc.go) 81 for reference. 82 83 7. NOTE: Do not edit go.mod or go.sum in the new repo (staging/src/k8s.io/<newrepo>/) manually. Run the following instead: 84 85 ``` 86 ./hack/update-vendor.sh 87 ``` 88 89 8. Run [`./hack/update-go-workspace.sh`](/hack/update-go-workspace.sh) to add 90 the module to the workspace. 91 92 ### Creating the published repository 93 94 1. Create an [issue](https://github.com/kubernetes/org/issues/new?template=repo-create.md) 95 in the `kubernetes/org` repo to request creation of the respective published 96 repository in the Kubernetes org. The published repository **must** have an 97 initial empty commit. It also needs specific access rules and branch settings. 98 See [#kubernetes/org#58](https://github.com/kubernetes/org/issues/58) 99 for an example. 100 101 2. Setup branch protection and enable access to the `stage-bots` team 102 by adding the repo in 103 [`prow/config.yaml`](https://github.com/kubernetes/test-infra/blob/master/config/prow/config.yaml). 104 See [#kubernetes/test-infra#9292](https://github.com/kubernetes/test-infra/pull/9292) 105 for an example. 106 107 3. Once the repository has been created in the Kubernetes org, 108 update the publishing-bot to publish the staging repository by updating: 109 110 - [`rules.yaml`](/staging/publishing/rules.yaml): 111 Make sure that the list of dependencies reflects the staging repos in the `Godeps.json` file. 112 113 - [`repos.sh`](https://github.com/kubernetes/publishing-bot/blob/master/hack/repos.sh): 114 Add the staging repo in the list of repos to be published. 115 116 4. Add the staging and published repositories as a subproject for the 117 SIG that owns the repos in 118 [`sigs.yaml`](https://github.com/kubernetes/community/blob/master/sigs.yaml). 119 120 5. Add the repo to the list of staging repos in this `README.md` file.