Skip to content

Commit 7455c5b

Browse files
authored
Chef -dke renaming changes (#268)
* Chef -dke changes Signed-off-by: nitin sanghi <[email protected]> * empty commit to re trigger build * Commit for fix dco Signed-off-by: nitin sanghi <[email protected]> --------- Signed-off-by: nitin sanghi <[email protected]>
1 parent a52ed3f commit 7455c5b

File tree

5 files changed

+13
-14
lines changed

5 files changed

+13
-14
lines changed

lib/chef-cli/dist.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ class Dist
66
PRODUCT = "Chef Workstation".freeze
77
PRODUCT_PKG_HOME = "chef-workstation".freeze
88

9-
CHEF_DK_CLI_PACKAGE = "Chef Development Kit Enterprise".freeze
9+
CHEF_DK_CLI_PACKAGE = "Chef Workstation".freeze
1010
CHEF_CLI_PACKAGE = "Chef-Cli".freeze
1111

1212
# the name of the chef-cli gem
1313
CLI_PRODUCT = "Chef CLI".freeze
1414
CLI_GEM = "chef-cli".freeze
1515

16-
CHEF_DKE_PKG_NAME = "chef/chef-development-kit-enterprise".freeze
16+
CHEF_DKE_PKG_NAME = "chef/chef-workstation".freeze
1717
HAB_PKG_NAME = "chef/chef-cli".freeze
1818

1919
# the name of the overall infra product

lib/chef-cli/helpers.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ def omnibus_install?
6060
File.exist?(expected_omnibus_root) && File.exist?(File.join(expected_omnibus_root, "version-manifest.json"))
6161
end
6262

63-
# The habitat version of the chef-cli can be installed with standalone or chef-development-kit-enterprise
63+
# The habitat version of the chef-cli can be installed with standalone or chef-workstation
6464
# This method checks if the habitat version of chef-cli is installed as standalone
6565
def habitat_standalone?
6666
@hab_standalone ||= (hab_pkg_installed?(ChefCLI::Dist::HAB_PKG_NAME) && !habitat_chef_dke?)
6767
end
6868

69-
# This method checks if the habitat version of chef-cli is installed with chef-development-kit-enterprise
69+
# This method checks if the habitat version of chef-cli is installed with chef-workstation
7070
def habitat_chef_dke?
7171
@hab_dke ||= hab_pkg_installed?(ChefCLI::Dist::CHEF_DKE_PKG_NAME)
7272
end

spec/unit/command/env_spec.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
require "spec_helper"
1919
autoload :YAML, "yaml"
2020
require "chef-cli/command/env"
21-
2221
describe ChefCLI::Command::Env do
2322
let(:ui) { TestHelpers::TestUI.new }
2423
let(:command_instance) { ChefCLI::Command::Env.new }
@@ -145,8 +144,8 @@
145144
end
146145
end
147146

148-
describe "when running chef-cli coming with Chef-DKE Habitat package" do
149-
let(:hab_pkg_base) { "/hab/pkgs/chef/chef-development-kit-enterprise" }
147+
describe "when running chef-cli coming with chef-workstation Habitat package" do
148+
let(:hab_pkg_base) { "/hab/pkgs/chef/chef-workstation" }
150149
let(:hab_pkg_version) { "1.0.0" }
151150
let(:hab_pkg_build) { "20240210120000" }
152151
let(:hab_pkg_path) { "#{hab_pkg_base}/#{hab_pkg_version}/#{hab_pkg_build}" }
@@ -184,7 +183,7 @@
184183
run_command
185184
end
186185

187-
it "should include correct product name for Chef-DKE Habitat package" do
186+
it "should include correct product name for chef-workstation Habitat package" do
188187
expect(yaml).to have_key(ChefCLI::Dist::CHEF_DK_CLI_PACKAGE)
189188
end
190189

spec/unit/command/shell_init_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,9 @@
364364
end
365365
end
366366

367-
context "with chef-development-kit-enterprise habitat pkg shell-init on bash" do
367+
context "with chef-workstation habitat pkg shell-init on bash" do
368368

369-
let(:chef_dke_path) { "/hab/pkgs/chef/chef-development-kit-enterprise/1.0.0/123" }
369+
let(:chef_dke_path) { "/hab/pkgs/chef/chef-workstation/1.0.0/123" }
370370
let(:cli_hab_path) { "/hab/pkgs/chef/chef-cli/1.0.0/123" }
371371

372372
let(:argv) { ["bash"] }
@@ -377,7 +377,7 @@
377377
end
378378

379379
it "should return the correct paths" do
380-
expect(command_instance).to receive(:get_pkg_prefix).with("chef/chef-development-kit-enterprise").and_return(chef_dke_path)
380+
expect(command_instance).to receive(:get_pkg_prefix).with("chef/chef-workstation").and_return(chef_dke_path)
381381
expect(command_instance).to receive(:get_pkg_prefix).with("chef/chef-cli").and_return(cli_hab_path)
382382

383383
command_instance.run(argv)
@@ -414,7 +414,7 @@
414414
before do
415415
# Stub this or else we'd have to update the test every time a new command
416416
# is added.
417-
allow(command_instance).to receive(:get_pkg_prefix).with("chef/chef-development-kit-enterprise").and_return(chef_dke_path)
417+
allow(command_instance).to receive(:get_pkg_prefix).with("chef/chef-workstation").and_return(chef_dke_path)
418418
allow(command_instance).to receive(:get_pkg_prefix).with("chef/chef-cli").and_return(cli_hab_path)
419419
allow(command_instance.shell_completion_template_context).to receive(:commands)
420420
.and_return(command_descriptions)

spec/unit/helpers_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
end
111111

112112
context "when installed with habitat" do
113-
let(:chef_dke_path) { "/hab/pkgs/chef/chef-development-kit-enterprise/1.0.0/123" }
113+
let(:chef_dke_path) { "/hab/pkgs/chef/chef-workstation/1.0.0/123" }
114114
let(:cli_hab_path) { "/hab/pkgs/chef/chef-cli/1.0.0/123" }
115115
let(:expected_gem_root) { Gem.default_dir }
116116
let(:expected_path) { [File.join(chef_dke_path, "bin"), File.join(cli_hab_path, "vendor", "bin"), "/usr/bin:/bin"].flatten }
@@ -133,7 +133,7 @@
133133

134134
it "should return the habitat env" do
135135
allow(ChefCLI::Helpers).to receive(:fetch_chef_cli_version_pkg).and_return(nil) # Ensure no version override
136-
expect(ChefCLI::Helpers).to receive(:get_pkg_prefix).with("chef/chef-development-kit-enterprise").and_return(chef_dke_path)
136+
expect(ChefCLI::Helpers).to receive(:get_pkg_prefix).with("chef/chef-workstation").and_return(chef_dke_path)
137137
expect(ChefCLI::Helpers).to receive(:get_pkg_prefix).with("chef/chef-cli").and_return(cli_hab_path)
138138

139139
expect(ChefCLI::Helpers.habitat_env).to eq(expected_env)

0 commit comments

Comments
 (0)