Set up examples gate job for 1.11 (#9345)

There were things changed upstream which have blocked the examples test
from running correctly:

- PodSecurityPolicy has been MOVED from extensions API group into
  policy. All samples that are using this resource type needs a change.
- The 'GetCodecForObject()' function in testapi/testapi package was
  removed in 1.11 for unknown reasons. This change has broken our job as
  well as the test code in the kubernetes/examples project.
- Kubernetes is now using 1.10.2+ verion of Go for compilation so we
  have to change the .travis.yml accordingly.

This PR fixes the above problems.

Note also, the `TestReadme` function is **removed** for two reasons:

- It is only testing the snippets in the `volumes.md` file which is now
  broken because of the introduction of service account token injection.
- It is regarded as too aggressive/restrictive a test. We cannot
  guarantee that YAML snippets in the markdown files are complete and
  can be used as is. Instead I believe we should encourage people to use
  template snippets that contain the **key** information for a topic.
  When we see a need for a full template that can be used directly, we
  may want to extract the YAML contents into the `examples`
  subdirectory.
This commit is contained in:
Qiming
2018-07-03 03:53:18 +08:00
committed by k8s-ci-robot
parent d15da5a726
commit 59e626e056
2 changed files with 37 additions and 99 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
language: go
go:
- 1.9.3
- 1.10.2
# Don't want default ./... here:
install:
@@ -10,7 +10,7 @@ install:
# Fetch dependencies for us to run the tests in test/examples_test.go
- go get -t -v k8s.io/website/test
# Make sure we are testing against the correct branch
- pushd $GOPATH/src/k8s.io/kubernetes && git checkout release-1.10 && popd
- pushd $GOPATH/src/k8s.io/kubernetes && git checkout release-1.11 && popd
# Simplified deduplication of dependencies.
- cp -L -R $GOPATH/src/k8s.io/kubernetes/vendor/ $GOPATH/src/