This PR moves the examples test to where it belongs and also include the
following improvements:
- Removed test cases defined for non-existent files;
- Add guard against ineffective tests against missing files;
- Remove the special case for scheduler-policy-config which is no longer
an example, the dependency on the related go module is thus
eliminated;
- Updated the .tavis.yml file to use the new test case: the instruction
sequence is adjusted to ensure the correct version of kubernetes is
fully prepared before we do `go get -v -t`.
- The examples_test.go is formatted using `gofmt`;
- Verbose output during test has been added.
- A separate test case is added for CN translation.
Related: #9285
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.
* Restore gate jobs
Most gate jobs have been disabled recently so we are risking introduce
many defects when migrating to Hugo. This PR fixes the gate job to get
it running again.
* add comment for fix
* comment out, delete later
* comment out completely
* include package
So far we have been running tests against the master branch of
kubernetes/kubernetes. This is creating quite some problems because the
master branch is always moving. We are actually checking the YAML files
against a version between 1.10 and 1.11.
This PR is attempting to fix the problem by checking out the
'release-1.10' branch before running the tests. We are supposed to
change the branch to be used when release-1.11 is out. With this PR
(hopefully it works), we will only need to fix the gate every time a new
release is out.