Skip to content

Commit 9605477

Browse files
fix(agent-control): rename Super Agent to Agent Control in the CLI (#1674)
1 parent 63ba336 commit 9605477

File tree

13 files changed

+109
-109
lines changed

13 files changed

+109
-109
lines changed

internal/install/bundle_installer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func (bi *BundleInstaller) InstallContinueOnError(bundle *recipes.Bundle, assume
102102

103103
func (bi *BundleInstaller) reportBundleStatus(bundle *recipes.Bundle) {
104104
for _, recipe := range bundle.BundleRecipes {
105-
if types.SuperAgentRecipeName == recipe.Recipe.Name && recipe.LastStatus(execution.RecipeStatusTypes.INSTALLED) {
105+
if types.AgentControlRecipeName == recipe.Recipe.Name && recipe.LastStatus(execution.RecipeStatusTypes.INSTALLED) {
106106
continue
107107
}
108108
if bi.installedRecipes[recipe.Recipe.Name] {
@@ -130,7 +130,7 @@ func (bi *BundleInstaller) InstallBundleRecipe(bundleRecipe *recipes.BundleRecip
130130
}
131131

132132
recipeName := bundleRecipe.Recipe.Name
133-
if strings.EqualFold(recipeName, types.SuperAgentRecipeName) && bundleRecipe.HasStatus(execution.RecipeStatusTypes.INSTALLED) {
133+
if strings.EqualFold(recipeName, types.AgentControlRecipeName) && bundleRecipe.HasStatus(execution.RecipeStatusTypes.INSTALLED) {
134134
return nil
135135
}
136136
if bi.installedRecipes[bundleRecipe.Recipe.Name] {

internal/install/bundle_installer_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,19 @@ func TestInstallContinueOnErrorReturnsImmediatelyWhenNoIsEntered(t *testing.T) {
5151
test.mockStatusReporter.AssertNumberOfCalls(t, "ReportStatus", 1)
5252
}
5353

54-
func TestInstallContinueOnErrorReturnsImmediatelyWhenSuperAgentIsInstalled(t *testing.T) {
54+
func TestInstallContinueOnErrorReturnsImmediatelyWhenAgentControlIsInstalled(t *testing.T) {
5555
test := createBundleInstallerTest().withPrompterYesNoVal(false).withRecipeInstallerError()
56-
test.addRecipeToBundle("super-agent", execution.RecipeStatusTypes.INSTALLED)
56+
test.addRecipeToBundle("agent-control", execution.RecipeStatusTypes.INSTALLED)
5757

5858
test.BundleInstaller.InstallContinueOnError(test.bundle, false)
5959

6060
test.mockRecipeInstaller.AssertNumberOfCalls(t, "executeAndValidateWithProgress", 0)
6161
test.mockStatusReporter.AssertNumberOfCalls(t, "ReportStatus", 0)
6262
}
6363

64-
func TestInstallContinueOnErrorWhenSuperAgentIsAvailable(t *testing.T) {
64+
func TestInstallContinueOnErrorWhenAgentControlIsAvailable(t *testing.T) {
6565
test := createBundleInstallerTest().withPrompterYesNoVal(false).withRecipeInstallerError()
66-
test.addRecipeToBundle("super-agent", execution.RecipeStatusTypes.AVAILABLE)
66+
test.addRecipeToBundle("agent-control", execution.RecipeStatusTypes.AVAILABLE)
6767

6868
test.BundleInstaller.InstallContinueOnError(test.bundle, false)
6969

@@ -82,7 +82,7 @@ func TestInstallContinueOnErrorIgnoresUxPromptIfBundleIsAdditionalTargeted(t *te
8282

8383
func TestInstallContinueOnErrorIgnoresUxPromptIfBundleIsAdditionalTargetedSuperIsInstalled(t *testing.T) {
8484
test := createBundleInstallerTest().withRecipeInstallerSuccess()
85-
test.addRecipeToBundle(types.SuperAgentRecipeName, execution.RecipeStatusTypes.INSTALLED)
85+
test.addRecipeToBundle(types.AgentControlRecipeName, execution.RecipeStatusTypes.INSTALLED)
8686
test.BundleInstaller.InstallContinueOnError(test.bundle, true)
8787

8888
test.mockRecipeInstaller.AssertNumberOfCalls(t, "executeAndValidateWithProgress", 0)

internal/install/command.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ var Command = &cobra.Command{
5656

5757
i := NewRecipeInstaller(ic)
5858

59-
//// Do not install both infra and super agents simultaneously: install only the 'super-agent' if targeted.
60-
//if i.IsRecipeTargeted(types.SuperAgentRecipeName) && i.shouldInstallCore() {
61-
// log.Debugf("'%s' is targeted, disabling infra/logs core bundle install\n", types.SuperAgentRecipeName)
59+
//// Do not install both infra and agent controls simultaneously: install only the 'agent-control' if targeted.
60+
//if i.IsRecipeTargeted(types.AgentControlRecipeName) && i.shouldInstallCore() {
61+
// log.Debugf("'%s' is targeted, disabling infra/logs core bundle install\n", types.AgentControlRecipeName)
6262
// i.shouldInstallCore = func() bool { return false }
6363
//}
6464

@@ -76,7 +76,7 @@ var Command = &cobra.Command{
7676
return e
7777
}
7878

79-
if errors.Is(err, types.ErrSuperAgent) {
79+
if errors.Is(err, types.ErrAgentControl) {
8080
return err
8181
}
8282

internal/install/execution/terminal_reporter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ func (r TerminalStatusReporter) printFleetLink(status *InstallStatus) {
151151
statuses := r.getRecipesStatusesForInstallationSummary(status)
152152

153153
for _, s := range statuses {
154-
isSuperAgentRecipe := s.Name == types.SuperAgentRecipeName || s.Name == types.LoggingSuperAgentRecipeName
154+
isAgentControlRecipe := s.Name == types.AgentControlRecipeName || s.Name == types.LoggingAgentControlRecipeName
155155

156-
if s.Status == RecipeStatusTypes.INSTALLED && isSuperAgentRecipe {
156+
if s.Status == RecipeStatusTypes.INSTALLED && isAgentControlRecipe {
157157
linkToFleetRaw := "https://one.newrelic.com/nr1-core?filters=(domain = 'NR1' AND type = 'FLEET')"
158158

159159
linkToFleet := url.PathEscape(linkToFleetRaw)

internal/install/execution/terminal_reporter_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,14 @@ func Test_ShouldGenerateLoggingLink(t *testing.T) {
9999
Name: types.LoggingRecipeName,
100100
Status: RecipeStatusTypes.INSTALLED,
101101
}
102-
loggingSuperAgentRecipeStatus := &RecipeStatus{
102+
loggingAgentControlRecipeStatus := &RecipeStatus{
103103
DisplayName: "Logs integration",
104-
Name: types.LoggingSuperAgentRecipeName,
104+
Name: types.LoggingAgentControlRecipeName,
105105
Status: RecipeStatusTypes.INSTALLED,
106106
}
107107

108108
status.Statuses = append(status.Statuses, loggingRecipeStatus)
109-
status.Statuses = append(status.Statuses, loggingSuperAgentRecipeStatus)
109+
status.Statuses = append(status.Statuses, loggingAgentControlRecipeStatus)
110110

111111
err := r.InstallComplete(status)
112112
require.NoError(t, err)

internal/install/recipe_installer.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,9 @@ func (i *RecipeInstall) install(ctx context.Context) error {
316316
return err
317317
}
318318

319-
if _, ok := availableRecipes.GetRecipeDetection(types.SuperAgentRecipeName); i.hostHasSuperAgentProcess() && !ok {
319+
if _, ok := availableRecipes.GetRecipeDetection(types.AgentControlRecipeName); i.hostHasAgentControlProcess() && !ok {
320320
availableRecipes = append(availableRecipes, &recipes.RecipeDetectionResult{
321-
Recipe: &types.OpenInstallationRecipe{Name: types.SuperAgentRecipeName},
321+
Recipe: &types.OpenInstallationRecipe{Name: types.AgentControlRecipeName},
322322
Status: execution.RecipeStatusTypes.AVAILABLE,
323323
DurationMs: 0,
324324
})
@@ -392,13 +392,13 @@ func (i *RecipeInstall) reportRecipeRecommendations(availableRecipes recipes.Rec
392392
}
393393
}
394394

395-
// Skip reporting for the infra agent if super agent has been targeted.
395+
// Skip reporting for the infra agent if agent control has been targeted.
396396
// The logs-integration also reports a status for the infra agent
397397
// and should be skipped as well.
398398
func (i *RecipeInstall) shouldSkipReporting(name string) bool {
399399
if name == "infrastructure-agent-installer" || name == "logs-integration" {
400400
for _, v := range i.RecipeNames {
401-
if v == "super-agent" || v == "logs-integration-super-agent" {
401+
if v == "agent-control" || v == "logs-integration-agent-control" {
402402
return true
403403
}
404404
}
@@ -441,11 +441,11 @@ func (i *RecipeInstall) isTargetInstallRecipe(recipeName string) bool {
441441

442442
func (i *RecipeInstall) checkSuper(bundler RecipeBundler) *recipes.Bundler {
443443
bun, ok := bundler.(*recipes.Bundler)
444-
if i.hostHasSuperAgentProcess() && ok {
444+
if i.hostHasAgentControlProcess() && ok {
445445
bun.HasSuperInstalled = true
446-
log.Debugf("Super agent process found.")
446+
log.Debugf("Agent Control process found.")
447447
} else {
448-
log.Debugf("Super agent process not found.")
448+
log.Debugf("Agent Control process not found.")
449449
}
450450
log.Debugf("Preparing bundle")
451451
return bun
@@ -463,9 +463,9 @@ func bundleRecipeProcessing(bundle *recipes.Bundle, bun *recipes.Bundler) {
463463
}
464464

465465
// installAdditionalBundle installs additional bundles for the given recipes.
466-
// It checks if the host has a super agent process running, and proceeds with the additional bundle.
466+
// It checks if the host has a agent control process running, and proceeds with the additional bundle.
467467
// If the list of recipes is provided, it creates a targeted bundle; otherwise, it creates a guided bundle.
468-
// If the host has super agent installed infra agent and logs agent would be NULL
468+
// If the host has agent control installed infra agent and logs agent would be NULL
469469
// It then installs the additional bundle and reports any unsupported recipes.
470470
func (i *RecipeInstall) installAdditionalBundle(bundler RecipeBundler, bundleInstaller RecipeBundleInstaller, repo *recipes.RecipeRepository) error {
471471
var additionalBundle *recipes.Bundle
@@ -491,7 +491,7 @@ func (i *RecipeInstall) installAdditionalBundle(bundler RecipeBundler, bundleIns
491491
if bundleInstaller.InstalledRecipesCount() == 0 {
492492
for _, recipe := range i.RecipeNames {
493493
if bun.HasSuperInstalled && bun.IsCore(recipe) {
494-
return types.NewDetailError(types.EventTypes.OtherError, types.ErrSuperAgent.Error())
494+
return types.NewDetailError(types.EventTypes.OtherError, types.ErrAgentControl.Error())
495495
}
496496
}
497497

@@ -853,6 +853,6 @@ func (i *RecipeInstall) finishHandlingFailure(recipeName string) {
853853
}
854854
}
855855

856-
func (i *RecipeInstall) hostHasSuperAgentProcess() bool {
857-
return i.processEvaluator.FindProcess(types.SuperAgentProcessName)
856+
func (i *RecipeInstall) hostHasAgentControlProcess() bool {
857+
return i.processEvaluator.FindProcess(types.AgentControlProcessName)
858858
}

0 commit comments

Comments
 (0)