Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: kubernetes/client-go
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.27.3
Choose a base ref
...
head repository: kubernetes/client-go
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.27.4
Choose a head ref
  • 5 commits
  • 3 files changed
  • 3 contributors

Commits on May 8, 2023

  1. update serial number to a valid non-zero number in ca certificate

    Kubernetes-commit: cd08820ba9a0d5f2f95e3c46e27d01ca046f7d2a
    nnmin-aws authored and k8s-publishing-bot committed May 8, 2023

    Unverified

    This user has not yet uploaded their public signing key.
    Copy the full SHA
    d96d0d8 View commit details

Commits on Jul 5, 2023

  1. call ./hack/update-vendor.sh

    Kubernetes-commit: 39a4cd1a083f0dff5ff3fc78063b64ad3c61099f
    neolit123 authored and k8s-publishing-bot committed Jul 5, 2023

    Unverified

    This user has not yet uploaded their public signing key.
    Copy the full SHA
    af4a748 View commit details
  2. Merge pull request #119086 from neolit123/automated-cherry-pick-of-#1…

    …18150-origin-release-1.27
    
    Automated cherry pick of #118150 origin release 1.27
    
    Kubernetes-commit: 55872a8eb12e1621e72121b18c15fef1f54a76ff
    k8s-publishing-bot committed Jul 5, 2023
    Copy the full SHA
    8d8e2bc View commit details
  3. Merge pull request #118969 from champtar/automated-cherry-pick-of-#11…

    …7791-upstream-release-1.27
    
    Automated cherry pick of #117791: update serial number to a valid non-zero number in ca
    
    Kubernetes-commit: db247e1df34efd17a55a513f196bf53224489a49
    k8s-publishing-bot committed Jul 5, 2023
    Copy the full SHA
    860d25f View commit details

Commits on Jul 19, 2023

  1. Copy the full SHA
    c04e419 View commit details
Showing with 31 additions and 14 deletions.
  1. +4 −4 go.mod
  2. +5 −5 go.sum
  3. +22 −5 util/cert/cert.go
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -24,8 +24,8 @@ require (
golang.org/x/term v0.6.0
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8
google.golang.org/protobuf v1.28.1
k8s.io/api v0.0.0-20230612172207-d65e98cc80fa
k8s.io/apimachinery v0.0.0-20230612171306-38152d47d786
k8s.io/api v0.27.4
k8s.io/apimachinery v0.27.4
k8s.io/klog/v2 v2.90.1
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f
k8s.io/utils v0.0.0-20230209194617-a36077c30491
@@ -59,6 +59,6 @@ require (
)

replace (
k8s.io/api => k8s.io/api v0.0.0-20230612172207-d65e98cc80fa
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20230612171306-38152d47d786
k8s.io/api => k8s.io/api v0.27.4
k8s.io/apimachinery => k8s.io/apimachinery v0.27.4
)
10 changes: 5 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
@@ -177,7 +177,7 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8=
@@ -477,10 +477,10 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
k8s.io/api v0.0.0-20230612172207-d65e98cc80fa h1:KIpNKwhu4sLCUC51XDfLb80EsF+37bdF+SJyiQomWYI=
k8s.io/api v0.0.0-20230612172207-d65e98cc80fa/go.mod h1:L5BsvlvvK+xMF0XOJeO4q5EF3B6BwsJ6FU/gqSj48cQ=
k8s.io/apimachinery v0.0.0-20230612171306-38152d47d786 h1:5apbbWoKi3ZjCSWm5UKfcNW2egne2ZbbG05tyUaKiKE=
k8s.io/apimachinery v0.0.0-20230612171306-38152d47d786/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E=
k8s.io/api v0.27.4 h1:0pCo/AN9hONazBKlNUdhQymmnfLRbSZjd5H5H3f0bSs=
k8s.io/api v0.27.4/go.mod h1:O3smaaX15NfxjzILfiln1D8Z3+gEYpjEpiNA/1EVK1Y=
k8s.io/apimachinery v0.27.4 h1:CdxflD4AF61yewuid0fLl6bM4a3q04jWel0IlP+aYjs=
k8s.io/apimachinery v0.27.4/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E=
k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw=
k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg=
27 changes: 22 additions & 5 deletions util/cert/cert.go
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@ import (
"crypto/x509/pkix"
"encoding/pem"
"fmt"
"math"
"math/big"
"net"
"os"
@@ -57,8 +58,14 @@ type AltNames struct {
// NewSelfSignedCACert creates a CA certificate
func NewSelfSignedCACert(cfg Config, key crypto.Signer) (*x509.Certificate, error) {
now := time.Now()
// returns a uniform random value in [0, max-1), then add 1 to serial to make it a uniform random value in [1, max).
serial, err := cryptorand.Int(cryptorand.Reader, new(big.Int).SetInt64(math.MaxInt64-1))
if err != nil {
return nil, err
}
serial = new(big.Int).Add(serial, big.NewInt(1))
tmpl := x509.Certificate{
SerialNumber: new(big.Int).SetInt64(0),
SerialNumber: serial,
Subject: pkix.Name{
CommonName: cfg.CommonName,
Organization: cfg.Organization,
@@ -116,9 +123,14 @@ func GenerateSelfSignedCertKeyWithFixtures(host string, alternateIPs []net.IP, a
if err != nil {
return nil, nil, err
}

// returns a uniform random value in [0, max-1), then add 1 to serial to make it a uniform random value in [1, max).
serial, err := cryptorand.Int(cryptorand.Reader, new(big.Int).SetInt64(math.MaxInt64-1))
if err != nil {
return nil, nil, err
}
serial = new(big.Int).Add(serial, big.NewInt(1))
caTemplate := x509.Certificate{
SerialNumber: big.NewInt(1),
SerialNumber: serial,
Subject: pkix.Name{
CommonName: fmt.Sprintf("%s-ca@%d", host, time.Now().Unix()),
},
@@ -144,9 +156,14 @@ func GenerateSelfSignedCertKeyWithFixtures(host string, alternateIPs []net.IP, a
if err != nil {
return nil, nil, err
}

// returns a uniform random value in [0, max-1), then add 1 to serial to make it a uniform random value in [1, max).
serial, err = cryptorand.Int(cryptorand.Reader, new(big.Int).SetInt64(math.MaxInt64-1))
if err != nil {
return nil, nil, err
}
serial = new(big.Int).Add(serial, big.NewInt(1))
template := x509.Certificate{
SerialNumber: big.NewInt(2),
SerialNumber: serial,
Subject: pkix.Name{
CommonName: fmt.Sprintf("%s@%d", host, time.Now().Unix()),
},