Fix
This commit is contained in:
parent
111126c780
commit
fc4191c647
@ -35,9 +35,9 @@ func newService(s *runtime.Service, c runtime.CreateOptions) *service {
|
|||||||
kdeploy := client.NewDeployment(name, version, c.Type)
|
kdeploy := client.NewDeployment(name, version, c.Type)
|
||||||
|
|
||||||
if len(s.Source) > 0 {
|
if len(s.Source) > 0 {
|
||||||
for _, c := range kdeploy.Spec.Template.PodSpec.Containers {
|
for i := range kdeploy.Spec.Template.PodSpec.Containers {
|
||||||
c.Image = s.Source
|
kdeploy.Spec.Template.PodSpec.Containers[i].Image = s.Source
|
||||||
c.Command = []string{name}
|
kdeploy.Spec.Template.PodSpec.Containers[i].Command = []string{name}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,9 +98,6 @@ func serviceResource(s *client.Service) *client.Resource {
|
|||||||
|
|
||||||
// Start starts the Kubernetes service. It creates new kubernetes deployment and service API objects
|
// Start starts the Kubernetes service. It creates new kubernetes deployment and service API objects
|
||||||
func (s *service) Start(k client.Client) error {
|
func (s *service) Start(k client.Client) error {
|
||||||
bytes, _ := json.Marshal(s.kdeploy)
|
|
||||||
log.Debug("kdeploy", string(bytes))
|
|
||||||
|
|
||||||
// create deployment first; if we fail, we dont create service
|
// create deployment first; if we fail, we dont create service
|
||||||
if err := k.Create(deploymentResource(s.kdeploy)); err != nil {
|
if err := k.Create(deploymentResource(s.kdeploy)); err != nil {
|
||||||
log.Debugf("Runtime failed to create deployment: %v", err)
|
log.Debugf("Runtime failed to create deployment: %v", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user