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

View File

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