Skip to content

Commit 94ed8aa

Browse files
authored
Merge pull request #6541 from deads2k/api-off-by-default
add details for testing beta APIs now that they are off by default
2 parents a15439a + 6bf340d commit 94ed8aa

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

contributors/devel/sig-architecture/api_changes.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -818,8 +818,8 @@ reviewers to see what has changed between the two versions:
818818
Due to the fast changing nature of the project, the following content is probably out-dated:
819819
* You must add the version to
820820
[pkg/controlplane/instance.go](https://github.com/kubernetes/kubernetes/blob/v1.21.2/pkg/controlplane/instance.go#L662)
821-
is be enabled by default for beta and stable versions, or disabled by default
822-
for alpha versions.
821+
is be enabled by default for stable versions, or disabled by default
822+
for alpha and beta versions.
823823
* You must add the new version to
824824
`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)).
825825
* You must add the new version to
@@ -845,6 +845,13 @@ local-up-cluster.sh, kind, etc) and running `kubectl get
845845
<resource>.<version>.<group>`.
846846
* [Integration tests](../sig-testing/integration-tests.md)
847847
are also good for testing the full CRUD lifecycle along with the controller.
848+
* To write integration tests for beta APIs you will need to selectively enable the resources you need.
849+
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).
850+
You will then pass the `--runtime-config=groupname/v1beta1/resourcename` as a flag to enable the beta API.
851+
* For beta APIs, e2e tests need to perform discovery checks against the kube-apiserver to determine if
852+
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)
853+
for an example.
854+
There is a [prow dashboard for beta API jobs](https://prow.k8s.io/?job=*betaapis*) to watch your results.
848855

849856
## Making a new API Group
850857

0 commit comments

Comments
 (0)