Skip to content

Commit

Permalink
#232: Update all restart policies to 'unless-stopped' (#250)
Browse files Browse the repository at this point in the history
* #232: Update all restart policies to 'unless-stopped'

Signed-off-by: Karl Hepworth <karl.hepworth@gmail.com>

* #233: Lando test (#234)

* Add a lando test
* Remove lando init from test
* update directory path change
* Update URL for lando project
* Lando uses slightly different Lagoon headers...

* Additional running check for container state searches. (#237)

Signed-off-by: Karl Hepworth <karl.hepworth@gmail.com>

* Refactoring the `model` package (#239)

* Moar tests.
* Separate out Docker functions from the model package
* gofmt
* gofmt
* remove key operation examples for now
* Forgot to actually start the containers.
* Additional running check for container state searches. (#237)
* add dist to gitignore
* Update output path
* Decouple regression tests from using docker client api directly and use docker lib
* Add some notes on local development
* add service tests into travis

* Bump github.com/imdario/mergo from 0.3.9 to 0.3.10 (#240)

Bumps [github.com/imdario/mergo](https://github.com/imdario/mergo) from 0.3.9 to 0.3.10.
- [Release notes](https://github.com/imdario/mergo/releases)
- [Commits](darccio/mergo@v0.3.9...v0.3.10)

* Revert "Bump github.com/imdario/mergo from 0.3.9 to 0.3.10 (#240)" (#242)

This reverts commit c4ff1d3.

* Update applicable references from master to main

Signed-off-by: Karl Hepworth <karl.hepworth@gmail.com>

* Bump github.com/spf13/viper from 1.7.0 to 1.7.1 (#245)

Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.7.0 to 1.7.1.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](spf13/viper@v1.7.0...v1.7.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* #246: Create new value for services before merging default values in place (#247)

Signed-off-by: Karl Hepworth <karl.hepworth@gmail.com>

* #244: Stabilise Lando tests (#249)

* Try rebuilding Lando project before starting.
* add sleep command to alndo build process
* ignore lando start failures

* Bump github.com/imdario/mergo from 0.3.9 to 0.3.11 (#248)

Bumps [github.com/imdario/mergo](https://github.com/imdario/mergo) from 0.3.9 to 0.3.11.
- [Release notes](https://github.com/imdario/mergo/releases)
- [Commits](darccio/mergo@v0.3.9...v0.3.11)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Update tests for field values of restart policy to match new value "unless-stopped"

Signed-off-by: Karl Hepworth <karl.hepworth@gmail.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
  • Loading branch information
fubarhouse and dependabot-preview[bot] committed Aug 25, 2020
1 parent dd42ecc commit a6881fe
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/pygmy.complex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ services:
8080/tcp:
- HostPort: 8080
RestartPolicy:
Name: always
Name: unless-stopped
MaximumRetryCount: 0
NetworkConfig:
Ports:
Expand Down
2 changes: 1 addition & 1 deletion service/dnsmasq/dnsmasq.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func New() model.Service {
RestartPolicy: struct {
Name string
MaximumRetryCount int
}{Name: "on-failure", MaximumRetryCount: 0},
}{Name: "unless-stopped", MaximumRetryCount: 0},
},
NetworkConfig: network.NetworkingConfig{},
}
Expand Down
2 changes: 1 addition & 1 deletion service/dnsmasq/dnsmasq_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func Test(t *testing.T) {
So(fmt.Sprint(obj.HostConfig.CapAdd), ShouldEqual, fmt.Sprint([]string{"NET_ADMIN"}))
So(obj.HostConfig.IpcMode, ShouldEqual, "private")
So(fmt.Sprint(obj.HostConfig.PortBindings), ShouldEqual, fmt.Sprint(nat.PortMap{"53/tcp": []nat.PortBinding{{HostIP: "", HostPort: "6053"}}, "53/udp": []nat.PortBinding{{HostIP: "", HostPort: "6053"}}}))
So(obj.HostConfig.RestartPolicy.Name, ShouldEqual, "on-failure")
So(obj.HostConfig.RestartPolicy.Name, ShouldEqual, "unless-stopped")
So(obj.HostConfig.RestartPolicy.MaximumRetryCount, ShouldBeZeroValue)
})
}
2 changes: 1 addition & 1 deletion service/haproxy/haproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func New() model.Service {
RestartPolicy: struct {
Name string
MaximumRetryCount int
}{Name: "on-failure", MaximumRetryCount: 0},
}{Name: "unless-stopped", MaximumRetryCount: 0},
},
NetworkConfig: network.NetworkingConfig{},
}
Expand Down
2 changes: 1 addition & 1 deletion service/haproxy/haproxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func Test(t *testing.T) {
So(obj.HostConfig.AutoRemove, ShouldBeFalse)
So(fmt.Sprint(obj.HostConfig.Binds), ShouldEqual, fmt.Sprint([]string{"/var/run/docker.sock:/tmp/docker.sock"}))
So(obj.HostConfig.PortBindings, ShouldEqual, nil)
So(obj.HostConfig.RestartPolicy.Name, ShouldEqual, "on-failure")
So(obj.HostConfig.RestartPolicy.Name, ShouldEqual, "unless-stopped")
So(obj.HostConfig.RestartPolicy.MaximumRetryCount, ShouldEqual, 0)
So(fmt.Sprint(objPorts.HostConfig.PortBindings), ShouldEqual, fmt.Sprint(nat.PortMap{"80/tcp": []nat.PortBinding{{HostIP: "", HostPort: "80"}}}))
})
Expand Down
2 changes: 1 addition & 1 deletion service/mailhog/mailhog.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func New() model.Service {
RestartPolicy: struct {
Name string
MaximumRetryCount int
}{Name: "on-failure", MaximumRetryCount: 0},
}{Name: "unless-stopped", MaximumRetryCount: 0},
},
NetworkConfig: network.NetworkingConfig{},
}
Expand Down
2 changes: 1 addition & 1 deletion service/mailhog/mailhog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func Test(t *testing.T) {
So(obj.Config.Labels["pygmy.weight"], ShouldEqual, "15")
So(obj.HostConfig.AutoRemove, ShouldBeFalse)
So(obj.HostConfig.PortBindings, ShouldEqual, nil)
So(obj.HostConfig.RestartPolicy.Name, ShouldEqual, "on-failure")
So(obj.HostConfig.RestartPolicy.Name, ShouldEqual, "unless-stopped")
So(obj.HostConfig.RestartPolicy.MaximumRetryCount, ShouldEqual, 0)
So(fmt.Sprint(objPorts.HostConfig.PortBindings), ShouldEqual, fmt.Sprint(nat.PortMap{"1025/tcp": []nat.PortBinding{{HostIP: "", HostPort: "1025"}}}))
})
Expand Down
2 changes: 1 addition & 1 deletion service/ssh/agent/ssh_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func New() model.Service {
RestartPolicy: struct {
Name string
MaximumRetryCount int
}{Name: "on-failure", MaximumRetryCount: 0},
}{Name: "unless-stopped", MaximumRetryCount: 0},
},
NetworkConfig: network.NetworkingConfig{},
}
Expand Down
2 changes: 1 addition & 1 deletion service/ssh/agent/ssh_agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func Test(t *testing.T) {
So(obj.HostConfig.AutoRemove, ShouldBeFalse)
So(obj.HostConfig.IpcMode, ShouldEqual, "private")
So(obj.HostConfig.PortBindings, ShouldEqual, nil)
So(obj.HostConfig.RestartPolicy.Name, ShouldEqual, "on-failure")
So(obj.HostConfig.RestartPolicy.Name, ShouldEqual, "unless-stopped")
So(obj.HostConfig.RestartPolicy.MaximumRetryCount, ShouldEqual, 0)
})
}

0 comments on commit a6881fe

Please sign in to comment.