Commit Graph

17692 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
4198d66457 Merge pull request #108835 from guettli/patch-2
Extend example to contain --as=...
2023-01-30 08:00:50 -08:00
Kubernetes Prow Robot
c829397f7a Merge pull request #115354 from pohly/dra-reserved-for-list-type
dynamic resource allocation: avoid apiserver complaint about list content
2023-01-30 06:24:50 -08:00
Kubernetes Prow Robot
a94a35293b Merge pull request #114490 from MadhavJivrajani/update-contention-profiling-docs
*: Make docs more accurate for the contention-profiling flag
2023-01-29 17:20:49 -08:00
Thomas Guettler
2b980b8c01 Extend example to contain --as==... 2023-01-29 19:39:58 +01:00
Kubernetes Prow Robot
8e642d3d0d Merge pull request #115310 from mzaian/etcd-3.5.7-build-image
etcd: Update to version 3.5.7
2023-01-28 10:20:42 -08:00
Kubernetes Prow Robot
d7cb1c54a5 Merge pull request #115145 from alexzielenski/apiserver/policy/typed-params
ValidatingAdmissionPolicy: use natively-typed informer for params
2023-01-27 16:24:33 -08:00
Kubernetes Prow Robot
1f02f43ec6 Merge pull request #114997 from Richabanker/metrics-slis-beta
Enable ComponentSLI as beta feature
2023-01-27 10:04:25 -08:00
Mohamed Zaian
90570b7595 etcd: Update to version 3.5.7 2023-01-27 17:24:00 +01:00
Patrick Ohly
508cd60760 dynamic resource allocation: avoid apiserver complaint about list content
This fixes the following warning (error?) in the apiserver:

E0126 18:10:38.665239   16370 fieldmanager.go:210] "[SHOULD NOT HAPPEN] failed to update managedFields" err="failed to convert new object (test/claim-84; resource.k8s.io/v1alpha1, Kind=ResourceClaim) to smd typed: .status.reservedFor: element 0: associative list without keys has an element that's a map type" VersionKind="/, Kind=" namespace="test" name="claim-84"

The root cause is the same as in e50e8a0c91:
nothing in Kubernetes outright complains about a list of items where the item
type is comparable in Go, but not a simple type. This nonetheless isn't
supposed to be done in the API and can causes problems elsewhere.

For the ReservedFor field, everything seems to work okay except for the
warning. However, it's better to follow conventions and use a map. This is
possible in this case because UID is guaranteed to be a unique key.

Validation is now stricter than before, which is a good thing: previously,
two entries with the same UID were allowed as long as some other field was
different, which wasn't a situation that should have been allowed.
2023-01-27 11:33:05 +01:00
Kubernetes Prow Robot
3bf42a7aec Merge pull request #110253 from tkashem/retry-condition-test
client-go: add a test to document retry conditions
2023-01-27 00:46:24 -08:00
Richa Banker
452343367c Enable ComponentSLIs as beta feature 2023-01-26 17:46:21 -08:00
Kubernetes Prow Robot
301fa8f633 Merge pull request #115327 from jkh52/fix-metrics
Fix konnectivity-client metric registration.
2023-01-26 17:42:39 -08:00
Joseph Anttila Hall
1a428fd1fa Fix konnectivity-client metric registration. 2023-01-26 14:41:29 -08:00
Alexander Zielenski
24fb6b8981 use transformer to set gvk back 2023-01-26 12:14:14 -08:00
Kubernetes Prow Robot
0e6f4d3a35 Merge pull request #115271 from kevindelgado/field-validation-conformance
Field validation e2e tests and GA graduation
2023-01-26 09:34:26 -08:00
Abu Kashem
68c542d522 client-go: add test to document retry conditions 2023-01-26 12:11:48 -05:00
Kevin Delgado
b149b93189 update codegen 2023-01-26 14:31:40 +00:00
Kevin Delgado
2d5ceb9b15 drop Enabled() checks for ServerSideFieldValidation feature gate 2023-01-26 14:16:58 +00:00
Kubernetes Prow Robot
668477e994 Merge pull request #115308 from pohly/logs-goflag-example
logs examples
2023-01-26 02:14:26 -08:00
Kubernetes Prow Robot
eb4e2a2225 Merge pull request #115302 from alexzielenski/apiserver/discovery/lastreconciled-race
fix race in aggregated discovery controller
2023-01-25 23:12:24 -08:00
Kubernetes Prow Robot
fab126d7f3 Merge pull request #113121 from aramase/expiring-cache
kmsv2: implement expire cache with clock
2023-01-25 19:04:25 -08:00
Alexander Zielenski
65513eac3a add unfortunate deepcopy 2023-01-25 16:22:00 -08:00
Anish Ramasekar
4804baa011 kmsv2: implement expire cache with clock
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2023-01-25 22:50:32 +00:00
Patrick Ohly
74885d1a1d logs: add logger.V(5).Info example
This is relevant for unit tests where normally such output would be shown
when using ktesting.
2023-01-25 08:49:05 +01:00
Patrick Ohly
0a38a5e68a logs: remove example of secret data
Dynamic log
sanitization (https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/1753-logs-sanitization)
got removed a while back, there's no need to have it in the example anymore.
2023-01-25 08:45:12 +01:00
Patrick Ohly
a753466fe4 logs: add examples for Go flag and unit testing
All examples use the same code for producing output. Only the way how logging
is configured is different.
2023-01-25 08:43:01 +01:00
Alexander Zielenski
cff4d07581 fix race in aggregated discovery handler
Caused by following sequence:

1. Add APIService to map
2. Begin Async Fetch
3. Remove APIService from map
4. Finish Async Fetch & stores apiservice back in map to update lastReconciled time

fixes by removing lastReconciled (only used for testing) and switching tests to just waiting until dirty queue is empty
2023-01-24 17:32:51 -08:00
Kubernetes Prow Robot
d29e3bd7aa Merge pull request #114731 from pohly/logs-go-flagset
logs: add AddGoFlags
2023-01-24 16:58:21 -08:00
Kubernetes Prow Robot
df03edaf75 Merge pull request #114550 from alexzielenski/apiserver/smd/update-kube-openapi
update kube-openapi dependency
2023-01-24 16:58:09 -08:00
Kubernetes Prow Robot
14549722e4 Merge pull request #106379 from shivanshu1333/feature/master/105782
Implemented MarshalLog in namespacedname.go
2023-01-24 12:55:53 -08:00
Alexander Zielenski
1554e50be4 fix integration test by working around #3030
test uses kind field which is not populated for native types
2023-01-24 12:51:29 -08:00
Kevin Delgado
3b6c4d307f Graduate field validation to GA 2023-01-24 17:48:57 +00:00
Patrick Ohly
6f3e5e30e5 logs: consolidate unit tests
TestFlags got superseded by TestFlagSet/pflag in
8251a63269.
2023-01-24 14:58:37 +01:00
Patrick Ohly
d627b1686c logs: support standard flag.FlagSet
This is useful for binaries that don't use pflag and cannot migrate to it
because they have to support the traditional single-dash command line
parsing. pflag is a drop-in replacement at the source code level, but the
behavior of flag parsing in the resulting binary is different.
2023-01-24 14:58:19 +01:00
Alexander Zielenski
7641ff7541 update kube-openapi 2023-01-23 15:32:33 -08:00
Kubernetes Prow Robot
674eb36f92 Merge pull request #115249 from thockin/codegen-13-proto-go-packages
Set go_package in all proto files
2023-01-23 12:14:07 -08:00
Kubernetes Prow Robot
cc60df9595 Merge pull request #115267 from enj/enj/i/key_id_flake
Prime KMS v2 key ID inline with transformer construction
2023-01-23 10:02:19 -08:00
Tim Hockin
bc1103e45f Set proto go_package: kubelet plugin register API
This exposes that the hand-written code used the wrong package name.

This also creates some diff to the *.pb.go files to note that in the
"options".

You can dump the gzipped blob with the following program (thanks
StackOverflow!):

```go
package main

import (
	"bytes"
	"compress/gzip"
	"encoding/json"
	"fmt"
	"os"

	"io/ioutil"

	proto "github.com/golang/protobuf/proto"
	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
)

func main() {
	m := map[string][]byte{
		"before": blobv1,
		"after": blobv2,
	}
	arg := os.Args[1]
	dump(m[arg])
}

func dump(bytes []byte) {
	fd, err := decodeFileDesc(bytes)
	if err != nil {
		panic(err)
	}
	b, err := json.MarshalIndent(fd, "", "  ")
	if err != nil {
		panic(err)
	}
	fmt.Println(string(b))
}

// decompress does gzip decompression.
func decompress(b []byte) ([]byte, error) {
	r, err := gzip.NewReader(bytes.NewReader(b))
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	out, err := ioutil.ReadAll(r)
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	return out, nil
}

func decodeFileDesc(enc []byte) (*dpb.FileDescriptorProto, error) {
	raw, err := decompress(enc)
	if err != nil {
		return nil, fmt.Errorf("failed to decompress enc: %v", err)
	}

	fd := new(dpb.FileDescriptorProto)
	if err := proto.Unmarshal(raw, fd); err != nil {
		return nil, fmt.Errorf("bad descriptor: %v", err)
	}
	return fd, nil
}
```
2023-01-23 09:48:39 -08:00
Tim Hockin
22ddeb02c1 Set proto go_package: kubelet deviceplugin API
This exposes that the hand-written code used the wrong package name.

This also creates some diff to the *.pb.go files to note that in the
"options".

You can dump the gzipped blob with the following program (thanks
StackOverflow!):

```go
package main

import (
	"bytes"
	"compress/gzip"
	"encoding/json"
	"fmt"
	"os"

	"io/ioutil"

	proto "github.com/golang/protobuf/proto"
	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
)

func main() {
	m := map[string][]byte{
		"before": blobv1,
		"after": blobv2,
	}
	arg := os.Args[1]
	dump(m[arg])
}

func dump(bytes []byte) {
	fd, err := decodeFileDesc(bytes)
	if err != nil {
		panic(err)
	}
	b, err := json.MarshalIndent(fd, "", "  ")
	if err != nil {
		panic(err)
	}
	fmt.Println(string(b))
}

// decompress does gzip decompression.
func decompress(b []byte) ([]byte, error) {
	r, err := gzip.NewReader(bytes.NewReader(b))
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	out, err := ioutil.ReadAll(r)
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	return out, nil
}

func decodeFileDesc(enc []byte) (*dpb.FileDescriptorProto, error) {
	raw, err := decompress(enc)
	if err != nil {
		return nil, fmt.Errorf("failed to decompress enc: %v", err)
	}

	fd := new(dpb.FileDescriptorProto)
	if err := proto.Unmarshal(raw, fd); err != nil {
		return nil, fmt.Errorf("bad descriptor: %v", err)
	}
	return fd, nil
}
```
2023-01-23 09:40:26 -08:00
Tim Hockin
e4e26a7f0c Set proto go_package: kubelet dynamic resource API
This package was specifying the option, but wrongly.

This also creates some diff to the *.pb.go files to note that in the
"options".

You can dump the gzipped blob with the following program (thanks
StackOverflow!):

```go
package main

import (
	"bytes"
	"compress/gzip"
	"encoding/json"
	"fmt"
	"os"

	"io/ioutil"

	proto "github.com/golang/protobuf/proto"
	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
)

func main() {
	m := map[string][]byte{
		"before": blobv1,
		"after": blobv2,
	}
	arg := os.Args[1]
	dump(m[arg])
}

func dump(bytes []byte) {
	fd, err := decodeFileDesc(bytes)
	if err != nil {
		panic(err)
	}
	b, err := json.MarshalIndent(fd, "", "  ")
	if err != nil {
		panic(err)
	}
	fmt.Println(string(b))
}

// decompress does gzip decompression.
func decompress(b []byte) ([]byte, error) {
	r, err := gzip.NewReader(bytes.NewReader(b))
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	out, err := ioutil.ReadAll(r)
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	return out, nil
}

func decodeFileDesc(enc []byte) (*dpb.FileDescriptorProto, error) {
	raw, err := decompress(enc)
	if err != nil {
		return nil, fmt.Errorf("failed to decompress enc: %v", err)
	}

	fd := new(dpb.FileDescriptorProto)
	if err := proto.Unmarshal(raw, fd); err != nil {
		return nil, fmt.Errorf("bad descriptor: %v", err)
	}
	return fd, nil
}
```
2023-01-23 09:36:45 -08:00
Tim Hockin
a2603fdb81 Set proto go_package: podresources API
This creates some diff to the *.pb.go files to note that
in the "options".

You can dump the gzipped blob with the following program (thanks
StackOverflow!):

```go
package main

import (
	"bytes"
	"compress/gzip"
	"encoding/json"
	"fmt"
	"os"

	"io/ioutil"

	proto "github.com/golang/protobuf/proto"
	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
)

func main() {
	m := map[string][]byte{
		"before": blobv1,
		"after": blobv2,
	}
	arg := os.Args[1]
	dump(m[arg])
}

func dump(bytes []byte) {
	fd, err := decodeFileDesc(bytes)
	if err != nil {
		panic(err)
	}
	b, err := json.MarshalIndent(fd, "", "  ")
	if err != nil {
		panic(err)
	}
	fmt.Println(string(b))
}

// decompress does gzip decompression.
func decompress(b []byte) ([]byte, error) {
	r, err := gzip.NewReader(bytes.NewReader(b))
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	out, err := ioutil.ReadAll(r)
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	return out, nil
}

func decodeFileDesc(enc []byte) (*dpb.FileDescriptorProto, error) {
	raw, err := decompress(enc)
	if err != nil {
		return nil, fmt.Errorf("failed to decompress enc: %v", err)
	}

	fd := new(dpb.FileDescriptorProto)
	if err := proto.Unmarshal(raw, fd); err != nil {
		return nil, fmt.Errorf("bad descriptor: %v", err)
	}
	return fd, nil
}
```
2023-01-23 09:31:20 -08:00
Tim Hockin
ab11d8a449 Set proto go_package: kms API
This creates some diff to the *.pb.go files to note that
in the "options".

You can dump the gzipped blob with the following program (thanks
StackOverflow!):

```go
package main

import (
	"bytes"
	"compress/gzip"
	"encoding/json"
	"fmt"
	"os"

	"io/ioutil"

	proto "github.com/golang/protobuf/proto"
	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
)

func main() {
	m := map[string][]byte{
		"before": blobv1,
		"after": blobv2,
	}
	arg := os.Args[1]
	dump(m[arg])
}

func dump(bytes []byte) {
	fd, err := decodeFileDesc(bytes)
	if err != nil {
		panic(err)
	}
	b, err := json.MarshalIndent(fd, "", "  ")
	if err != nil {
		panic(err)
	}
	fmt.Println(string(b))
}

// decompress does gzip decompression.
func decompress(b []byte) ([]byte, error) {
	r, err := gzip.NewReader(bytes.NewReader(b))
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	out, err := ioutil.ReadAll(r)
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	return out, nil
}

func decodeFileDesc(enc []byte) (*dpb.FileDescriptorProto, error) {
	raw, err := decompress(enc)
	if err != nil {
		return nil, fmt.Errorf("failed to decompress enc: %v", err)
	}

	fd := new(dpb.FileDescriptorProto)
	if err := proto.Unmarshal(raw, fd); err != nil {
		return nil, fmt.Errorf("bad descriptor: %v", err)
	}
	return fd, nil
}
```
2023-01-23 09:31:19 -08:00
Monis Khan
345f41f8e5 Prime KMS v2 key ID inline with transformer construction
Signed-off-by: Monis Khan <mok@microsoft.com>
2023-01-23 10:14:46 -05:00
Patrick Ohly
bc6c7fa912 logging: fix names of keys
The stricter checking with the upcoming logcheck v0.4.1 pointed out these names
which don't comply with our recommendations in
https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/migration-to-structured-logging.md#name-arguments.
2023-01-23 14:24:29 +01:00
Mikhail Mazurskiy
771ab7488d Always emit the stopped leading event 2023-01-23 21:07:45 +11:00
Kubernetes Prow Robot
91cfe7f0c3 Merge pull request #115246 from thockin/codegen-11-swagger-from-update-codegen
Generate swagger from update-codegen
2023-01-22 11:24:10 -08:00
Kubernetes Prow Robot
bc2fccaa96 Merge pull request #115245 from thockin/codegen-10-protobuf-from-update-codegen
Call update-generated-protobuf from update-codegen
2023-01-22 11:24:03 -08:00
Tim Hockin
1c466a8190 Generate swagger from update-codegen
Swagger "docs" are actually Go code, which is used by other codegen
tools, so if you really want to regen EVERYTHING, this is part of it and
sequence matters.
2023-01-21 16:51:25 -08:00
Tim Hockin
0ef664c278 Call update-generated-protobuf from update-codegen
Calling update-codegen.sh with no arguments runs all the functions in
definition order.  Client-generation depends on protobuf, so protobuf
codegen needs to be near the beginning.

Also add some debug output for protobuf generation.

Also hide some old, verbose debug output.
2023-01-21 16:32:18 -08:00
Tim Hockin
4dae505d53 Call update-proto-bindings from update-codegen
One script to bring them all ...
2023-01-21 15:17:42 -08:00