Merge pull request #82705 from deads2k/agg-authn-publish

use controller to publish cluster authentication info

Kubernetes-commit: a5fe905be420d518892e8e8b682902deef82d1c6
This commit is contained in:
Kubernetes Publisher
2019-11-07 09:03:10 -08:00
4 changed files with 23 additions and 11 deletions

6
Godeps/Godeps.json generated
View File

@@ -348,11 +348,11 @@
},
{
"ImportPath": "k8s.io/api",
"Rev": "43b1ad33cf6f"
"Rev": "5d8c3d1f60af"
},
{
"ImportPath": "k8s.io/apimachinery",
"Rev": "9c5262af35ca"
"Rev": "4ce4ee60b177"
},
{
"ImportPath": "k8s.io/gengo",
@@ -364,7 +364,7 @@
},
{
"ImportPath": "k8s.io/kube-openapi",
"Rev": "743ec37842bf"
"Rev": "30be4d16710a"
},
{
"ImportPath": "k8s.io/utils",

8
go.mod
View File

@@ -28,8 +28,8 @@ require (
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
google.golang.org/appengine v1.5.0 // indirect
k8s.io/api v0.0.0-20191107110442-43b1ad33cf6f
k8s.io/apimachinery v0.0.0-20191107082716-9c5262af35ca
k8s.io/api v0.0.0-20191108101507-5d8c3d1f60af
k8s.io/apimachinery v0.0.0-20191108101507-4ce4ee60b177
k8s.io/klog v1.0.0
k8s.io/utils v0.0.0-20191030222137-2b95a09bc58d
sigs.k8s.io/yaml v1.1.0
@@ -38,6 +38,6 @@ require (
replace (
golang.org/x/sys => golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a
golang.org/x/tools => golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7
k8s.io/api => k8s.io/api v0.0.0-20191107110442-43b1ad33cf6f
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20191107082716-9c5262af35ca
k8s.io/api => k8s.io/api v0.0.0-20191108101507-5d8c3d1f60af
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20191108101507-4ce4ee60b177
)

8
go.sum
View File

@@ -191,15 +191,15 @@ gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
k8s.io/api v0.0.0-20191107110442-43b1ad33cf6f/go.mod h1:/24HivhMZ6CLcfc0Nk41go4k5jb5bBTAP+9UA293OCw=
k8s.io/apimachinery v0.0.0-20191107082716-9c5262af35ca/go.mod h1:DJOb3m0kw91A0YaUsaoYChi4d7xVF84HLiuRCxGsV04=
k8s.io/api v0.0.0-20191108101507-5d8c3d1f60af/go.mod h1:imUKtxJrdH7sLzxnW0ep/MClaxwk3jqcQByiz2y/424=
k8s.io/apimachinery v0.0.0-20191108101507-4ce4ee60b177/go.mod h1:nEP/6rwhzfljWYGVS6pfyES3ipZTR19vzMnSM+ur3ho=
k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8=
k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf h1:EYm5AW/UUDbnmnI+gK0TJDVK9qPLhM+sRHYanNKw0EQ=
k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E=
k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU=
k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E=
k8s.io/utils v0.0.0-20191030222137-2b95a09bc58d h1:1P0iBJsBzxRmR+dIFnM+Iu4aLxnoa7lBqozW/0uHbT8=
k8s.io/utils v0.0.0-20191030222137-2b95a09bc58d/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI=

View File

@@ -17,6 +17,7 @@ limitations under the License.
package cert
import (
"bytes"
"crypto/x509"
"encoding/pem"
"errors"
@@ -59,3 +60,14 @@ func ParseCertsPEM(pemCerts []byte) ([]*x509.Certificate, error) {
}
return certs, nil
}
// EncodeCertificates returns the PEM-encoded byte array that represents by the specified certs.
func EncodeCertificates(certs ...*x509.Certificate) ([]byte, error) {
b := bytes.Buffer{}
for _, cert := range certs {
if err := pem.Encode(&b, &pem.Block{Type: CertificateBlockType, Bytes: cert.Raw}); err != nil {
return []byte{}, err
}
}
return b.Bytes(), nil
}