![]() Move away from arrays to strings to fix several shellcheck-reported issues. It isn't useful to expand the found files into arrays, because only things that are checked are if the array is empty or the contents of the first array item. Fix also a shellcheck issue about using a literal string as regexp match. It appears that the original reason for using a regexp was to avoid specifying the directory in which the script is run. However, due to the need of calling 'make generated_files', the directory is fixed anyway, and the regexp can be left out. Testing the change can be done with the following script which emulates the different cases which the script can see. In the output the variable 'X' is the array and 'Z' is the string. #!/bin/bash set -o errexit set -o nounset set -o pipefail function find_genfiles() { find . \ \( \ -not \( \ \( \ -path ./_\* -o \ -path ./.\* \ \) -prune \ \) \ \) -name "$1" } # $1 = filename pattern as in "zz_generated.$1.go" # $2 timestamp file function newer() { find_genfiles "$1" | while read -r F; do if [[ "${F}" -nt "$2" ]]; then echo "${F}" fi done } STAMP=stamp mkdir -p xxx touch xxx/foobar touch "${STAMP}" mkdir -p foo touch foo/foobar mkdir -p bar touch bar/foobar # two newer files X=($(newer foobar "${STAMP}")) if [[ "${#X[*]}" != 0 ]]; then echo "X1:" echo " ${X[*]:-(none)}" fi Z="$(newer foobar "${STAMP}")" if [[ -n "$Z" ]]; then echo "Z1:" echo " ${Z}" | tr '\n' ' ' echo "" fi # no newer files touch "${STAMP}" X=($(newer foobar "${STAMP}")) if [[ "${#X[*]}" != 0 ]]; then echo "X2:" echo " ${X[*]:-(none)}" fi Z="$(newer foobar "${STAMP}")" if [[ -n "$Z" ]]; then echo "Z2:" echo " ${Z}" | tr '\n' ' ' echo "" fi # one newer file, name matches touch "${STAMP}" touch bar/foobar X=($(newer foobar "${STAMP}")) if [[ "${#X[@]}" != 1 || ! ( "${X[0]}" =~ "bar/foobar" ) ]]; then echo "X3:" echo " ${X[*]:-(none)}" fi Z="$(newer foobar "${STAMP}")" if [[ -z "${Z}" || ${Z} != "./bar/foobar" ]]; then echo "Z3:" echo " ${Z:-(none)}" | tr '\n' ' ' echo "" fi # one newer file, name doesn't match touch "${STAMP}" touch foo/foobar X=($(newer foobar "${STAMP}")) if [[ "${#X[@]}" != 1 || ! ( "${X[0]}" =~ "bar/foobar" ) ]]; then echo "X4:" echo " ${X[*]:-(none)}" fi Z="$(newer foobar "${STAMP}")" if [[ -z "${Z}" || ${Z} != "./bar/foobar" ]]; then echo "Z4:" echo " ${Z:-(none)}" | tr '\n' ' ' echo "" fi The expected output from running this script: X1: ./bar/foobar ./foo/foobar Z1: ./bar/foobar ./foo/foobar X4: ./foo/foobar Z4: ./foo/foobar |
||
---|---|---|
.github | ||
Godeps | ||
api | ||
build | ||
cluster | ||
cmd | ||
docs | ||
hack | ||
logo | ||
pkg | ||
plugin | ||
staging | ||
test | ||
third_party | ||
translations | ||
vendor | ||
.bazelrc | ||
.generated_files | ||
.gitattributes | ||
.gitignore | ||
.kazelcfg.json | ||
BUILD.bazel | ||
CHANGELOG-1.2.md | ||
CHANGELOG-1.3.md | ||
CHANGELOG-1.4.md | ||
CHANGELOG-1.5.md | ||
CHANGELOG-1.6.md | ||
CHANGELOG-1.7.md | ||
CHANGELOG-1.8.md | ||
CHANGELOG-1.9.md | ||
CHANGELOG-1.10.md | ||
CHANGELOG-1.11.md | ||
CHANGELOG-1.12.md | ||
CHANGELOG-1.13.md | ||
CHANGELOG-1.14.md | ||
CHANGELOG.md | ||
CONTRIBUTING.md | ||
LICENSE | ||
Makefile | ||
Makefile.generated_files | ||
OWNERS | ||
OWNERS_ALIASES | ||
README.md | ||
SECURITY_CONTACTS | ||
SUPPORT.md | ||
WORKSPACE | ||
code-of-conduct.md |
README.md
Kubernetes
![](https://github.com/kubernetes/kubernetes/raw/master/logo/logo.png)
Kubernetes is an open source system for managing containerized applications across multiple hosts; providing basic mechanisms for deployment, maintenance, and scaling of applications.
Kubernetes builds upon a decade and a half of experience at Google running production workloads at scale using a system called Borg, combined with best-of-breed ideas and practices from the community.
Kubernetes is hosted by the Cloud Native Computing Foundation (CNCF). If you are a company that wants to help shape the evolution of technologies that are container-packaged, dynamically-scheduled and microservices-oriented, consider joining the CNCF. For details about who's involved and how Kubernetes plays a role, read the CNCF announcement.
To start using Kubernetes
See our documentation on kubernetes.io.
Try our interactive tutorial.
Take a free course on Scalable Microservices with Kubernetes.
To start developing Kubernetes
The community repository hosts all information about building Kubernetes from source, how to contribute code and documentation, who to contact about what, etc.
If you want to build Kubernetes right away there are two options:
You have a working Go environment.
$ go get -d k8s.io/kubernetes
$ cd $GOPATH/src/k8s.io/kubernetes
$ make
You have a working Docker environment.
$ git clone https://github.com/kubernetes/kubernetes
$ cd kubernetes
$ make quick-release
For the full story, head over to the developer's documentation.
Support
If you need support, start with the troubleshooting guide, and work your way through the process that we've outlined.
That said, if you have questions, reach out to us one way or another.