Skip to content

Commit

Permalink
[HA Agent] Fix typo and use correct term (#31826)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreYang authored Dec 6, 2024
1 parent f7625c5 commit cf46180
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion comp/haagent/def/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Component interface {
GetState() State

// SetLeader takes the leader agent hostname as input, if it matches the current agent hostname,
// the isLeader state is set to true, otherwise false.
// the state is set to active, otherwise standby.
SetLeader(leaderAgentHostname string)

// ShouldRunIntegration returns true if the integration should be run
Expand Down
2 changes: 1 addition & 1 deletion comp/haagent/impl/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

// validHaIntegrations represent the list of integrations that will be considered as
// an "HA Integration", meaning it will only run on the leader Agent.
// an "HA Integration", meaning it will only run on the active Agent.
// At the moment, the list of HA Integrations is hardcoded here, but we might provide
// more dynamic way to configure which integration should be considered HA Integration.
var validHaIntegrations = map[string]bool{
Expand Down
6 changes: 3 additions & 3 deletions comp/haagent/impl/haagent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func Test_GetGroup(t *testing.T) {
assert.Equal(t, "my-group-01", haAgent.GetGroup())
}

func Test_IsLeader_SetLeader(t *testing.T) {
func Test_GetState(t *testing.T) {
agentConfigs := map[string]interface{}{
"hostname": "my-agent-hostname",
}
Expand Down Expand Up @@ -201,15 +201,15 @@ func Test_haAgentImpl_ShouldRunIntegration(t *testing.T) {
},
},
{
name: "ha agent enabled and agent is not leader",
name: "ha agent enabled and agent is not active",
// should skip HA-integrations
// should run "non HA integrations"
agentConfigs: map[string]interface{}{
"hostname": testAgentHostname,
"ha_agent.enabled": true,
"ha_agent.group": testGroup,
},
leader: "another-agent-is-leader",
leader: "another-agent-is-active",
expectShouldRunIntegration: map[string]bool{
"snmp": false,
"cisco_aci": false,
Expand Down

0 comments on commit cf46180

Please sign in to comment.