Skip to content

Commit

Permalink
connect: fix shouldPersistNewRootAndConfig logic
Browse files Browse the repository at this point in the history
hashicorp#12298 introduced an improvement
to prevent raft commit for no-op operations, but while moving conditions
into a function, author inversed the logic while keep same boolean
operations. As a consequence, this prevents one to update provider config
of a secondary CA.
Correct code was suggested in a review comment anyway, so apply it:
hashicorp#12298 (review)
  • Loading branch information
dclaisse authored and Mathias Brulatout committed Apr 18, 2023
1 parent 2942128 commit 8e7763a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion agent/consul/leader_connect_ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ func shouldPersistNewRootAndConfig(newActiveRoot *structs.CARoot, oldConfig, new
if newConfig == nil {
return false
}
return newConfig.Provider == oldConfig.Provider && reflect.DeepEqual(newConfig.Config, oldConfig.Config)
return newConfig.Provider != oldConfig.Provider || !reflect.DeepEqual(newConfig.Config, oldConfig.Config)
}

func (c *CAManager) UpdateConfiguration(args *structs.CARequest) (reterr error) {
Expand Down

0 comments on commit 8e7763a

Please sign in to comment.