summaryrefslogtreecommitdiff
path: root/contributors
diff options
context:
space:
mode:
authorKubernetes Prow Robot <k8s-ci-robot@users.noreply.github.com>2022-03-17 15:30:42 -0700
committerGitHub <noreply@github.com>2022-03-17 15:30:42 -0700
commit94ed8aaed7f87af458bccc3aae5b044941d8c95d (patch)
treeb716be1e96c7f5444a5a216a58cd73b9ee55423a /contributors
parenta15439a939e962c4ce8093ed2a725331d256f195 (diff)
parent6bf340de5fff3dcf1852b7c140de4f39247dc7dc (diff)
Merge pull request #6541 from deads2k/api-off-by-default
add details for testing beta APIs now that they are off by default
Diffstat (limited to 'contributors')
-rw-r--r--contributors/devel/sig-architecture/api_changes.md11
1 files changed, 9 insertions, 2 deletions
diff --git a/contributors/devel/sig-architecture/api_changes.md b/contributors/devel/sig-architecture/api_changes.md
index 25c61fce..ccadaa2f 100644
--- a/contributors/devel/sig-architecture/api_changes.md
+++ b/contributors/devel/sig-architecture/api_changes.md
@@ -818,8 +818,8 @@ reviewers to see what has changed between the two versions:
Due to the fast changing nature of the project, the following content is probably out-dated:
* You must add the version to
[pkg/controlplane/instance.go](https://github.com/kubernetes/kubernetes/blob/v1.21.2/pkg/controlplane/instance.go#L662)
- is be enabled by default for beta and stable versions, or disabled by default
- for alpha versions.
+ is be enabled by default for stable versions, or disabled by default
+ for alpha and beta versions.
* You must add the new version to
`pkg/apis/group_name/install/install.go` (for example, [pkg/apis/apps/install/install.go](https://github.com/kubernetes/kubernetes/blob/v1.21.2/pkg/apis/apps/install/install.go)).
* You must add the new version to
@@ -845,6 +845,13 @@ local-up-cluster.sh, kind, etc) and running `kubectl get
<resource>.<version>.<group>`.
* [Integration tests](../sig-testing/integration-tests.md)
are also good for testing the full CRUD lifecycle along with the controller.
+ * To write integration tests for beta APIs you will need to selectively enable the resources you need.
+ You can do this using [cmd/kube-apiserver/app/testing/testserver.go#StartTestServerOrDie](https://github.com/kubernetes/kubernetes/blob/2b1b849d6a8bdeb7dc0807438cfd0ff2a9d752c1/cmd/kube-apiserver/app/testing/testserver.go#L325).
+ You will then pass the `--runtime-config=groupname/v1beta1/resourcename` as a flag to enable the beta API.
+* For beta APIs, e2e tests need to perform discovery checks against the kube-apiserver to determine if
+ a beta API is enabled or not. See [test/e2e/apimachinery/discovery.go](https://github.com/kubernetes/kubernetes/blob/2b1b849d6a8bdeb7dc0807438cfd0ff2a9d752c1/test/e2e/apimachinery/discovery.go#L50)
+ for an example.
+ There is a [prow dashboard for beta API jobs](https://prow.k8s.io/?job=*betaapis*) to watch your results.
## Making a new API Group