summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-12-30 19:11:02 -0800
committerGitHub <noreply@github.com>2020-12-30 19:11:02 -0800
commit27a5d23d7746a0f69827555ea6b12b3b755110b3 (patch)
tree6561a8393a7c406db0edeabd493bd62fb0833f9d
parent1012ae6a87e4d9d145b11ba64e41473ddb865add (diff)
parentaed9f8ab89e210cceebf872fb3b1824a24d2e79c (diff)
downloadchef-27a5d23d7746a0f69827555ea6b12b3b755110b3.tar.gz
Merge branch 'master' into bundler
-rw-r--r--.expeditor/config.yml48
-rw-r--r--CHANGELOG.md7
-rw-r--r--Gemfile.lock22
-rw-r--r--VERSION2
-rw-r--r--chef-bin/lib/chef-bin/version.rb2
-rw-r--r--chef-config/lib/chef-config/version.rb2
-rw-r--r--chef-utils/lib/chef-utils/version.rb2
-rw-r--r--docs/dev/how_to/adding_new_platforms_to_infra.md57
-rw-r--r--kitchen-tests/cookbooks/end_to_end/recipes/windows.rb10
-rw-r--r--lib/chef/resource/user/windows_user.rb5
-rw-r--r--lib/chef/version.rb2
-rw-r--r--spec/unit/resource/user/windows_user_spec.rb36
12 files changed, 175 insertions, 20 deletions
diff --git a/.expeditor/config.yml b/.expeditor/config.yml
index f91b6462e1..deaf0749cd 100644
--- a/.expeditor/config.yml
+++ b/.expeditor/config.yml
@@ -157,3 +157,51 @@ subscriptions:
- workload: ruby_gem_published:ffi-libarchive-*
actions:
- bash:.expeditor/update_dep.sh
+ - workload: ruby_gem_published:plist-*
+ actions:
+ - bash:.expeditor/update_dep.sh
+ - workload: ruby_gem_published:ffi-*
+ actions:
+ - bash:.expeditor/update_dep.sh
+ - workload: ruby_gem_published:net-ssh-*
+ actions:
+ - bash:.expeditor/update_dep.sh
+ - workload: ruby_gem_published:tty-prompt-*
+ actions:
+ - bash:.expeditor/update_dep.sh
+ - workload: ruby_gem_published:tty-screen-*
+ actions:
+ - bash:.expeditor/update_dep.sh
+ - workload: ruby_gem_published:tty-table-*
+ actions:
+ - bash:.expeditor/update_dep.sh
+ - workload: ruby_gem_published:pastel-*
+ actions:
+ - bash:.expeditor/update_dep.sh
+ - workload: ruby_gem_published:erubis-*
+ actions:
+ - bash:.expeditor/update_dep.sh
+ - workload: ruby_gem_published:bcrypt_pbkdf-*
+ actions:
+ - bash:.expeditor/update_dep.sh
+ - workload: ruby_gem_published:ed25519-*
+ actions:
+ - bash:.expeditor/update_dep.sh
+ - workload: ruby_gem_published:addressable-*
+ actions:
+ - bash:.expeditor/update_dep.sh
+ - workload: ruby_gem_published:proxifier-*
+ actions:
+ - bash:.expeditor/update_dep.sh
+ - workload: ruby_gem_published:syslog-logger-*
+ actions:
+ - bash:.expeditor/update_dep.sh
+ - workload: ruby_gem_published:uuidtools-*
+ actions:
+ - bash:.expeditor/update_dep.sh
+ - workload: ruby_gem_published:iniparse-*
+ actions:
+ - bash:.expeditor/update_dep.sh
+ - workload: ruby_gem_published:net-sftp-*
+ actions:
+ - bash:.expeditor/update_dep.sh \ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 776d10c7bf..4582cdc13e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,15 +1,16 @@
<!-- usage documentation: http://expeditor-docs.es.chef.io/configuration/changelog/ -->
-<!-- latest_release 17.0.16 -->
-## [v17.0.16](https://github.com/chef/chef/tree/v17.0.16) (2020-12-30)
+<!-- latest_release 17.0.17 -->
+## [v17.0.17](https://github.com/chef/chef/tree/v17.0.17) (2020-12-31)
#### Merged Pull Requests
-- Consolidate Windows cert tests to improve CI runtime [#10794](https://github.com/chef/chef/pull/10794) ([phiggins](https://github.com/phiggins))
+- Coerce uid to integer in Windows user resource. [#10803](https://github.com/chef/chef/pull/10803) ([phiggins](https://github.com/phiggins))
<!-- latest_release -->
<!-- release_rollup since=16.8.14 -->
### Changes not yet released to stable
#### Merged Pull Requests
+- Coerce uid to integer in Windows user resource. [#10803](https://github.com/chef/chef/pull/10803) ([phiggins](https://github.com/phiggins)) <!-- 17.0.17 -->
- Consolidate Windows cert tests to improve CI runtime [#10794](https://github.com/chef/chef/pull/10794) ([phiggins](https://github.com/phiggins)) <!-- 17.0.16 -->
- Fix escaping in doc string. [#10793](https://github.com/chef/chef/pull/10793) ([phiggins](https://github.com/phiggins)) <!-- 17.0.15 -->
- Add Test Kitchen testing for Debian 11 [#10791](https://github.com/chef/chef/pull/10791) ([tas50](https://github.com/tas50)) <!-- 17.0.14 -->
diff --git a/Gemfile.lock b/Gemfile.lock
index d0a2d07462..b58e3c38c4 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -28,11 +28,11 @@ GIT
PATH
remote: .
specs:
- chef (17.0.16)
+ chef (17.0.17)
addressable
bcrypt_pbkdf (= 1.1.0.rc1)
- chef-config (= 17.0.16)
- chef-utils (= 17.0.16)
+ chef-config (= 17.0.17)
+ chef-utils (= 17.0.17)
chef-vault
chef-zero (>= 14.0.11)
diff-lcs (>= 1.2.4, < 1.4.0)
@@ -64,11 +64,11 @@ PATH
tty-screen (~> 0.6)
tty-table (~> 0.11)
uuidtools (~> 2.1.5)
- chef (17.0.16-universal-mingw32)
+ chef (17.0.17-universal-mingw32)
addressable
bcrypt_pbkdf (= 1.1.0.rc1)
- chef-config (= 17.0.16)
- chef-utils (= 17.0.16)
+ chef-config (= 17.0.17)
+ chef-utils (= 17.0.17)
chef-vault
chef-zero (>= 14.0.11)
diff-lcs (>= 1.2.4, < 1.4.0)
@@ -115,15 +115,15 @@ PATH
PATH
remote: chef-bin
specs:
- chef-bin (17.0.16)
- chef (= 17.0.16)
+ chef-bin (17.0.17)
+ chef (= 17.0.17)
PATH
remote: chef-config
specs:
- chef-config (17.0.16)
+ chef-config (17.0.17)
addressable
- chef-utils (= 17.0.16)
+ chef-utils (= 17.0.17)
fuzzyurl
mixlib-config (>= 2.2.12, < 4.0)
mixlib-shellout (>= 2.0, < 4.0)
@@ -132,7 +132,7 @@ PATH
PATH
remote: chef-utils
specs:
- chef-utils (17.0.16)
+ chef-utils (17.0.17)
GEM
remote: https://rubygems.org/
diff --git a/VERSION b/VERSION
index 02c6e558a6..300a42561a 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-17.0.16 \ No newline at end of file
+17.0.17 \ No newline at end of file
diff --git a/chef-bin/lib/chef-bin/version.rb b/chef-bin/lib/chef-bin/version.rb
index cc1f17b0e7..a406f5d9ff 100644
--- a/chef-bin/lib/chef-bin/version.rb
+++ b/chef-bin/lib/chef-bin/version.rb
@@ -21,7 +21,7 @@
module ChefBin
CHEFBIN_ROOT = File.expand_path("..", __dir__)
- VERSION = "17.0.16".freeze
+ VERSION = "17.0.17".freeze
end
#
diff --git a/chef-config/lib/chef-config/version.rb b/chef-config/lib/chef-config/version.rb
index 4f33c2a992..52a13cfdd6 100644
--- a/chef-config/lib/chef-config/version.rb
+++ b/chef-config/lib/chef-config/version.rb
@@ -15,5 +15,5 @@
module ChefConfig
CHEFCONFIG_ROOT = File.expand_path("..", __dir__)
- VERSION = "17.0.16".freeze
+ VERSION = "17.0.17".freeze
end
diff --git a/chef-utils/lib/chef-utils/version.rb b/chef-utils/lib/chef-utils/version.rb
index 5d42c29a10..97e8a92167 100644
--- a/chef-utils/lib/chef-utils/version.rb
+++ b/chef-utils/lib/chef-utils/version.rb
@@ -16,5 +16,5 @@
module ChefUtils
CHEFUTILS_ROOT = File.expand_path("..", __dir__)
- VERSION = "17.0.16"
+ VERSION = "17.0.17"
end
diff --git a/docs/dev/how_to/adding_new_platforms_to_infra.md b/docs/dev/how_to/adding_new_platforms_to_infra.md
new file mode 100644
index 0000000000..12174e9aaa
--- /dev/null
+++ b/docs/dev/how_to/adding_new_platforms_to_infra.md
@@ -0,0 +1,57 @@
+# Adding New Platforms to Chef Infra
+
+Adding a new platform to Chef Infra involves not just adding the platform to the `chef/chef` repo in GitHub, but also ensuring that the platform is supported in all of our ecosystem tooling. This document breaks down all the places we need to update to bring in a new platform.
+
+## Adding the Build to Chef/Chef
+
+### Pull Request Testing
+
+When we add a new platform, if possible, we want to ensure that we test that platform on all Pull Requests to the `chef/chef` GitHub repository. There are a few places to update to accomplish this.
+
+#### RubyDistros
+
+We run RSpec tests against all Pull Requests to `chef/chef` using containers built from our [RubyDistros project](https://github.com/chef/rubydistros). These containers are built on various Linux distribution releases and target the last few Ruby releases. This allows us to run RSpec tests on common Linux platforms like CentOS 8 with Ruby releases such as 2.7 or 3.0.
+
+For major new Linux or Windows distribution releases, you'll want to add these to the RubyDistros repository. You can test these builds locally in Docker and then set the builds to run on DockerHub. If you're not a member of the [RubyDistros DockerHub org](https://hub.docker.com/orgs/rubydistros) then ask #releng-support to add you to that. From there you can add a new repository matching the existing repository setups. Make sure you configure the automated builds to point to the correct Dockerfile path with each Ruby version as a tag. See https://hub.docker.com/repository/docker/rubydistros/opensuse-15 for an example of how we set this up.
+
+Note: Windows builds can't be built on DockerHub and have to be pushed manually from your workstation instead.
+
+Once you've added the distro to RubyDistros and the image is pushed to DockerHub, you can add that new distro to the `chef/chef` [verify.pipeline.yml](https://github.com/chef/chef/blob/master/.expeditor/verify.pipeline.yml).
+
+#### Kitchen Dokken Images
+
+We utilize the kitchen-dokken Test Kitchen plugin to test the contents of `chef/chef` against various Linux distributions. This works best when run against containers that look more like VMs and less like slim containers. The [dokken-images](https://github.com/test-kitchen/dokken-images) repository defines many Docker images for common Linux distributions. These are all based on the official distro Docker images but contain additional packages to make them behave more like full systems.
+
+Similar to the RubyDistros setup, these are defined in GitHub and built-in DockerHub. You'll need to be a member of the [dokken DockerHub organization](https://hub.docker.com/orgs/dokken). If you don't have access to that please ask #releng-support to add you. Once you've added a distro to the GitHub repo you can add a new repository to that DockerHub Organization. Make sure to copy the automated builds settings and specify the correct path to the Dockerfile. Once that is complete and the image is pushed to DockerHub you can add the new test to `chef/chef`. You'll need to edit the [kitchen-test/kitchen.yml](https://github.com/chef/chef/blob/master/kitchen-tests/kitchen.yml) file and then add that new platform to the [verify.pipeline.yml](https://github.com/chef/chef/blob/master/.expeditor/verify.pipeline.yml) config.
+
+#### Azure Pipelines tests
+
+COMING SOON!
+
+### Omnibus Pipeline
+
+With the new platform tested in Pull Requests, you'll now want to ensure that we build and test these packages in our Buildkite Omnibus pipeline.
+
+HOW TO DO THIS COMING SOON!
+
+### Code Changes
+
+With builds in place, we also want to make sure we support this new platform within the Chef Infra Client itself. Most of this is not something that can be documented here. You'll just need to understand where in Chef Infra Client we need to support a new distro. The two most common places to add support are `Ohai` and `chef-utils`:
+
+#### chef-utils
+
+chef-utils provides a large number of helpers for making cookbook authoring simpler. One of the most useful sets of helpers is helpers for platforms and platform families, which will need to be updated if we added new distros. Make sure new platform are supported in `platform.rb` / `platform_family.rb` files in [chef-utils/lib/chef-utils/dsl](https://github.com/chef/chef/tree/master/chef-utils/lib/chef-utils/dsl). In order to test these changes you'll most likely need to update the Fauxhai data. See the section below for instructions on updating that data.
+
+#### Ohai
+
+Ohai powers all system configuration detection for Chef Infra Client. New distributions have pretty far-reaching impacts on Ohai and should be evaluated carefully. The most basic task when adding a new distro is to make sure that the platform is properly mapped to the appropriate platform_family value. On Linux systems this is performed in the [Linux Platform Plugin](https://github.com/chef/ohai/blob/master/lib/ohai/plugins/linux/platform.rb).
+
+## Additional Ecosystem Updates
+
+### Bento Boxes
+
+COMING SOON!
+
+### Fauxhai Dumps
+
+COMING SOON! \ No newline at end of file
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb b/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb
index 46176901dd..c6cd597fe0 100644
--- a/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb
+++ b/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb
@@ -125,4 +125,12 @@ include_recipe "::_ohai_hint"
hostname "new-hostname" do
windows_reboot false
-end \ No newline at end of file
+end
+
+user "phil" do
+ uid "8019"
+end
+
+user "phil" do
+ action :remove
+end
diff --git a/lib/chef/resource/user/windows_user.rb b/lib/chef/resource/user/windows_user.rb
index d504158edf..d738ba1636 100644
--- a/lib/chef/resource/user/windows_user.rb
+++ b/lib/chef/resource/user/windows_user.rb
@@ -29,6 +29,11 @@ class Chef
property :full_name, String,
description: "The full name of the user.",
introduced: "14.6"
+
+ # Override the property from the parent class to coerce to integer.
+ property :uid, [ String, Integer, NilClass ], # nil for backwards compat
+ description: "The numeric user identifier.",
+ coerce: proc { |n| n && Integer(n) rescue n }
end
end
end
diff --git a/lib/chef/version.rb b/lib/chef/version.rb
index dcff993f4a..00d4ec9f87 100644
--- a/lib/chef/version.rb
+++ b/lib/chef/version.rb
@@ -23,7 +23,7 @@ require_relative "version_string"
class Chef
CHEF_ROOT = File.expand_path("..", __dir__)
- VERSION = Chef::VersionString.new("17.0.16")
+ VERSION = Chef::VersionString.new("17.0.17")
end
#
diff --git a/spec/unit/resource/user/windows_user_spec.rb b/spec/unit/resource/user/windows_user_spec.rb
new file mode 100644
index 0000000000..32f8e69d99
--- /dev/null
+++ b/spec/unit/resource/user/windows_user_spec.rb
@@ -0,0 +1,36 @@
+#
+# Copyright:: Copyright (c) Chef Software Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require "spec_helper"
+
+describe Chef::Resource::User::WindowsUser, "#uid" do
+ let(:resource) { Chef::Resource::User::WindowsUser.new("notarealuser") }
+
+ it "allows a string" do
+ resource.uid "100"
+ expect(resource.uid).to eql(100)
+ end
+
+ it "allows an integer" do
+ resource.uid 100
+ expect(resource.uid).to eql(100)
+ end
+
+ it "does not allow a hash" do
+ expect { resource.uid({ woot: "i found it" }) }.to raise_error(ArgumentError)
+ end
+end