ci: Add ineffsign linter
And fix an additional ineffective assignment that was not caught by staticcheck
This commit is contained in:
parent
5f24171f13
commit
8753d1f1ba
|
@ -5,6 +5,7 @@ linters:
|
||||||
- govet
|
- govet
|
||||||
- unconvert
|
- unconvert
|
||||||
- staticcheck
|
- staticcheck
|
||||||
|
- ineffassign
|
||||||
|
|
||||||
issues:
|
issues:
|
||||||
# Disable the default exclude list so that all excludes are explicitly
|
# Disable the default exclude list so that all excludes are explicitly
|
||||||
|
|
|
@ -706,18 +706,17 @@ func (a *Agent) setupClientAutoEncryptWatching(rootsReq *structs.DCSpecificReque
|
||||||
// in time. The agent would be stuck in that case because the watches
|
// in time. The agent would be stuck in that case because the watches
|
||||||
// never use the AutoEncrypt.Sign endpoint.
|
// never use the AutoEncrypt.Sign endpoint.
|
||||||
go func() {
|
go func() {
|
||||||
|
// Check 10sec after cert expires. The agent cache
|
||||||
|
// should be handling the expiration and renew before
|
||||||
|
// it.
|
||||||
|
// If there is no cert, AutoEncryptCertNotAfter returns
|
||||||
|
// a value in the past which immediately triggers the
|
||||||
|
// renew, but this case shouldn't happen because at
|
||||||
|
// this point, auto_encrypt was just being setup
|
||||||
|
// successfully.
|
||||||
|
interval := a.tlsConfigurator.AutoEncryptCertNotAfter().Sub(time.Now().Add(10 * time.Second))
|
||||||
|
autoLogger := a.logger.Named(logging.AutoEncrypt)
|
||||||
for {
|
for {
|
||||||
|
|
||||||
// Check 10sec after cert expires. The agent cache
|
|
||||||
// should be handling the expiration and renew before
|
|
||||||
// it.
|
|
||||||
// If there is no cert, AutoEncryptCertNotAfter returns
|
|
||||||
// a value in the past which immediately triggers the
|
|
||||||
// renew, but this case shouldn't happen because at
|
|
||||||
// this point, auto_encrypt was just being setup
|
|
||||||
// successfully.
|
|
||||||
autoLogger := a.logger.Named(logging.AutoEncrypt)
|
|
||||||
interval := a.tlsConfigurator.AutoEncryptCertNotAfter().Sub(time.Now().Add(10 * time.Second))
|
|
||||||
a.logger.Debug("setting up client certificate expiration check on interval", "interval", interval)
|
a.logger.Debug("setting up client certificate expiration check on interval", "interval", interval)
|
||||||
select {
|
select {
|
||||||
case <-a.shutdownCh:
|
case <-a.shutdownCh:
|
||||||
|
|
|
@ -4400,6 +4400,7 @@ func TestACLEndpoint_Login(t *testing.T) {
|
||||||
structs.BindingRuleBindTypeNode,
|
structs.BindingRuleBindTypeNode,
|
||||||
"${serviceaccount.name}",
|
"${serviceaccount.name}",
|
||||||
)
|
)
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
t.Run("do not provide a token", func(t *testing.T) {
|
t.Run("do not provide a token", func(t *testing.T) {
|
||||||
req := structs.ACLLoginRequest{
|
req := structs.ACLLoginRequest{
|
||||||
|
|
|
@ -282,6 +282,9 @@ func decodeHCLToMapStructure(source string, target interface{}) error {
|
||||||
Metadata: md,
|
Metadata: md,
|
||||||
Result: target,
|
Result: target,
|
||||||
})
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
return decoder.Decode(&raw)
|
return decoder.Decode(&raw)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -305,6 +308,7 @@ func TestHookWeakDecodeFromSlice_DoesNotModifySliceTargetsFromSliceInterface(t *
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
err = decoder.Decode(&raw)
|
err = decoder.Decode(&raw)
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
expected := &nested{
|
expected := &nested{
|
||||||
Slice: []Item{{Name: "first"}},
|
Slice: []Item{{Name: "first"}},
|
||||||
|
|
Loading…
Reference in New Issue