Runtime custom docker img (#1168)

* Add DeploymentOptions to K8s Client

* WithBaseImage for  Runtime

* Revert Change

* Fix sequencing
This commit is contained in:
ben-toogood
2020-02-06 08:52:25 +00:00
committed by GitHub
parent a44dc90d45
commit d8110b70a3
4 changed files with 42 additions and 4 deletions

View File

@@ -226,9 +226,11 @@ func NewService(name, version, typ string) *Service {
}
// NewService returns default micro kubernetes deployment definition
func NewDeployment(name, version, typ string) *Deployment {
func NewDeployment(name, version, typ string, opts ...DeploymentOption) *Deployment {
log.Tracef("kubernetes default deployment: name: %s, version: %s", name, version)
options := NewDeploymentOptions(opts)
Labels := map[string]string{
"name": name,
"version": version,
@@ -265,7 +267,7 @@ func NewDeployment(name, version, typ string) *Deployment {
PodSpec: &PodSpec{
Containers: []Container{{
Name: name,
Image: DefaultImage,
Image: options.BaseImage,
Env: []EnvVar{env},
Command: []string{"go", "run", "main.go"},
Ports: []ContainerPort{{