mirror of https://github.com/status-im/consul.git
ci: Add ineffsign linter
And fix an additional ineffective assignment that was not caught by staticcheck
This commit is contained in:
parent
cb050b280c
commit
d345cd8d30
|
@ -5,6 +5,7 @@ linters:
|
|||
- govet
|
||||
- unconvert
|
||||
- staticcheck
|
||||
- ineffassign
|
||||
|
||||
issues:
|
||||
# Disable the default exclude list so that all excludes are explicitly
|
||||
|
|
|
@ -706,8 +706,6 @@ func (a *Agent) setupClientAutoEncryptWatching(rootsReq *structs.DCSpecificReque
|
|||
// in time. The agent would be stuck in that case because the watches
|
||||
// never use the AutoEncrypt.Sign endpoint.
|
||||
go func() {
|
||||
for {
|
||||
|
||||
// Check 10sec after cert expires. The agent cache
|
||||
// should be handling the expiration and renew before
|
||||
// it.
|
||||
|
@ -716,8 +714,9 @@ func (a *Agent) setupClientAutoEncryptWatching(rootsReq *structs.DCSpecificReque
|
|||
// 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))
|
||||
autoLogger := a.logger.Named(logging.AutoEncrypt)
|
||||
for {
|
||||
a.logger.Debug("setting up client certificate expiration check on interval", "interval", interval)
|
||||
select {
|
||||
case <-a.shutdownCh:
|
||||
|
|
|
@ -4400,6 +4400,7 @@ func TestACLEndpoint_Login(t *testing.T) {
|
|||
structs.BindingRuleBindTypeNode,
|
||||
"${serviceaccount.name}",
|
||||
)
|
||||
require.NoError(t, err)
|
||||
|
||||
t.Run("do not provide a token", func(t *testing.T) {
|
||||
req := structs.ACLLoginRequest{
|
||||
|
|
|
@ -282,6 +282,9 @@ func decodeHCLToMapStructure(source string, target interface{}) error {
|
|||
Metadata: md,
|
||||
Result: target,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return decoder.Decode(&raw)
|
||||
}
|
||||
|
||||
|
@ -305,6 +308,7 @@ func TestHookWeakDecodeFromSlice_DoesNotModifySliceTargetsFromSliceInterface(t *
|
|||
})
|
||||
require.NoError(t, err)
|
||||
err = decoder.Decode(&raw)
|
||||
require.NoError(t, err)
|
||||
|
||||
expected := &nested{
|
||||
Slice: []Item{{Name: "first"}},
|
||||
|
|
Loading…
Reference in New Issue