Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align terminology with Puppet; bare => plain #1228

Merged
merged 2 commits into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Unreleased
- Restore Ruby 3 compatibility [#1234](https://github.com/puppetlabs/r10k/pull/1234)
- (RK-381) Do not recurse into symlinked dirs when finding files to purge. [#1233](https://github.com/puppetlabs/r10k/pull/1233)
- Purge should remove unmanaged directories, in addition to unmanaged files. [#1222](https://github.com/puppetlabs/r10k/pull/1222)
- Rename experimental environment type "bare" to "plain". [#1228](https://github.com/puppetlabs/r10k/pull/1228)

3.12.1
------
Expand Down
8 changes: 4 additions & 4 deletions doc/dynamic-environments/configuration.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -760,16 +760,16 @@ modules:
version: 62d07f2
```

### Bare Environment Type
### Plain Environment Type

mwaggett marked this conversation as resolved.
Show resolved Hide resolved
A "control repository" typically contains a hiera.yaml, an environment.conf, a manifests/site.pp file, and a few other things. However, none of these are strictly necessary for an environment to be functional if modules can be deployed to it.

The bare environment type allows sources that support environment modules to operate without a control repo being required. Modules can be deployed directly.
The plain environment type allows sources that support environment modules to operate without a control repo being required. Modules can be deployed directly.

```yaml
---
production:
type: bare
type: plain
modules:
puppetlabs-stdlib:
type: forge
Expand All @@ -783,7 +783,7 @@ production:
version: 62d07f2

development:
type: bare
type: plain
modules:
puppetlabs-stdlib:
type: forge
Expand Down
1 change: 1 addition & 0 deletions lib/r10k/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def self.from_hash(name, hash)

require 'r10k/environment/base'
require 'r10k/environment/with_modules'
require 'r10k/environment/plain'
require 'r10k/environment/bare'
require 'r10k/environment/git'
require 'r10k/environment/svn'
Expand Down
11 changes: 4 additions & 7 deletions lib/r10k/environment/bare.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
class R10K::Environment::Bare < R10K::Environment::WithModules
class R10K::Environment::Bare < R10K::Environment::Plain

R10K::Environment.register(:bare, self)

def sync
path.mkpath
end

def status
:not_applicable
def initialize(name, basedir, dirname, options = {})
logger.warn _('"bare" environment type is deprecated; please use "plain" instead (environment: %{name})') % {name: name}
super
end

def signature
Expand Down
16 changes: 16 additions & 0 deletions lib/r10k/environment/plain.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
class R10K::Environment::Plain < R10K::Environment::WithModules

R10K::Environment.register(:plain, self)

def sync
path.mkpath
end

def status
:not_applicable
end

def signature
'plain-default'
end
end
13 changes: 13 additions & 0 deletions spec/unit/environment/bare_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require 'spec_helper'
require 'r10k/environment'

describe R10K::Environment::Bare do
it "warns on initialization" do
logger_spy = spy('logger')
allow_any_instance_of(described_class).to receive(:logger).and_return(logger_spy)

described_class.new('envname', '/basedir', 'dirname', {})

expect(logger_spy).to have_received(:warn).with(%r{deprecated.*envname})
end
end
8 changes: 8 additions & 0 deletions spec/unit/environment/plain_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require 'spec_helper'
require 'r10k/environment'

describe R10K::Environment::Plain do
it "initializes successfully" do
expect(described_class.new('envname', '/basedir', 'dirname', {})).to be_a_kind_of(described_class)
end
end
2 changes: 1 addition & 1 deletion spec/unit/environment/with_modules_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'/some/nonexistent/environmentdir',
'prefix_release42',
{
:type => 'bare',
:type => 'plain',
:modules => {
'puppetlabs-stdlib' => { local: true },
'puppetlabs-concat' => { local: true },
Expand Down