Debugging

This commit is contained in:
Ben Toogood 2020-02-06 11:00:14 +00:00
parent 54371bba6a
commit 111126c780
3 changed files with 5 additions and 6 deletions

View File

@ -2,7 +2,6 @@
package kubernetes
import (
"encoding/json"
"errors"
"fmt"
"strings"
@ -277,9 +276,6 @@ func (k *kubernetes) Create(s *runtime.Service, opts ...runtime.CreateOption) er
service := newService(s, options)
bytes, _ := json.Marshal(service)
log.Debug(string(bytes))
// start the service
return service.Start(k.client)
}

View File

@ -98,6 +98,9 @@ func serviceResource(s *client.Service) *client.Resource {
// Start starts the Kubernetes service. It creates new kubernetes deployment and service API objects
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
if err := k.Create(deploymentResource(s.kdeploy)); err != nil {
log.Debugf("Runtime failed to create deployment: %v", err)

View File

@ -267,8 +267,8 @@ func NewDeployment(name, version, typ string) *Deployment {
Name: name,
Image: DefaultImage,
Env: []EnvVar{env},
Command: []string{"go", "run", "mainx.go"},
Ports: []ContainerPort{{
Command: []string{"go", "run", "main.go"},
Ports: []ContainerPort{
Name: "service-port",
ContainerPort: 8080,
}},