Dynamic Runtime source for k8s with github packages (#1252)

* Dynamic Runtime source for k8s

* Still check for source

* Replace / with - for k8s service names

* Simplify sourceForName function
This commit is contained in:
ben-toogood
2020-02-24 17:47:47 +00:00
committed by GitHub
parent ffdf986aac
commit 5e8d5834eb
5 changed files with 35 additions and 6 deletions

View File

@@ -34,9 +34,9 @@ func newService(s *runtime.Service, c runtime.CreateOptions) *service {
kservice := client.NewService(name, version, c.Type)
kdeploy := client.NewDeployment(name, version, c.Type)
if len(s.Source) > 0 {
if len(c.Source) > 0 {
for i := range kdeploy.Spec.Template.PodSpec.Containers {
kdeploy.Spec.Template.PodSpec.Containers[i].Image = s.Source
kdeploy.Spec.Template.PodSpec.Containers[i].Image = c.Source
kdeploy.Spec.Template.PodSpec.Containers[i].Command = []string{}
kdeploy.Spec.Template.PodSpec.Containers[i].Args = []string{name}
}