Commit Graph

74683 Commits (4c18fbcbb58c6b3d649498a4c53736f76a764d7e)

Author SHA1 Message Date
Clayton Coleman 3e0dd7f365
upgrade: ClusterUpgrade and MasterUpgrade are equivalent
Some tests were only checking for MasterUpgrade, but that is also
implied by ClusterUpgrade.
2019-02-10 23:51:27 -05:00
Kubernetes Prow Robot 69cf2684bb
Merge pull request #73669 from WanLinghao/add_get_case
Add a case to illustrate how to use `kubectl get -o custom-columns`
2019-02-10 20:47:26 -08:00
Davanum Srinivas 9870b74f90
cleanup .import-restrictions for cloud provider
Change-Id: I8f9b8a28474d12d6eb74ecef85a988dd3f1f851e
2019-02-10 22:56:53 -05:00
xiezongzhe 3cec62b3f5
fix typo
Is ->It in line 6
2019-02-11 11:38:25 +08:00
Kubernetes Prow Robot 162b79d2ec
Merge pull request #70931 from m1kola/port-forward-consistency
Fixes inconsistent behaviour in portforward
2019-02-10 19:37:27 -08:00
PingWang d8e3d11c8b Fix function comment to consistent with its name
Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2019-02-11 10:51:35 +08:00
WanLinghao e9edbf1d52 Clean unused code in pkg/securitycontext/util.go 2019-02-11 10:30:47 +08:00
danielqsj 342dc93187 fix shellcheck in kube-aggregator 2019-02-11 10:30:34 +08:00
Kubernetes Prow Robot e47973bd31
Merge pull request #69086 from bruceauyeung/log-useful-info-instead-of-silent-exit-when-etcd-already-installed
log useful information instead of silent exit without error
2019-02-10 18:14:26 -08:00
WanLinghao de85b7c8a8 Clean deprecated `ShowAll` variable in PrintOptions 2019-02-11 09:18:40 +08:00
Clayton Coleman 25e0a8f56c
Print the involved object in the event table as resource/name
The involved object is important and only some events include its
name in the message. Change the `Kind` column to `Object` and print
the object in `resource/name` form to allow copy and paste
to `kubectl get`. Also move the source field column to the right
of involved object since it is related.
2019-02-10 20:16:07 -05:00
Lubomir I. Ivanov e965738244 generated_files: remove line about /docs/.generated_docs 2019-02-11 02:54:45 +02:00
Kubernetes Prow Robot 903cdff633
Merge pull request #73889 from mattjmcnaughton/mattjmcnaughton/improve-client-go-docs
Improve in-cluster-client-conf client-go docs
2019-02-10 16:05:44 -08:00
Kubernetes Prow Robot 3dfb9e8f49
Merge pull request #73888 from smarterclayton/duration
Make CRD column printers consistent with typed printers
2019-02-10 13:50:30 -08:00
Clayton Coleman 49250c6efc
Make container create, start, and stop events consistent
The messages for container lifecycle events are subtly inconsistent
and should be unified.

First, the field format for containers is hard to parse for a human,
so include the container name directly in the message for create
and start, and for kill remove the container runtime prefix.

Second, the pulling image event has inconsistent capitalization, fix
that to be sentence without punctuation.

Third, the kill container event was unnecessarily wordy and inconsistent
with the create and start events. Make the following changes:

* Use 'Stopping' instead of 'Killing' since kill is usually reserved for
  when we decide to hard stop a container
* Send the event before we dispatch the prestop hook, since this is an
  "in-progress" style event vs a "already completed" type event
* Remove the 'cri-o://' / 'docker://' prefix by printing the container
  name instead of id (we already do that replacement at the lower level
  to prevent high cardinality events)
* Use 'message' instead of 'reason' as the argument name since this is a
  string for humans field, not a string for machines field
* Remove the hash values on the container spec changed event because no
  human will ever be able to do anything with the hash value
* Use 'Stopping container %s(, explanation)?' form without periods to
  follow event conventions

The end result is a more pleasant message for humans:

```
35m         Normal    Created                       Pod    Created container
35m         Normal    Started                       Pod    Started container
10m         Normal    Killing                       Pod    Killing container cri-o://installer:Need to kill Pod
10m         Normal    Pulling                       Pod    pulling image "registry.svc.ci.openshift.org/openshift/origin-v4.0-2019-02-10-172026@sha256:3da5303d4384d24691721c1cf2333584ba60e8f82c9e782f593623ce8f83ddc5"
```

becomes

```
35m         Normal    Created                       Pod    Created container installer
35m         Normal    Started                       Pod    Started container installer
10m         Normal    Killing                       Pod    Stopping container installer
10m         Normal    Pulling                       Pod    Pulling image "registry.svc.ci.openshift.org/openshift/origin-v4.0-2019-02-10-172026@sha256:3da5303d4384d24691721c1cf2333584ba60e8f82c9e782f593623ce8f83ddc5"
```
2019-02-10 16:39:42 -05:00
mattjmcnaughton fb4148e5f8 Improve in-cluster-client-conf client-go docs
Make a small formatting change to make it clear that you must take the
RBAC actions regardless of whether you're using Minikube or not.
2019-02-10 15:19:42 -05:00
Clayton Coleman 6b1a5101c3
Make CRD column printers consistent with typed printers
Almost all other server side printers use duration.HumanDuration
which has higher precision output. Switch CRD printers to use this
as well.
2019-02-10 15:17:58 -05:00
Mikalai Radchuk 4ee2010111 Fixes address parsing in port-forward
The rules for address parsing are:

* Explicitly specified addresses must bind successfully
* `localhost` is pinned to `127.0.0.1` and `::1` and at least one of those must bind successfully

This change also makes output of the command consistent
between runs with the same arguments.
Previously the command was using the range via map of addresses
which sometimes was producing different output because the order
of values is not guaranteed in Go.
2019-02-10 12:48:52 +00:00
Kubernetes Prow Robot b862590bfc
Merge pull request #73847 from wojtek-t/watch_metric
Add metric exposing amount of processed init events in watchcache
2019-02-10 03:47:35 -08:00
WanLinghao 4a1a2c9017 Add a case to illustrate how to use `kubectl get -o custom-columns` 2019-02-10 14:42:13 +08:00
Ismo Puustinen f1cb820b16 Remove verify-generated-files-remake.sh from shellcheck failures. 2019-02-09 22:41:53 +02:00
Ismo Puustinen b06533af65 verify-generated-files-remake: quote return value.
Fix a shellcheck error by quoting a return value properly.
2019-02-09 22:41:53 +02:00
Ismo Puustinen c23c83724c verify-generated-files-remake.sh: use strings instead of arrays.
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
2019-02-09 22:32:31 +02:00
Ismo Puustinen fefdfc2ad7 verify-generated-files-remake.sh: fix BASH_SOURCE array. 2019-02-09 22:32:31 +02:00
Nikolaos Moraitis c7e103fd44 apis:core:validation: remove unused, changes to idiomatic go 2019-02-09 18:07:18 +01:00
Kubernetes Prow Robot a1cc48bf59
Merge pull request #73837 from neolit123/preflight-docker-cgroup
kubeadm: add a preflight check for Docker and cgroup driver
2019-02-09 08:45:11 -08:00
Patrick Ohly 54d8f1648f e2e/storage: improve PV checking
TestDynamicProvisioning had multiple ways of choosing additional
checks:
- the PvCheck callback
- the builtin write/read check controlled by a boolean
- the snapshot testing

Complicating matters further, that builtin write/read test had been
more customizable with new fields `NodeSelector` and
`ExpectUnschedulable` which were only set by one particular test (see
https://github.com/kubernetes/kubernetes/pull/70941).

That is confusing and will only get more confusing when adding more
checks in the future. Therefore the write/read check is now a separate
function that must be enabled explicitly by tests that want to run it.
The snapshot checking is also defined only for the snapshot test.

The test that expects unschedulable pods now also checks for that
particular situation itself. Instead of testing it with two pods (the
behavior from the write/read check) that both fail to start, only a
single unschedulable pod is created.

Because node name, node selector and the `ExpectUnschedulable` were
only used for checking, it is possible to simplify `StorageClassTest`
by removing all of these fields.

Expect(err).NotTo(HaveOccurred()) is an anti-pattern in Ginkgo testing
because a test failure doesn't explain what failed (see
https://github.com/kubernetes/kubernetes/issues/34059). We avoid it
now by making the check function itself responsible for checking
errors and including more information in those checks.
2019-02-09 14:20:17 +01:00
Patrick Ohly 5b8826b610 e2e/storage: use different names for test pods
When the provisioning test gets stuck, the log fills up with messages
about waiting for a certain pod to run. Now the pod names are
pvc-[volume-tester|snapshot]-[writer|reader] plus the random
number appended by Kubernetes. This makes it easier to see where the
test is stuck.
2019-02-09 14:20:17 +01:00
Patrick Ohly e92bdd14cc e2e/storage: remove unnecessary empty string checks
There is no need to check for empty strings, we can also directly
initialize structs with the value. The end result is the same when the
value is empty (empty string in the struct).
2019-02-09 14:20:17 +01:00
Patrick Ohly 315266b25e e2e: refine snapshot test
This addresses the two remaining change requests from
https://github.com/kubernetes/kubernetes/pull/69036:
- replace "csi-hostpath-v0" name check with capability
  check (cleaner that way)
- add feature tag to "should create snapshot with defaults" because
  that is an alpha feature

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
2019-02-09 14:20:17 +01:00
Patrick Ohly f8536e8e42 e2e: fix snapshot skip test
Even if snapshots are supported by the driver interface, the driver or
suite might still want to skip a particular test, so those checks
still need to be executed.
2019-02-09 14:19:37 +01:00
Andrew Kim 6d90f52f15 add unit tests for volume rounding helpers 2019-02-09 01:16:55 -05:00
Andrew Kim a62ee8b0a9 clean up volume rounding functions and move to k8s.io/cloud-provider/volume 2019-02-09 01:16:55 -05:00
Andrew Kim ca6a051b00 remove cloud provider dependencies to pkg/volume
Co-authored-by: Weibin Lin <linweibin1@huawei.com>
2019-02-09 01:16:55 -05:00
Kubernetes Prow Robot 40a4c1f723
Merge pull request #73854 from RajatVaryani/master
Fix linting in cmd/kubemark package
2019-02-08 22:00:24 -08:00
Kubernetes Prow Robot ee44e24cd3
Merge pull request #73659 from feiskyer/usage-nano-cores
Kubelet: add usageNanoCores from CRI stats provider
2019-02-08 19:26:21 -08:00
Chao Xu e90409d735 add integration test 2019-02-08 16:15:43 -08:00
Kubernetes Prow Robot 2a664f4820
Merge pull request #73213 from danielqsj/nodeapi
fix shellcheck in node-api
2019-02-08 13:14:25 -08:00
Kubernetes Prow Robot 37a402a3bc
Merge pull request #72806 from zgfh/patch-3
fix typo "udp" -> "UDP"
2019-02-08 13:14:15 -08:00
Kubernetes Prow Robot 8f7ccf8d4c
Merge pull request #69036 from wackxu/snapshottest
add e2e test for snapshot
2019-02-08 13:14:04 -08:00
Kubernetes Prow Robot 52b3956df4
Merge pull request #67638 from houjun41544/20180821
Fix fmt.Errorf messages
2019-02-08 13:13:49 -08:00
Kubernetes Prow Robot fd633d192f
Merge pull request #73845 from wojtek-t/fix_watcher_going_back_in_time
Avoid going back in time in watchcache watchers
2019-02-08 11:54:12 -08:00
Kubernetes Prow Robot 834c9a5e3d
Merge pull request #72491 from liggitt/delegated-auth-permissions
Ensure controller manager and scheduler can perform delegated auth checks
2019-02-08 11:53:52 -08:00
Yu Liao fa6699dc4d there could be existing resource quotas, count them first and check the
expected is the existing + 1
2019-02-08 11:35:56 -08:00
Michelle Au ddc1a9c8c8 add msau42 to approvers for volume e2es 2019-02-08 11:34:02 -08:00
Kubernetes Prow Robot 5b7a790d35
Merge pull request #72185 from dcbw/owners-label-sig-network
OWNERS: add label:sig/network to a bunch of places
2019-02-08 10:36:16 -08:00
Kubernetes Prow Robot 54a578d3a1
Merge pull request #72012 from yeya24/patch-1
fix typos lable -> label
2019-02-08 10:36:05 -08:00
Lubomir I. Ivanov 3b3b79fe2c autogenerated bazel 2019-02-08 19:31:22 +02:00
Lubomir I. Ivanov 1d032c40d3 kubeadm: add a preflight check for Docker and cgroup driver
systemd is the recommended driver as per the setup of running
the kubelet using systemd as the init system. Add a preflight
check that throws a warning if this isn't the case.
2019-02-08 19:31:22 +02:00
Kubernetes Prow Robot 5bedff6625
Merge pull request #73836 from Random-Liu/clarify-hostname-in-cri
Clarify hostname emptiness in CRI.
2019-02-08 09:06:27 -08:00