Skip to content

Commit d303ec4

Browse files
authored
tsh: remove noisy debug log (#50037)
Teleport TLS certificate valid until "2024-12-11 04:35:25 +0000 UTC" This log line is not super helpful and adds a lot of noise to tsh debug logs because it is repeated many times. We don't need it, because: - it doesn't tell you _what_ certificate is valid - encountering a valid certificate is expected behavior and not something that we expect to help when debugging an issue
1 parent 12f0d12 commit d303ec4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/client/client_store.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@ func (s *Store) GetKeyRing(idx KeyRingIndex, opts ...CertOption) (*KeyRing, erro
127127
return nil, trace.Wrap(err)
128128
}
129129

130-
tlsCertExpiration, err := keyRing.TeleportTLSCertValidBefore()
130+
// verify that the key ring has a TLS certificate
131+
_, err = keyRing.TeleportTLSCertValidBefore()
131132
if err != nil {
132133
return nil, trace.Wrap(err)
133134
}
134-
s.log.Debugf("Teleport TLS certificate valid until %q.", tlsCertExpiration)
135135

136136
// Validate the SSH certificate.
137137
if keyRing.Cert != nil {

tool/tsh/common/tsh_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5871,11 +5871,11 @@ func TestLogout(t *testing.T) {
58715871
err = Run(context.Background(), []string{"logout"}, setHomePath(tmpHomePath))
58725872
require.NoError(t, err, trace.DebugReport(err))
58735873

5874-
// direcory should be empty.
5874+
// directory should be empty.
58755875
f, err := os.Open(tmpHomePath)
58765876
require.NoError(t, err)
5877-
_, err = f.Readdir(1)
5878-
require.ErrorIs(t, err, io.EOF)
5877+
entries, err := f.ReadDir(1)
5878+
require.ErrorIs(t, err, io.EOF, "expected empty directory, but found %v", entries)
58795879
})
58805880
}
58815881
}

0 commit comments

Comments
 (0)