Action Asim's Feedback

This commit is contained in:
Ben Toogood
2020-02-06 09:17:10 +00:00
parent d8110b70a3
commit aa58a9749b
5 changed files with 15 additions and 42 deletions

View File

@@ -1,9 +1,5 @@
package client
type DeploymentOptions struct {
BaseImage string
}
type LogOptions struct {
Params map[string]string
}
@@ -14,7 +10,6 @@ type WatchOptions struct {
type LogOption func(*LogOptions)
type WatchOption func(*WatchOptions)
type DeploymentOption func(*DeploymentOptions)
// LogParams provides additional params for logs
func LogParams(p map[string]string) LogOption {
@@ -29,24 +24,3 @@ func WatchParams(p map[string]string) WatchOption {
w.Params = p
}
}
// WithBaseImage sets the base image for the deployment
func WithBaseImage(img string) DeploymentOption {
return func(d *DeploymentOptions) {
d.BaseImage = img
}
}
// NewDeploymentOptions returns an initialized DeploymentOptions
func NewDeploymentOptions(opts []DeploymentOption) DeploymentOptions {
var options DeploymentOptions
for _, o := range opts {
o(&options)
}
if options.BaseImage == "" {
options.BaseImage = DefaultImage
}
return options
}