From 561d2821cbf1673f117eabf1f200d9ac90117db9 Mon Sep 17 00:00:00 2001 From: Ruben Ruiz de Gauna Date: Tue, 17 Dec 2024 11:48:55 +0100 Subject: [PATCH] fix(agent-control): rename Super Agent to Agent Control --- attributes/default.rb | 4 +-- resources/newrelic_install.rb | 4 +-- spec/unit/resources/newrelic_install_spec.rb | 32 ++++++++++---------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/attributes/default.rb b/attributes/default.rb index 6eaccf6..723569d 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -24,8 +24,8 @@ # logs-integration # php-agent-installer # dotnet-agent-installer -# super-agent -# logs-integration-super-agent +# agent-control +# logs-integration-agent-control default['newrelic_install']['targets'] = [] ######## diff --git a/resources/newrelic_install.rb b/resources/newrelic_install.rb index 5c09a34..87bd248 100644 --- a/resources/newrelic_install.rb +++ b/resources/newrelic_install.rb @@ -70,8 +70,8 @@ def check_targets logs-integration php-agent-installer dotnet-agent-installer - super-agent - logs-integration-super-agent + agent-control + logs-integration-agent-control )) allowed_targets_string = allowed_targets.join(', ') incoming_targets = new_resource.targets.to_set diff --git a/spec/unit/resources/newrelic_install_spec.rb b/spec/unit/resources/newrelic_install_spec.rb index 0b5872d..7f58a82 100644 --- a/spec/unit/resources/newrelic_install_spec.rb +++ b/spec/unit/resources/newrelic_install_spec.rb @@ -231,37 +231,37 @@ end end - context 'when targets only contains super agent' do + context 'when targets only contains agent control' do default_attributes['newrelic_install']['NEW_RELIC_API_KEY'] = 'xxx' default_attributes['newrelic_install']['NEW_RELIC_ACCOUNT_ID'] = 'xxx' default_attributes['newrelic_install']['NEW_RELIC_REGION'] = 'xxx' - default_attributes['newrelic_install']['targets'] = ['super-agent'] + default_attributes['newrelic_install']['targets'] = ['agent-control'] it 'should execute with target infra and skip core' do expect(subject).to run_execute('newrelic install').with(env: have_key('NEW_RELIC_CLI_SKIP_CORE')) end - it 'run bash newrelic install command with super-agent' do - expect(subject).to run_execute('newrelic install').with(command: include('super-agent')) + it 'run bash newrelic install command with agent-control' do + expect(subject).to run_execute('newrelic install').with(command: include('agent-control')) end - it 'run powershell newrelic install command without super-agent' do - expect(subject).not_to run_powershell_script('newrelic install').with(code: include('super-agent')) + it 'run powershell newrelic install command without agent-control' do + expect(subject).not_to run_powershell_script('newrelic install').with(code: include('agent-control')) end end - context 'when targets contains super agent infra agent and logs' do + context 'when targets contains agent control infra agent and logs' do default_attributes['newrelic_install']['NEW_RELIC_API_KEY'] = 'xxx' default_attributes['newrelic_install']['NEW_RELIC_ACCOUNT_ID'] = 'xxx' default_attributes['newrelic_install']['NEW_RELIC_REGION'] = 'xxx' - default_attributes['newrelic_install']['targets'] = %w(super-agent infrastructure-agent-installer logs-integration) + default_attributes['newrelic_install']['targets'] = %w(agent-control infrastructure-agent-installer logs-integration) it 'should execute with target infra and skip core' do expect(subject).to run_execute('newrelic install').with(env: have_key('NEW_RELIC_CLI_SKIP_CORE')) end - it 'run bash newrelic install command with super-agent' do - expect(subject).to run_execute('newrelic install').with(command: include('super-agent')) + it 'run bash newrelic install command with agent-control' do + expect(subject).to run_execute('newrelic install').with(command: include('agent-control')) end it 'run bash newrelic install command with infra' do @@ -272,22 +272,22 @@ expect(subject).to run_execute('newrelic install').with(command: include('logs-integration')) end end - context 'when targets only contains super agent logs' do + context 'when targets only contains agent control logs' do default_attributes['newrelic_install']['NEW_RELIC_API_KEY'] = 'xxx' default_attributes['newrelic_install']['NEW_RELIC_ACCOUNT_ID'] = 'xxx' default_attributes['newrelic_install']['NEW_RELIC_REGION'] = 'xxx' - default_attributes['newrelic_install']['targets'] = ['logs-integration-super-agent'] + default_attributes['newrelic_install']['targets'] = ['logs-integration-agent-control'] it 'should execute with target infra and skip core' do expect(subject).to run_execute('newrelic install').with(env: have_key('NEW_RELIC_CLI_SKIP_CORE')) end - it 'run bash newrelic install command with logs-integration-super-agent' do - expect(subject).to run_execute('newrelic install').with(command: include('logs-integration-super-agent')) + it 'run bash newrelic install command with logs-integration-agent-control' do + expect(subject).to run_execute('newrelic install').with(command: include('logs-integration-agent-control')) end - it 'run powershell newrelic install command without logs-integration-super-agent' do - expect(subject).not_to run_powershell_script('newrelic install').with(code: include('logs-integration-super-agent')) + it 'run powershell newrelic install command without logs-integration-agent-control' do + expect(subject).not_to run_powershell_script('newrelic install').with(code: include('logs-integration-agent-control')) end end end