Commit Graph

156 Commits

Author SHA1 Message Date
Neha Lohia
fa1b6765d5
move pkg/util/node to component-helpers/node/util (#105347)
Signed-off-by: Neha Lohia <nehapithadiya444@gmail.com>
2021-11-12 07:52:27 -08:00
Nikhita Raghunath
5deae0121e staging/publishing: fix go version for go1.16.10 2021-11-08 10:16:07 +05:30
Carlos Panato
abbf8c3bed
[go1.17] Update to go1.17.3
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2021-11-07 16:29:35 +01:00
Tim Allclair
c7cdf19cbe Add --version flag to podsecurity-webhook command 2021-10-25 10:26:05 -07:00
Alkaid
ae9ca48f01
[PodSecurity] Implement metricRecorder for admission (#104217)
* init

Signed-off-by: jyz0309 <45495947@qq.com>

go fmt

Signed-off-by: jyz0309 <45495947@qq.com>

remove useless code

Signed-off-by: jyz0309 <45495947@qq.com>

add metrics.Attributes interface

Signed-off-by: jyz0309 <45495947@qq.com>

address comment

Signed-off-by: jyz0309 <45495947@qq.com>

go fmt code

Signed-off-by: jyz0309 <45495947@qq.com>

resolve import cycle

Signed-off-by: jyz0309 <45495947@qq.com>

fix comment

Signed-off-by: jyz0309 <45495947@qq.com>

fix lints

Signed-off-by: jyz0309 <45495947@qq.com>

fix build error

Signed-off-by: jyz0309 <45495947@qq.com>

fix test

Signed-off-by: jyz0309 <45495947@qq.com>

try

Signed-off-by: jyz0309 <45495947@qq.com>

* try to compare version

Signed-off-by: jyz0309 <45495947@qq.com>

fix conflict

Signed-off-by: jyz0309 <45495947@qq.com>

remove unuse change

Signed-off-by: jyz0309 <45495947@qq.com>

* address comment

Signed-off-by: jyz0309 <45495947@qq.com>

* fix import error

Signed-off-by: jyz0309 <45495947@qq.com>

fix import

Signed-off-by: jyz0309 <45495947@qq.com>

address comment

Signed-off-by: jyz0309 <45495947@qq.com>

address comment

Signed-off-by: jyz0309 <45495947@qq.com>

* address comment

Signed-off-by: jyz0309 <45495947@qq.com>

* format code

Signed-off-by: jyz0309 <45495947@qq.com>

* remove exempt and error record

Signed-off-by: jyz0309 <45495947@qq.com>

* ignore pod

Signed-off-by: jyz0309 <45495947@qq.com>

* add decision default value

Signed-off-by: jyz0309 <45495947@qq.com>

* address comment

Signed-off-by: jyz0309 <45495947@qq.com>

* remore useless import

Signed-off-by: jyz0309 <45495947@qq.com>

* remove policy vaild check

Signed-off-by: jyz0309 <45495947@qq.com>

use init to register metric

Signed-off-by: jyz0309 <45495947@qq.com>

fix test

Signed-off-by: jyz0309 <45495947@qq.com>

remove check

Signed-off-by: jyz0309 <45495947@qq.com>

remove blank line

Signed-off-by: jyz0309 <45495947@qq.com>

add allowedImports

Signed-off-by: jyz0309 <45495947@qq.com>

Add mock recorder

Signed-off-by: jyz0309 <45495947@qq.com>

format code

Signed-off-by: jyz0309 <45495947@qq.com>

separe record into 3 function

Signed-off-by: jyz0309 <45495947@qq.com>

* fix comment

Signed-off-by: jyz0309 <45495947@qq.com>
2021-10-20 20:02:08 -07:00
Carlos Panato
5ca8ae9f35
staging/publishing: Set go1.16 version to go1.16.9
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2021-10-14 16:23:31 +02:00
Mengjiao Liu
19e8852154 [go1.17] Update to go1.17.2 2021-10-14 16:15:51 +08:00
Patrick Ohly
21d1bcd6b8 initialize logging after flag parsing
It wasn't documented that InitLogs already uses the log flush frequency, so
some commands have called it before parsing (for example, kubectl in the
original code for logs.go). The flag never had an effect in such commands.

Fixing this turned into a major refactoring of how commands set up flags and
run their Cobra command:

- component-base/logs: implicitely registering flags during package init is an
  anti-pattern that makes it impossible to use the package in commands which
  want full control over their command line. Logging flags must be added
  explicitly now, something that the new cli.Run does automatically.

- component-base/logs: AddFlags would have crashed in kubectl-convert if it
  had been called because it relied on the global pflag.CommandLine. This
  has been fixed and kubectl-convert now has the same --log-flush-frequency
  flag as other commands.

- component-base/logs/testinit: an exception are tests where flag.CommandLine has
  to be used. This new package can be imported to add flags to that
  once per test program.

- Normalization of the klog command line flags was inconsistent. Some commands
  unintentionally didn't normalize to the recommended format with hyphens. This
  gets fixed for sample programs, but not for production programs because
  it would be a breaking change.

This refactoring has the following user-visible effects:

- The validation error for `go run ./cmd/kube-apiserver --logging-format=json
  --add-dir-header` now references `add-dir-header` instead of `add_dir_header`.

- `staging/src/k8s.io/cloud-provider/sample` uses flags with hyphen instead of
  underscore.

- `--log-flush-frequency` is not listed anymore in the --logging-format flag's
  `non-default formats don't honor these flags` usage text because it will also
  work for non-default formats once it is needed.

- `cmd/kubelet`: the description of `--logging-format` uses hyphens instead of
  underscores for the flags, which now matches what the command is using.

- `staging/src/k8s.io/component-base/logs/example/cmd`: added logging flags.

- `apiextensions-apiserver` no longer prints a useless stack trace for `main`
  when command line parsing raises an error.
2021-09-30 13:46:49 +02:00
Kubernetes Prow Robot
9918aa1e03
Merge pull request #105026 from wojtek-t/migrate_clock_2
Unify towards k8s.io/utils/clock - part 2
2021-09-17 00:01:01 -07:00
wojtekt
b7221bc77c Update import restrictions 2021-09-16 10:52:28 +02:00
Carlos Panato
f6faa18659
staging/publishing: Set go1.16 version to go1.16.8
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2021-09-15 14:24:04 +02:00
Carlos Panato
132c7066e0
[go1.17] Update to go1.17.1
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2021-09-14 13:04:25 +02:00
Stephen Augustus
e8d2bff6ba
[go1.17] Update to go1.17
Signed-off-by: Stephen Augustus <foo@auggie.dev>
2021-08-24 15:47:41 -04:00
Antonio Ojea
e1e4408ab3 allow k8s.io/utils/net imports 2021-08-20 10:42:10 +02:00
Jordan Liggitt
ffed59d168 Fix allowed imports for kube-openapi 2021-08-17 11:35:44 -04:00
Stephen Augustus
85d83ebd28
staging/publishing: Set go1.15 version to go1.15.15
Signed-off-by: Stephen Augustus <foo@auggie.dev>
2021-08-08 00:53:30 -04:00
Carlos Panato
6b9dc099f8
[go1.16] Update to go1.16.7
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2021-08-06 17:11:00 +02:00
Kubernetes Prow Robot
0a704f9e1f
Merge pull request #103564 from kevindelgado/unstr-extr-poc
ExtractItems for unstructured apply configurations
2021-08-04 22:10:55 -07:00
Kevin Delgado
4edb6e01be Add kube-openapi to client-go import restrictions 2021-07-28 00:41:30 +00:00
Nikhita Raghunath
363d47c08c staging/publishing: fix rules for legacy-cloud-providers for 1.22
The mount-utils repo is a dependency but got missed from the rules.

This commit fixes the currently broken publishing bot.
2021-07-27 13:50:34 +05:30
Nabarun Pal
0aa16fae5b
staging/publishing: add release-1.22 rules
Signed-off-by: Nabarun Pal <pal.nabarun95@gmail.com>
2021-07-22 19:37:42 +05:30
Carlos Panato
83f8d1ad72
[go1.16] Update to go1.16.6
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2021-07-13 18:05:16 +02:00
Tim Allclair
32783f7568 PodSecurity: Initial webhook implementation 2021-07-09 17:04:29 -07:00
Tim Allclair
cf6ba6096f Move pod-security-admission to an external Attributes interface 2021-07-06 15:15:15 -07:00
Jordan Liggitt
e87016cf94 PodSecurity: add ability to skip failure cases if relevant features are disabled 2021-06-30 22:05:00 -04:00
Jordan Liggitt
b8bdcf6441 PodSecurity: update dependencies 2021-06-28 17:46:00 -04:00
Carlos Panato
1e1a60e310
publishing: Use go1.15.13 for 1.20 and 1.19 release branches
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2021-06-15 15:48:26 +02:00
Carlos Panato
1524526991
[go1.16] Update to go1.16.5
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2021-06-08 14:11:32 +02:00
Srini Brahmaroutu
80a5b00445 Removing utils/mount dependencies from vendor 2021-05-25 22:49:38 -07:00
Tim Allclair
0005c72285 s/standards/admission/ 2021-05-20 17:28:57 -07:00
Tim Allclair
711b8e3a9a Add staging directory for pod-security-standards subproject 2021-05-19 11:51:50 -07:00
Nikhita Raghunath
a1fbc14002 staging/publishing: remove 1.17 and 1.18 rules 2021-05-18 11:03:17 +05:30
Carlos Panato
3048efcf35
publishing: Use go1.15.12 for 1.20 and 1.19 release branches 2021-05-09 09:54:55 +02:00
Stephen Augustus
5b530da51f [go1.16] Update to go1.16.4
Signed-off-by: Stephen Augustus <foo@auggie.dev>
2021-05-07 15:47:54 -04:00
Stephen Augustus
b376c2866b publishing: Use go1.15.11 for 1.20 and 1.19 release branches
Signed-off-by: Stephen Augustus <foo@auggie.dev>
2021-04-19 03:45:00 -04:00
Stephen Augustus
fac97f8a9b [go1.16] Update to go1.16.3
Signed-off-by: Stephen Augustus <foo@auggie.dev>
2021-04-16 19:56:51 -04:00
Nikhita Raghunath
817e0c873d staging/publishing: add go1.15.10 for release-1.20 branch 2021-03-29 14:50:01 +05:30
Nikhita Raghunath
1268d0bb23 staging/publishing: add release-1.21 rules 2021-03-29 14:45:13 +05:30
Nikhita Raghunath
a2e9727f9b staging/publishing: add branch-specific smoke tests
The `-mod=mod` option is only supported from go1.14. Since `release-1.18`
and `release-1.17` branches use go1.13.15, this commit adds smoke tests
per branch to only add the `-mod=mod` option to branches after
`release-1.18`.

The duplicate smoke test config can be removed once v1.21 is released
and v1.18 is out of support.
2021-03-25 12:48:48 +05:30
Stephen Augustus
13ef775df2 [go1.16] Update to go1.16.1
Signed-off-by: Stephen Augustus <foo@auggie.dev>
2021-03-10 19:06:57 -05:00
Benjamin Elder
0659a7dbac add TODO for staging rules cleanup 2021-03-07 15:27:44 -08:00
Nikhita Raghunath
946aea4896 staging/publishing: add -mod=mod for smoke tests for go1.16
With the move to go1.16, we are hitting a go bug for how
`go build`/`go test` work with modules - golang/go#44129.

This commit adds the `-mod=mod` flag for `go build` and `go test`
commands in the smoke test rules (workaround mentioned in the issue).
2021-03-03 09:55:27 +05:30
Stephen Augustus
70641827c1 [go1.16] staging/publishing: Set default go version to go1.16
Signed-off-by: Stephen Augustus <foo@auggie.dev>
2021-03-02 00:38:00 -05:00
Carlos Panato
06740b1848
[go1.15] staging/publishing: Set default go version to go1.15.8 2021-02-06 15:56:05 +01:00
Carlos Panato
d4840b9e2a
[go1.15] staging/publishing: Set default go version to go1.15.7 2021-01-27 11:43:02 +01:00
Tim Hockin
876c9f0d8c Rename _examples to examples
The alternative to this would be to special-case code-generator.  Since
it legit wants codegen, it seems wrong to make it be _examples (which tools
should ignore).

Make examples an "internal module" so the main go.mod for
k8s.io/code-generator does not get too polluted.
2021-01-25 10:20:46 -08:00
Nikhita Raghunath
d8f9ac446c staging/publishing: fix rules for 1.20 2020-12-02 10:49:34 +05:30
Nikhita Raghunath
cda4e25f33 staging/publishing: add release-1.20 rules 2020-12-02 03:00:48 +05:30
Stephen Augustus
3598ccae8e [go1.15] staging/publishing: Set default go version to go1.15.5
Signed-off-by: Stephen Augustus <saugustus@vmware.com>
2020-11-23 20:49:59 -05:00
Andrew Sy Kim
f3192c3149 import restrictions: allow k8s.io/kubelet to import credentialprovider
apis

Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
2020-11-10 13:44:07 -05:00