Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update CI to test against go1.19 #3108

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

ARG GO_VERSION=1.18.9
ARG GO_VERSION=1.19.11
ARG PROTOC_VERSION=3.11.4
ARG GOLANGCI_LINT_VERSION=v1.50.1
ARG DEBIAN_FRONTEND=noninteractive
Expand Down
105 changes: 70 additions & 35 deletions api/types.pb.go

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

23 changes: 23 additions & 0 deletions ca/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"context"
"crypto/tls"
"crypto/x509"
"encoding/pem"
"net"
"os"
"path/filepath"
Expand Down Expand Up @@ -618,6 +619,24 @@ func TestSecurityConfigWatch(t *testing.T) {
require.NoError(t, ca.RenewTLSConfigNow(tc.Context, secConfig, tc.ConnBroker, tc.Paths.RootCA))
}

func printCert(t *testing.T, pemData []byte) {
t.Helper()

block, _ := pem.Decode(pemData)
cert, err := x509.ParseCertificate(block.Bytes)
if err != nil {
t.Error(err)
}

cert.RawSubject = nil
cert.Raw = nil
cert.RawIssuer = nil
cert.RawSubjectPublicKeyInfo = nil
cert.RawTBSCertificate = nil
cert.Signature = nil
t.Logf("%+v", cert)
}

// If we get an unknown authority error when trying to renew the TLS certificate, attempt to download the
// root certificate. If it validates against the current TLS credentials, it will be used to download
// new ones, (only if the new certificate indicates that it's a worker, though).
Expand All @@ -633,6 +652,8 @@ func TestRenewTLSConfigUpdatesRootOnUnknownAuthError(t *testing.T) {
for i := 0; i < 3; i++ {
certs[i], keys[i], err = cautils.CreateRootCertAndKey("CA" + strconv.Itoa(i))
require.NoError(t, err)
t.Log("CA"+strconv.Itoa(i), ":\n", string(certs[i]))
printCert(t, certs[i])
switch i {
case 0:
crossSigneds[i] = nil
Expand All @@ -641,6 +662,8 @@ func TestRenewTLSConfigUpdatesRootOnUnknownAuthError(t *testing.T) {
default:
crossSigneds[i], err = cas[i-1].CrossSignCACertificate(certs[i])
require.NoError(t, err)
t.Log("Intermediate"+strconv.Itoa(i), ":\n", string(crossSigneds[i]))
printCert(t, crossSigneds[i])
cas[i], err = ca.NewRootCA(certs[i-1], certs[i], keys[i], ca.DefaultNodeCertExpiration, crossSigneds[i])
require.NoError(t, err)
}
Expand Down
2 changes: 2 additions & 0 deletions protobuf/plugin/deepcopy/test/deepcopy.pb.go

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