Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
(GH-139) Use puppet-agent 7.15.0
Browse files Browse the repository at this point in the history
Prior to this commit prm was defaulting to a version of puppet-agent
that did not exist on dockerhub. This caused execution to fail unless
the user manually changed the version to a valid one.

This commit bumps the default version of puppet-agent to 7.15.0.
  • Loading branch information
chelnak committed Apr 22, 2022
1 parent 41367c0 commit 86316db
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion acceptance/get/get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func Test_PrmGet_Puppet_FirstRun(t *testing.T) {
stdout, stderr, exitCode := testutils.RunAppCommand(fmt.Sprintf("get puppet --config %s", filepath.Join(tempDir, ".prm.yaml")), "")

// Assert
assert.Contains(t, stdout, "Puppet version is configured to: 7.0.0")
assert.Contains(t, stdout, "Puppet version is configured to: 7.15.0")
assert.Empty(t, stderr)
assert.Equal(t, 0, exitCode)
}
Expand Down
2 changes: 1 addition & 1 deletion acceptance/set/set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func Test_PrmSet_Puppet_InvalidVer(t *testing.T) {
assert.Equal(t, 1, exitCode)

stdout, stderr, exitCode = testutils.RunAppCommand(fmt.Sprintf("get puppet --config %s", filepath.Join(tempDir, ".prm.yaml")), "")
assert.Contains(t, stdout, "Puppet version is configured to: 7.0.0")
assert.Contains(t, stdout, "Puppet version is configured to: 7.15.0")
assert.Empty(t, stderr)
assert.Equal(t, 0, exitCode)
}
Expand Down
4 changes: 2 additions & 2 deletions acceptance/status/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func Test_PrmStatus_NoArgs(t *testing.T) {
// Exec
stdout, stderr, exitCode := testutils.RunAppCommand(fmt.Sprintf("status --config %s", filepath.Join(tempDir, ".prm.yaml")), "")

assert.Contains(t, stdout, "Puppet version: 7.0.0")
assert.Contains(t, stdout, "Puppet version: 7.15.0")
assert.Contains(t, stdout, "Backend: docker (running)")
assert.Empty(t, stderr)
assert.Equal(t, 0, exitCode)
Expand All @@ -44,7 +44,7 @@ func Test_PrmStatus_Json(t *testing.T) {
// Exec
stdout, stderr, exitCode := testutils.RunAppCommand(fmt.Sprintf("status --format json --config %s", filepath.Join(tempDir, ".prm.yaml")), "")

assert.Contains(t, stdout, `"PuppetVersion":"7.0.0"`)
assert.Contains(t, stdout, `"PuppetVersion":"7.15.0"`)
assert.Contains(t, stdout, `"Backend":"docker"`)
assert.Contains(t, stdout, `"IsAvailable":true`)
assert.Empty(t, stderr)
Expand Down
4 changes: 2 additions & 2 deletions docs/md/content/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ It assumes you have already installed PRM.

## Select a Puppet Version

By default, PRM is set to use Puppet 7.0.0 as the runtime environment.
By default, PRM is set to use Puppet 7.15.0 as the runtime environment.
We can verify that:

```sh
prm get puppet
```

```text
4:35PM INF Puppet version is configured to: 7.0.0
4:35PM INF Puppet version is configured to: 7.15.0
```

To change the Puppet runtime version, we use the `prm set` command:
Expand Down
2 changes: 1 addition & 1 deletion pkg/prm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const (
BackendCmdFlag string = "backend"
PuppetVerCfgKey string = "puppetversion" // Should match Config struct key.
BackendCfgKey string = "backend" // Should match Config struct key.
DefaultPuppetVer string = "7"
DefaultPuppetVer string = "7.15.0"
DefaultBackend BackendType = DOCKER
ToolPathCfgKey string = "toolpath"
ToolTimeoutCfgKey string = "toolTimeout"
Expand Down
4 changes: 2 additions & 2 deletions pkg/prm/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestGenerateDefaultCfg(t *testing.T) {
}{
{
name: "Should generate default Puppet and Backend cfgs",
expectedPuppetVersion: "7.0.0",
expectedPuppetVersion: "7.15.0",
expectedBackend: string(prm.DOCKER),
expectedToolPath: "tools",
},
Expand Down Expand Up @@ -52,7 +52,7 @@ func TestLoadConfig(t *testing.T) {
},
{
name: "Should not error when valid semver returned for Puppet ver",
configuredPuppetVer: "7.0.0",
configuredPuppetVer: "7.15.0",
},
}
for _, tt := range tests {
Expand Down
12 changes: 6 additions & 6 deletions pkg/prm/exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestPrm_Exec(t *testing.T) {
name: "Tool is unavailible",
p: &prm.Prm{
RunningConfig: prm.Config{
PuppetVersion: semver.MustParse("7.0.0"),
PuppetVersion: semver.MustParse("7.15.0"),
Backend: prm.DOCKER,
},
Backend: &mock.MockBackend{
Expand All @@ -39,7 +39,7 @@ func TestPrm_Exec(t *testing.T) {
name: "Tool is availible and reports Success",
p: &prm.Prm{
RunningConfig: prm.Config{
PuppetVersion: semver.MustParse("7.0.0"),
PuppetVersion: semver.MustParse("7.15.0"),
Backend: prm.DOCKER,
},
Backend: &mock.MockBackend{
Expand All @@ -57,7 +57,7 @@ func TestPrm_Exec(t *testing.T) {
name: "Tool is availible and reports Failure",
p: &prm.Prm{
RunningConfig: prm.Config{
PuppetVersion: semver.MustParse("7.0.0"),
PuppetVersion: semver.MustParse("7.15.0"),
Backend: prm.DOCKER,
},
Backend: &mock.MockBackend{
Expand All @@ -75,7 +75,7 @@ func TestPrm_Exec(t *testing.T) {
name: "Tool is availible and reports Tool Error",
p: &prm.Prm{
RunningConfig: prm.Config{
PuppetVersion: semver.MustParse("7.0.0"),
PuppetVersion: semver.MustParse("7.15.0"),
Backend: prm.DOCKER,
},
Backend: &mock.MockBackend{
Expand All @@ -93,7 +93,7 @@ func TestPrm_Exec(t *testing.T) {
name: "Tool is availible and reports Tool Not Found",
p: &prm.Prm{
RunningConfig: prm.Config{
PuppetVersion: semver.MustParse("7.0.0"),
PuppetVersion: semver.MustParse("7.15.0"),
Backend: prm.DOCKER,
},
Backend: &mock.MockBackend{
Expand All @@ -111,7 +111,7 @@ func TestPrm_Exec(t *testing.T) {
name: "Error executing tool",
p: &prm.Prm{
RunningConfig: prm.Config{
PuppetVersion: semver.MustParse("7.0.0"),
PuppetVersion: semver.MustParse("7.15.0"),
Backend: prm.DOCKER,
},
Backend: &mock.MockBackend{
Expand Down
20 changes: 10 additions & 10 deletions pkg/prm/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestPrm_GetStatus(t *testing.T) {
name: "Returns a correct Status object",
p: &prm.Prm{
RunningConfig: prm.Config{
PuppetVersion: semver.MustParse("7.0.0"),
PuppetVersion: semver.MustParse("7.15.0"),
Backend: prm.DOCKER,
},
Backend: &mock.MockBackend{
Expand All @@ -29,7 +29,7 @@ func TestPrm_GetStatus(t *testing.T) {
},
},
wantStatus: prm.Status{
PuppetVersion: semver.MustParse("7.0.0"),
PuppetVersion: semver.MustParse("7.15.0"),
Backend: prm.DOCKER,
BackendStatus: prm.BackendStatus{
IsAvailable: true,
Expand Down Expand Up @@ -63,7 +63,7 @@ func TestFormatStatus(t *testing.T) {
args: args{
outputType: "human",
status: prm.Status{
PuppetVersion: semver.MustParse("7.0.0"),
PuppetVersion: semver.MustParse("7.15.0"),
Backend: prm.DOCKER,
BackendStatus: prm.BackendStatus{
IsAvailable: true,
Expand All @@ -72,7 +72,7 @@ func TestFormatStatus(t *testing.T) {
},
},
matches: []string{
"> Puppet version: 7.0.0",
"> Puppet version: 7.15.0",
"> Backend: docker (running)",
},
},
Expand All @@ -81,7 +81,7 @@ func TestFormatStatus(t *testing.T) {
args: args{
outputType: "human",
status: prm.Status{
PuppetVersion: semver.MustParse("7.0.0"),
PuppetVersion: semver.MustParse("7.15.0"),
Backend: prm.DOCKER,
BackendStatus: prm.BackendStatus{
IsAvailable: false,
Expand All @@ -90,7 +90,7 @@ func TestFormatStatus(t *testing.T) {
},
},
matches: []string{
"> Puppet version: 7.0.0",
"> Puppet version: 7.15.0",
"> Backend: docker (error)",
"> Descriptive error!",
},
Expand All @@ -100,7 +100,7 @@ func TestFormatStatus(t *testing.T) {
args: args{
outputType: "json",
status: prm.Status{
PuppetVersion: semver.MustParse("7.0.0"),
PuppetVersion: semver.MustParse("7.15.0"),
Backend: prm.DOCKER,
BackendStatus: prm.BackendStatus{
IsAvailable: true,
Expand All @@ -109,7 +109,7 @@ func TestFormatStatus(t *testing.T) {
},
},
matches: []string{
`"PuppetVersion":"7.0.0"`,
`"PuppetVersion":"7.15.0"`,
`"Backend":"docker"`,
`"IsAvailable":true`,
},
Expand All @@ -119,7 +119,7 @@ func TestFormatStatus(t *testing.T) {
args: args{
outputType: "json",
status: prm.Status{
PuppetVersion: semver.MustParse("7.0.0"),
PuppetVersion: semver.MustParse("7.15.0"),
Backend: prm.DOCKER,
BackendStatus: prm.BackendStatus{
IsAvailable: false,
Expand All @@ -128,7 +128,7 @@ func TestFormatStatus(t *testing.T) {
},
},
matches: []string{
`"PuppetVersion":"7.0.0"`,
`"PuppetVersion":"7.15.0"`,
`"Backend":"docker"`,
`"IsAvailable":false`,
`"StatusMsg":"Descriptive error!"`,
Expand Down

0 comments on commit 86316db

Please sign in to comment.