Skip to content

Commit

Permalink
style: remove unused variables for func GetKubernetesLabels (#3666)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlisonB319 authored Oct 4, 2023
1 parent cd50179 commit b9e0660
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pkg/agent/baker.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,10 @@ func getContainerServiceFuncMap(config *datamodel.NodeBootstrappingConfiguration
return cs.Properties.OrchestratorProfile.IsKubernetes() && IsKubernetesVersionGe(cs.Properties.OrchestratorProfile.OrchestratorVersion, version)
},
"GetAgentKubernetesLabels": func(profile *datamodel.AgentPoolProfile) string {
return profile.GetKubernetesLabels(false, config.EnableNvidia, config.FIPSEnabled, config.OSSKU)
return profile.GetKubernetesLabels()
},
"GetAgentKubernetesLabelsDeprecated": func(profile *datamodel.AgentPoolProfile) string {
return profile.GetKubernetesLabels(true, config.EnableNvidia, config.FIPSEnabled, config.OSSKU)
return profile.GetKubernetesLabels()
},
"GetGPUInstanceProfile": func() string {
return config.GPUInstanceProfile
Expand Down
2 changes: 1 addition & 1 deletion pkg/agent/datamodel/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,7 @@ func (a *AgentPoolProfile) IsAvailabilitySets() bool {
}

// GetKubernetesLabels returns a k8s API-compliant labels string for nodes in this profile.
func (a *AgentPoolProfile) GetKubernetesLabels(deprecated bool, nvidiaEnabled bool, fipsEnabled bool, osSku string) string {
func (a *AgentPoolProfile) GetKubernetesLabels() string {
var buf bytes.Buffer
buf.WriteString(fmt.Sprintf("agentpool=%s", a.Name))
buf.WriteString(fmt.Sprintf(",kubernetes.azure.com/agentpool=%s", a.Name))
Expand Down
4 changes: 2 additions & 2 deletions pkg/agent/datamodel/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1115,9 +1115,9 @@ func TestAgentPoolProfileGetKubernetesLabels(t *testing.T) {
c := c
t.Run(c.name, func(t *testing.T) {
t.Parallel()
if c.expected != c.ap.GetKubernetesLabels(c.deprecated, c.nvidiaEnabled, c.fipsEnabled, c.osSku) {
if c.expected != c.ap.GetKubernetesLabels() {
t.Fatalf("Got unexpected AgentPoolProfile.GetKubernetesLabels(%s, %t) result. Expected: %s. Got: %s.",
c.rg, c.deprecated, c.expected, c.ap.GetKubernetesLabels(c.deprecated, c.nvidiaEnabled, c.fipsEnabled, c.osSku))
c.rg, c.deprecated, c.expected, c.ap.GetKubernetesLabels())
}
})
}
Expand Down

0 comments on commit b9e0660

Please sign in to comment.