Showing with 38 additions and 30 deletions.
  1. +0 −27 .github/workflows/labeller.yml
  2. +8 −0 CHANGELOG.md
  3. +1 −1 lib/puppet/type/node_group.rb
  4. +1 −1 metadata.json
  5. +28 −1 spec/unit/puppet/type/node_group_spec.rb
27 changes: 0 additions & 27 deletions .github/workflows/labeller.yml

This file was deleted.

8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).

## [v1.1.0](https://github.com/puppetlabs/puppetlabs-node_manager/tree/v1.1.0) - 2024-09-16

[Full Changelog](https://github.com/puppetlabs/puppetlabs-node_manager/compare/v1.0.1...v1.1.0)

### Added

- node_group type: Allow uppercase letters in environment names [#95](https://github.com/puppetlabs/puppetlabs-node_manager/pull/95) ([bastelfreak](https://github.com/bastelfreak))

## [v1.0.1](https://github.com/puppetlabs/puppetlabs-node_manager/tree/v1.0.1) - 2024-07-05

[Full Changelog](https://github.com/puppetlabs/puppetlabs-node_manager/compare/0.8.0...v1.0.1)
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/node_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def insync?(is)
desc 'Environment for this group'
defaultto :production
validate do |value|
raise('Invalid environment name') unless value =~ (%r{\A[a-z0-9_]+\Z}) || (value == 'agent-specified')
raise("Invalid environment name: #{value}") unless value =~ (%r{\A[a-zA-Z0-9_]+\Z}) || (value == 'agent-specified')
end
end
newproperty(:classes) do
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-node_manager",
"version": "1.0.1",
"version": "1.1.0",
"author": "puppetlabs",
"summary": "Create and manage PE Console node groups as resources.",
"license": "Apache-2.0",
Expand Down
29 changes: 28 additions & 1 deletion spec/unit/puppet/type/node_group_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,33 @@
}.not_to raise_error
end

it 'allows uppercase environment name without underscore' do
expect {
Puppet::Type.type(:node_group).new(
name: 'stubname',
environment: 'ENVIRONMENTNAME',
)
}.not_to raise_error
end

it 'allows uppercase environment name with an underscore' do
expect {
Puppet::Type.type(:node_group).new(
name: 'stubname',
environment: 'ENVIRONMENT_NAME',
)
}.not_to raise_error
end

it 'allows capitalized environment name with an underscore' do
expect {
Puppet::Type.type(:node_group).new(
name: 'stubname',
environment: 'Environment_name',
)
}.not_to raise_error
end

it 'allows environment name with a number' do
expect {
Puppet::Type.type(:node_group).new(
Expand Down Expand Up @@ -53,7 +80,7 @@
name: 'stubname',
environment: 'not-a-valid-name',
)
}.to raise_error(%r{Invalid environment name})
}.to raise_error(%r{Invalid environment name: not-a-valid-name})
end

it 'allows name with symbols, numbers, and whitespace' do
Expand Down