Skip to content

Commit

Permalink
Merge branch 'master' into nodeattestor
Browse files Browse the repository at this point in the history
  • Loading branch information
azdagron committed Oct 19, 2018
2 parents b133029 + 4a07ef4 commit 73f4a67
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
15 changes: 9 additions & 6 deletions cmd/spire-server/cli/token/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,15 @@ func (g GenerateCLI) Run(args []string) int {
}
fmt.Printf("Token: %s\n", token)

if config.SpiffeID != "" {
err = g.createVanityRecord(ctx, c, token, config.SpiffeID)
if err != nil {
fmt.Printf("Error assigning SPIFFE ID: %s\n", err.Error())
return 1
}
if config.SpiffeID == "" {
fmt.Printf("Warning: Missing SPIFFE ID.\n")
return 0
}

err = g.createVanityRecord(ctx, c, token, config.SpiffeID)
if err != nil {
fmt.Printf("Error assigning SPIFFE ID: %s\n", err.Error())
return 1
}

return 0
Expand Down
4 changes: 2 additions & 2 deletions pkg/agent/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (c *client) FetchUpdates(ctx context.Context, req *node.FetchX509SVIDReques
// We weren't able to get a stream...close the client and return the error.
if err != nil {
c.Release()
c.c.Log.Errorf("%v: %v", ErrUnableToGetStream, err)
c.c.Log.Errorf("Failure fetching X509 SVID. %v: %v", ErrUnableToGetStream, err)
return nil, ErrUnableToGetStream
}

Expand Down Expand Up @@ -167,7 +167,7 @@ func (c *client) FetchJWTSVID(ctx context.Context, jsr *node.JSR) (*JWTSVID, err
// We weren't able to make the request...close the client and return the error.
if err != nil {
c.Release()
c.c.Log.Errorf("%v: %v", ErrUnableToGetStream, err)
c.c.Log.Errorf("Failure fetching JWT SVID. %v: %v", ErrUnableToGetStream, err)
return nil, ErrUnableToGetStream
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/server/ca/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (m *manager) Run(ctx context.Context) error {
if err == context.Canceled {
err = nil
}
return nil
return err
}

func (m *manager) CA() ServerCA {
Expand Down Expand Up @@ -413,7 +413,7 @@ func (m *manager) writeKeypairSets() {
certificates[m.next.JWTSignerKeyId()] = m.next.jwtSigner
}
if err := writeCertificates(m.c.CertsPath, certificates); err != nil {
m.c.Log.Warnf("unable to write keypair sets: %v", err)
m.c.Log.Errorf("unable to write keypair sets: %v", err)
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/server/endpoints/node/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func (h *Handler) doAttestChallengeResponse(ctx context.Context,
response, err := h.attest(ctx, attestStream, request, attestedBefore)
if err != nil {
h.c.Log.Error(err)
return nil, errors.New("Error trying to attest")
return nil, fmt.Errorf("Error trying to attest: %v", err)
}
if response.Challenge == nil {
return response, nil
Expand Down

0 comments on commit 73f4a67

Please sign in to comment.