mirror of
https://github.com/kubernetes/sample-controller.git
synced 2026-08-03 00:00:02 +08:00
Merge pull request #67596 from nikhita/add-apimachinery-label-owners
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Add sig/api-machinery label to apimachinery OWNERS files Inspired by https://github.com/kubernetes/kubernetes/pull/67548. List of OWNERS files taken from https://github.com/kubernetes/community/blob/master/sig-api-machinery/README.md#subprojects. **Release note**: ```release-note NONE ``` Kubernetes-commit: 8f4ab6fe7635983443ebef7fde5b9c8861bef5bb
This commit is contained in:
Generated
+204
-204
File diff suppressed because it is too large
Load Diff
@@ -7,3 +7,5 @@ reviewers:
|
|||||||
- sttts
|
- sttts
|
||||||
- munnerz
|
- munnerz
|
||||||
- nikhita
|
- nikhita
|
||||||
|
labels:
|
||||||
|
- sig/api-machinery
|
||||||
|
|||||||
+11
@@ -20,10 +20,12 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"net/http"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
|
||||||
"github.com/gogo/protobuf/proto"
|
"github.com/gogo/protobuf/proto"
|
||||||
|
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
"k8s.io/apimachinery/pkg/runtime/serializer/recognizer"
|
"k8s.io/apimachinery/pkg/runtime/serializer/recognizer"
|
||||||
@@ -50,6 +52,15 @@ func (e errNotMarshalable) Error() string {
|
|||||||
return fmt.Sprintf("object %v does not implement the protobuf marshalling interface and cannot be encoded to a protobuf message", e.t)
|
return fmt.Sprintf("object %v does not implement the protobuf marshalling interface and cannot be encoded to a protobuf message", e.t)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (e errNotMarshalable) Status() metav1.Status {
|
||||||
|
return metav1.Status{
|
||||||
|
Status: metav1.StatusFailure,
|
||||||
|
Code: http.StatusNotAcceptable,
|
||||||
|
Reason: metav1.StatusReason("NotAcceptable"),
|
||||||
|
Message: e.Error(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func IsNotMarshalable(err error) bool {
|
func IsNotMarshalable(err error) bool {
|
||||||
_, ok := err.(errNotMarshalable)
|
_, ok := err.(errNotMarshalable)
|
||||||
return err != nil && ok
|
return err != nil && ok
|
||||||
|
|||||||
+7
-2
@@ -29,6 +29,8 @@ import (
|
|||||||
func init() {
|
func init() {
|
||||||
sDec, _ := base64.StdEncoding.DecodeString("REDACTED+")
|
sDec, _ := base64.StdEncoding.DecodeString("REDACTED+")
|
||||||
redactedBytes = []byte(string(sDec))
|
redactedBytes = []byte(string(sDec))
|
||||||
|
sDec, _ = base64.StdEncoding.DecodeString("DATA+OMITTED")
|
||||||
|
dataOmittedBytes = []byte(string(sDec))
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsConfigEmpty returns true if the config is empty.
|
// IsConfigEmpty returns true if the config is empty.
|
||||||
@@ -79,7 +81,10 @@ func MinifyConfig(config *Config) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var redactedBytes []byte
|
var (
|
||||||
|
redactedBytes []byte
|
||||||
|
dataOmittedBytes []byte
|
||||||
|
)
|
||||||
|
|
||||||
// Flatten redacts raw data entries from the config object for a human-readable view.
|
// Flatten redacts raw data entries from the config object for a human-readable view.
|
||||||
func ShortenConfig(config *Config) {
|
func ShortenConfig(config *Config) {
|
||||||
@@ -97,7 +102,7 @@ func ShortenConfig(config *Config) {
|
|||||||
}
|
}
|
||||||
for key, cluster := range config.Clusters {
|
for key, cluster := range config.Clusters {
|
||||||
if len(cluster.CertificateAuthorityData) > 0 {
|
if len(cluster.CertificateAuthorityData) > 0 {
|
||||||
cluster.CertificateAuthorityData = redactedBytes
|
cluster.CertificateAuthorityData = dataOmittedBytes
|
||||||
}
|
}
|
||||||
config.Clusters[key] = cluster
|
config.Clusters[key] = cluster
|
||||||
}
|
}
|
||||||
|
|||||||
+3
@@ -6,3 +6,6 @@ reviewers:
|
|||||||
- lavalamp
|
- lavalamp
|
||||||
- wojtek-t
|
- wojtek-t
|
||||||
- sttts
|
- sttts
|
||||||
|
labels:
|
||||||
|
- sig/api-machinery
|
||||||
|
- area/code-generation
|
||||||
|
|||||||
Reference in New Issue
Block a user