diff --git a/lib/chef-cli/dist.rb b/lib/chef-cli/dist.rb index e253463f..f643ce31 100644 --- a/lib/chef-cli/dist.rb +++ b/lib/chef-cli/dist.rb @@ -6,14 +6,14 @@ class Dist PRODUCT = "Chef Workstation".freeze PRODUCT_PKG_HOME = "chef-workstation".freeze - CHEF_DK_CLI_PACKAGE = "Chef Development Kit Enterprise".freeze + CHEF_DK_CLI_PACKAGE = "Chef Workstation".freeze CHEF_CLI_PACKAGE = "Chef-Cli".freeze # the name of the chef-cli gem CLI_PRODUCT = "Chef CLI".freeze CLI_GEM = "chef-cli".freeze - CHEF_DKE_PKG_NAME = "chef/chef-development-kit-enterprise".freeze + CHEF_DKE_PKG_NAME = "chef/chef-workstation".freeze HAB_PKG_NAME = "chef/chef-cli".freeze # the name of the overall infra product diff --git a/lib/chef-cli/helpers.rb b/lib/chef-cli/helpers.rb index d6786e7b..c3133c67 100644 --- a/lib/chef-cli/helpers.rb +++ b/lib/chef-cli/helpers.rb @@ -60,13 +60,13 @@ def omnibus_install? File.exist?(expected_omnibus_root) && File.exist?(File.join(expected_omnibus_root, "version-manifest.json")) end - # The habitat version of the chef-cli can be installed with standalone or chef-development-kit-enterprise + # The habitat version of the chef-cli can be installed with standalone or chef-workstation # This method checks if the habitat version of chef-cli is installed as standalone def habitat_standalone? @hab_standalone ||= (hab_pkg_installed?(ChefCLI::Dist::HAB_PKG_NAME) && !habitat_chef_dke?) end - # This method checks if the habitat version of chef-cli is installed with chef-development-kit-enterprise + # This method checks if the habitat version of chef-cli is installed with chef-workstation def habitat_chef_dke? @hab_dke ||= hab_pkg_installed?(ChefCLI::Dist::CHEF_DKE_PKG_NAME) end diff --git a/spec/unit/command/env_spec.rb b/spec/unit/command/env_spec.rb index 41e0d201..66ff1c34 100644 --- a/spec/unit/command/env_spec.rb +++ b/spec/unit/command/env_spec.rb @@ -18,7 +18,6 @@ require "spec_helper" autoload :YAML, "yaml" require "chef-cli/command/env" - describe ChefCLI::Command::Env do let(:ui) { TestHelpers::TestUI.new } let(:command_instance) { ChefCLI::Command::Env.new } @@ -145,8 +144,8 @@ end end - describe "when running chef-cli coming with Chef-DKE Habitat package" do - let(:hab_pkg_base) { "/hab/pkgs/chef/chef-development-kit-enterprise" } + describe "when running chef-cli coming with chef-workstation Habitat package" do + let(:hab_pkg_base) { "/hab/pkgs/chef/chef-workstation" } let(:hab_pkg_version) { "1.0.0" } let(:hab_pkg_build) { "20240210120000" } let(:hab_pkg_path) { "#{hab_pkg_base}/#{hab_pkg_version}/#{hab_pkg_build}" } @@ -184,7 +183,7 @@ run_command end - it "should include correct product name for Chef-DKE Habitat package" do + it "should include correct product name for chef-workstation Habitat package" do expect(yaml).to have_key(ChefCLI::Dist::CHEF_DK_CLI_PACKAGE) end diff --git a/spec/unit/command/shell_init_spec.rb b/spec/unit/command/shell_init_spec.rb index f82f9602..65e828c7 100644 --- a/spec/unit/command/shell_init_spec.rb +++ b/spec/unit/command/shell_init_spec.rb @@ -364,9 +364,9 @@ end end - context "with chef-development-kit-enterprise habitat pkg shell-init on bash" do + context "with chef-workstation habitat pkg shell-init on bash" do - let(:chef_dke_path) { "/hab/pkgs/chef/chef-development-kit-enterprise/1.0.0/123" } + let(:chef_dke_path) { "/hab/pkgs/chef/chef-workstation/1.0.0/123" } let(:cli_hab_path) { "/hab/pkgs/chef/chef-cli/1.0.0/123" } let(:argv) { ["bash"] } @@ -377,7 +377,7 @@ end it "should return the correct paths" do - expect(command_instance).to receive(:get_pkg_prefix).with("chef/chef-development-kit-enterprise").and_return(chef_dke_path) + expect(command_instance).to receive(:get_pkg_prefix).with("chef/chef-workstation").and_return(chef_dke_path) expect(command_instance).to receive(:get_pkg_prefix).with("chef/chef-cli").and_return(cli_hab_path) command_instance.run(argv) @@ -414,7 +414,7 @@ before do # Stub this or else we'd have to update the test every time a new command # is added. - allow(command_instance).to receive(:get_pkg_prefix).with("chef/chef-development-kit-enterprise").and_return(chef_dke_path) + allow(command_instance).to receive(:get_pkg_prefix).with("chef/chef-workstation").and_return(chef_dke_path) allow(command_instance).to receive(:get_pkg_prefix).with("chef/chef-cli").and_return(cli_hab_path) allow(command_instance.shell_completion_template_context).to receive(:commands) .and_return(command_descriptions) diff --git a/spec/unit/helpers_spec.rb b/spec/unit/helpers_spec.rb index e9976be0..20730676 100644 --- a/spec/unit/helpers_spec.rb +++ b/spec/unit/helpers_spec.rb @@ -110,7 +110,7 @@ end context "when installed with habitat" do - let(:chef_dke_path) { "/hab/pkgs/chef/chef-development-kit-enterprise/1.0.0/123" } + let(:chef_dke_path) { "/hab/pkgs/chef/chef-workstation/1.0.0/123" } let(:cli_hab_path) { "/hab/pkgs/chef/chef-cli/1.0.0/123" } let(:expected_gem_root) { Gem.default_dir } let(:expected_path) { [File.join(chef_dke_path, "bin"), File.join(cli_hab_path, "vendor", "bin"), "/usr/bin:/bin"].flatten } @@ -133,7 +133,7 @@ it "should return the habitat env" do allow(ChefCLI::Helpers).to receive(:fetch_chef_cli_version_pkg).and_return(nil) # Ensure no version override - expect(ChefCLI::Helpers).to receive(:get_pkg_prefix).with("chef/chef-development-kit-enterprise").and_return(chef_dke_path) + expect(ChefCLI::Helpers).to receive(:get_pkg_prefix).with("chef/chef-workstation").and_return(chef_dke_path) expect(ChefCLI::Helpers).to receive(:get_pkg_prefix).with("chef/chef-cli").and_return(cli_hab_path) expect(ChefCLI::Helpers.habitat_env).to eq(expected_env)