Skip to content

Commit

Permalink
Add to debug CI
Browse files Browse the repository at this point in the history
Signed-off-by: Marcos Yacob <[email protected]>
  • Loading branch information
MarcosDY committed Oct 29, 2024
1 parent 89e02d7 commit 70a97b1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/server/ca/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,8 @@ func (m *Manager) notifyTaintedAuthorities(ctx context.Context, taintedAuthoriti
}

func (m *Manager) processTaintedUpstreamAuthorities(ctx context.Context, taintedAuthorities []*x509.Certificate) error {
fmt.Println("Processing tainted keys on upstream authority")

// Nothing to rotate if no upstream authority is used
if m.upstreamClient == nil {
return errors.New("processing of tainted upstream authorities must not be reached when not using an upstream authority; please report this bug")
Expand Down
2 changes: 2 additions & 0 deletions pkg/server/ca/manager/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,10 @@ func TestUpstreamProcessTaintedAuthority(t *testing.T) {
go test.m.ProcessBundleUpdates(ctx)

// Taint first root
fmt.Println("Tainting authority")
err = fakeUA.TaintAuthority(0)
require.NoError(t, err)
fmt.Println("AFTER Tainting authority")

// Get the roots again and verify that the first X.509 authority is tainted
x509Roots := fakeUA.X509Roots()
Expand Down
3 changes: 3 additions & 0 deletions pkg/server/ca/upstream_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"crypto/x509"
"errors"
"fmt"
"io"
"sync"
"time"
Expand Down Expand Up @@ -155,6 +156,7 @@ func (u *UpstreamClient) runMintX509CAStream(ctx context.Context, csr []byte, tt
return
}

fmt.Println("Syncing X.509 roots")
if err := u.c.BundleUpdater.SyncX509Roots(ctx, x509Roots); err != nil {
firstResultCh <- mintX509CAResult{err: err}
return
Expand All @@ -163,6 +165,7 @@ func (u *UpstreamClient) runMintX509CAStream(ctx context.Context, csr []byte, tt
firstResultCh <- mintX509CAResult{x509CA: x509CA}

for {
fmt.Println("Waiting for x509RootsStream.RecvUpstreamX509Authorities")
x509Roots, err := x509RootsStream.RecvUpstreamX509Authorities()
if err != nil {
switch {
Expand Down

0 comments on commit 70a97b1

Please sign in to comment.