Action Asim's Feedback
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user