Skip to content

Commit

Permalink
upgrade to latest dependencies (#4785)
Browse files Browse the repository at this point in the history
bumping knative.dev/pkg 8cd47b5...7101e9d:
  > 7101e9d allow the addressable ducktype to act as an ownerref (# 1999)
  > 250a183 Bump K8s libs to 1.19 (# 1986)
  > 2f4dd35 Switch Webhook to ed25519 and expiration of the certificate to seven days (# 1998)
  > 32a3248 upgrade to latest dependencies (# 1997)
  > 992644a Update common github actions (# 1996)

Signed-off-by: Knative Automation <automation@knative.team>
  • Loading branch information
knative-automation authored Jan 25, 2021
1 parent 0c86634 commit 340f07f
Show file tree
Hide file tree
Showing 15 changed files with 54 additions and 35 deletions.
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ require (
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a
google.golang.org/grpc v1.34.0
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect
k8s.io/api v0.18.12
k8s.io/apiextensions-apiserver v0.18.12
k8s.io/apimachinery v0.18.12
k8s.io/api v0.19.7
k8s.io/apiextensions-apiserver v0.19.7
k8s.io/apimachinery v0.19.7
k8s.io/apiserver v0.18.12
k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible
k8s.io/utils v0.0.0-20200603063816-c1c6865ac451
knative.dev/hack v0.0.0-20210120165453-8d623a0af457
knative.dev/pkg v0.0.0-20210120200253-8cd47b5af35d
knative.dev/pkg v0.0.0-20210124203454-7101e9d4f6c6
knative.dev/reconciler-test v0.0.0-20210115075620-6fe6ef693370
sigs.k8s.io/yaml v1.2.0
)
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,8 @@ k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8
k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/gengo v0.0.0-20200205140755-e0e292d8aa12 h1:pZzawYyz6VRNPVYpqGv61LWCimQv1BihyeqFrp50/G4=
k8s.io/gengo v0.0.0-20200205140755-e0e292d8aa12/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14 h1:t4L10Qfx/p7ASH3gXCdIUtPbbIuegCoUJf3TMSFekjw=
k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/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=
Expand All @@ -1103,8 +1105,8 @@ knative.dev/hack v0.0.0-20210114150620-4422dcadb3c8/go.mod h1:PHt8x8yX5Z9pPquBEf
knative.dev/hack v0.0.0-20210120165453-8d623a0af457 h1:jEBITgx/lQydGncM0uetpv/ZqawRzb2aSfEaYoMeDjM=
knative.dev/hack v0.0.0-20210120165453-8d623a0af457/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/pkg v0.0.0-20210114223020-f0ea5e6b9c4e/go.mod h1:hckgW978SdzPA2H5EDvRPY8xsnPuDZLJLbPf8Jte7Q0=
knative.dev/pkg v0.0.0-20210120200253-8cd47b5af35d h1:comSR1hmEy30T0rUE29LcVqxnf6pof+ngmCs4XyBR8Q=
knative.dev/pkg v0.0.0-20210120200253-8cd47b5af35d/go.mod h1:cZdMjcJE6JGSNaEypgbUigX1TjteMIwQsW2woNBPVCA=
knative.dev/pkg v0.0.0-20210124203454-7101e9d4f6c6 h1:jMwOlw2AZx9KlfIExLCFjcpM5jxL4huwfhHvRPqrTSI=
knative.dev/pkg v0.0.0-20210124203454-7101e9d4f6c6/go.mod h1:X4NPrCo8NK3hbDVan9Vm7mf5io3ZoINakAdrpSXVB08=
knative.dev/reconciler-test v0.0.0-20210115075620-6fe6ef693370 h1:7fujJwweqHPFalmkz/HlNgTQy6VJyRRuZN3eyqQFSL0=
knative.dev/reconciler-test v0.0.0-20210115075620-6fe6ef693370/go.mod h1:A5ZaQo+1lWGw2OoSc06wSyReX6huzBPJ2ra/R48s1yo=
pgregory.net/rapid v0.3.3 h1:jCjBsY4ln4Atz78QoBWxUEvAHaFyNDQg9+WU62aCn1U=
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/k8s.io/gengo/examples/set-gen/generators/sets.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/k8s.io/gengo/examples/set-gen/generators/tags.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/k8s.io/gengo/generator/execute.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/k8s.io/gengo/generator/import_tracker.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions vendor/k8s.io/gengo/parser/parse.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions vendor/knative.dev/pkg/apis/duck/v1/addressable_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ import (

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"

"knative.dev/pkg/apis"
"knative.dev/pkg/apis/duck/ducktypes"
"knative.dev/pkg/kmeta"
)

// +genduck
Expand Down Expand Up @@ -67,6 +69,7 @@ type AddressStatus struct {
var (
_ apis.Listable = (*AddressableType)(nil)
_ ducktypes.Populatable = (*AddressableType)(nil)
_ kmeta.OwnerRefable = (*AddressableType)(nil)
)

// GetFullType implements duck.Implementable
Expand Down Expand Up @@ -97,6 +100,11 @@ func (t *AddressableType) Populate() {
}
}

// GetGroupVersionKind implements kmeta.OwnerRefable
func (t *AddressableType) GetGroupVersionKind() schema.GroupVersionKind {
return t.GroupVersionKind()
}

// GetListType implements apis.Listable
func (*AddressableType) GetListType() runtime.Object {
return &AddressableTypeList{}
Expand Down
4 changes: 2 additions & 2 deletions vendor/knative.dev/pkg/webhook/certificates/certificates.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (

const (
// Time used for updating a certificate before it expires.
oneWeek = 7 * 24 * time.Hour
oneDay = 24 * time.Hour
)

type reconciler struct {
Expand Down Expand Up @@ -89,7 +89,7 @@ func (r *reconciler) reconcileCertificate(ctx context.Context) error {
certData, err := x509.ParseCertificate(cert.Certificate[0])
if err != nil {
logger.Errorw("Error parsing certificate", zap.Error(err))
} else if time.Now().Add(oneWeek).Before(certData.NotAfter) {
} else if time.Now().Add(oneDay).Before(certData.NotAfter) {
return nil
}
}
Expand Down
23 changes: 14 additions & 9 deletions vendor/knative.dev/pkg/webhook/certificates/resources/certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ package resources

import (
"context"
"crypto/ed25519"
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
Expand Down Expand Up @@ -62,7 +62,7 @@ func createCertTemplate(name, namespace string, notAfter time.Time) (*x509.Certi
Organization: []string{organization},
CommonName: commonName,
},
SignatureAlgorithm: x509.SHA256WithRSA,
SignatureAlgorithm: x509.PureEd25519,
NotBefore: time.Now(),
NotAfter: notAfter,
BasicConstraintsValid: true,
Expand Down Expand Up @@ -112,9 +112,9 @@ func createCert(template, parent *x509.Certificate, pub, parentPriv interface{})
return
}

func createCA(ctx context.Context, name, namespace string, notAfter time.Time) (*rsa.PrivateKey, *x509.Certificate, []byte, error) {
func createCA(ctx context.Context, name, namespace string, notAfter time.Time) (ed25519.PrivateKey, *x509.Certificate, []byte, error) {
logger := logging.FromContext(ctx)
rootKey, err := rsa.GenerateKey(rand.Reader, 2048)
publicKey, privateKey, err := ed25519.GenerateKey(rand.Reader)
if err != nil {
logger.Errorw("error generating random key", zap.Error(err))
return nil, nil, nil, err
Expand All @@ -126,12 +126,12 @@ func createCA(ctx context.Context, name, namespace string, notAfter time.Time) (
return nil, nil, nil, err
}

rootCert, rootCertPEM, err := createCert(rootCertTmpl, rootCertTmpl, &rootKey.PublicKey, rootKey)
rootCert, rootCertPEM, err := createCert(rootCertTmpl, rootCertTmpl, publicKey, privateKey)
if err != nil {
logger.Errorw("error signing the CA cert", zap.Error(err))
return nil, nil, nil, err
}
return rootKey, rootCert, rootCertPEM, nil
return privateKey, rootCert, rootCertPEM, nil
}

// CreateCerts creates and returns a CA certificate and certificate and
Expand All @@ -148,7 +148,7 @@ func CreateCerts(ctx context.Context, name, namespace string, notAfter time.Time
}

// Then create the private key for the serving cert
servKey, err := rsa.GenerateKey(rand.Reader, 2048)
publicKey, privateKey, err := ed25519.GenerateKey(rand.Reader)
if err != nil {
logger.Errorw("error generating random key", zap.Error(err))
return nil, nil, nil, err
Expand All @@ -160,13 +160,18 @@ func CreateCerts(ctx context.Context, name, namespace string, notAfter time.Time
}

// create a certificate which wraps the server's public key, sign it with the CA private key
_, servCertPEM, err := createCert(servCertTemplate, caCertificate, &servKey.PublicKey, caKey)
_, servCertPEM, err := createCert(servCertTemplate, caCertificate, publicKey, caKey)
if err != nil {
logger.Errorw("error signing server certificate template", zap.Error(err))
return nil, nil, nil, err
}
privKeyBytes, err := x509.MarshalPKCS8PrivateKey(privateKey)
if err != nil {
logger.Errorw("error marshaling private key", zap.Error(err))
return nil, nil, nil, err
}
servKeyPEM := pem.EncodeToMemory(&pem.Block{
Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(servKey),
Type: "PRIVATE KEY", Bytes: privKeyBytes,
})
return servKeyPEM, servCertPEM, caCertificatePEM, nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ const (
// CACert is the name of the key associated with the certificate of the CA for
// the keypair.
CACert = "ca-cert.pem"

oneWeek = 7 * 24 * time.Hour
)

// MakeSecret synthesizes a Kubernetes Secret object with the keys specified by
Expand All @@ -41,7 +43,7 @@ var MakeSecret = MakeSecretInternal

// MakeSecretInternal is only public so MakeSecret can be restored in testing. Use MakeSecret.
func MakeSecretInternal(ctx context.Context, name, namespace, serviceName string) (*corev1.Secret, error) {
serverKey, serverCert, caCert, err := CreateCerts(ctx, serviceName, namespace, time.Now().AddDate(1, 0, 0))
serverKey, serverCert, caCert, err := CreateCerts(ctx, serviceName, namespace, time.Now().Add(oneWeek))
if err != nil {
return nil, err
}
Expand Down
12 changes: 6 additions & 6 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ gopkg.in/yaml.v2
# gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776
## explicit
gopkg.in/yaml.v3
# k8s.io/api v0.18.12 => k8s.io/api v0.18.12
# k8s.io/api v0.19.7 => k8s.io/api v0.18.12
## explicit
k8s.io/api/admission/v1
k8s.io/api/admissionregistration/v1
Expand Down Expand Up @@ -610,7 +610,7 @@ k8s.io/api/settings/v1alpha1
k8s.io/api/storage/v1
k8s.io/api/storage/v1alpha1
k8s.io/api/storage/v1beta1
# k8s.io/apiextensions-apiserver v0.18.12 => k8s.io/apiextensions-apiserver v0.18.12
# k8s.io/apiextensions-apiserver v0.19.7 => k8s.io/apiextensions-apiserver v0.18.12
## explicit
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1
Expand All @@ -629,7 +629,7 @@ k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/apiextensio
k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/internalinterfaces
k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/v1
k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/v1beta1
# k8s.io/apimachinery v0.18.12 => k8s.io/apimachinery v0.18.12
# k8s.io/apimachinery v0.19.7 => k8s.io/apimachinery v0.18.12
## explicit
k8s.io/apimachinery/pkg/api/apitesting
k8s.io/apimachinery/pkg/api/apitesting/fuzzer
Expand Down Expand Up @@ -900,7 +900,7 @@ k8s.io/client-go/util/jsonpath
k8s.io/client-go/util/keyutil
k8s.io/client-go/util/retry
k8s.io/client-go/util/workqueue
# k8s.io/code-generator v0.18.12 => k8s.io/code-generator v0.18.12
# k8s.io/code-generator v0.19.7 => k8s.io/code-generator v0.18.12
k8s.io/code-generator
k8s.io/code-generator/cmd/client-gen
k8s.io/code-generator/cmd/client-gen/args
Expand Down Expand Up @@ -934,7 +934,7 @@ k8s.io/code-generator/cmd/set-gen
k8s.io/code-generator/pkg/namer
k8s.io/code-generator/pkg/util
k8s.io/code-generator/third_party/forked/golang/reflect
# k8s.io/gengo v0.0.0-20200205140755-e0e292d8aa12
# k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14
k8s.io/gengo/args
k8s.io/gengo/examples/deepcopy-gen/generators
k8s.io/gengo/examples/defaulter-gen/generators
Expand Down Expand Up @@ -966,7 +966,7 @@ k8s.io/utils/trace
## explicit
knative.dev/hack
knative.dev/hack/shell
# knative.dev/pkg v0.0.0-20210120200253-8cd47b5af35d
# knative.dev/pkg v0.0.0-20210124203454-7101e9d4f6c6
## explicit
knative.dev/pkg/apiextensions/storageversion
knative.dev/pkg/apiextensions/storageversion/cmd/migrate
Expand Down

0 comments on commit 340f07f

Please sign in to comment.