Tidying Up
This commit is contained in:
parent
aa58a9749b
commit
9983aea928
@ -327,8 +327,7 @@ func (k *kubernetes) List() ([]*runtime.Service, error) {
|
|||||||
func (k *kubernetes) Update(s *runtime.Service) error {
|
func (k *kubernetes) Update(s *runtime.Service) error {
|
||||||
// create new kubernetes micro service
|
// create new kubernetes micro service
|
||||||
service := newService(s, runtime.CreateOptions{
|
service := newService(s, runtime.CreateOptions{
|
||||||
Type: k.options.Type,
|
Type: k.options.Type,
|
||||||
Source: k.options.Source,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// update build time annotation
|
// update build time annotation
|
||||||
@ -344,8 +343,7 @@ func (k *kubernetes) Delete(s *runtime.Service) error {
|
|||||||
|
|
||||||
// create new kubernetes micro service
|
// create new kubernetes micro service
|
||||||
service := newService(s, runtime.CreateOptions{
|
service := newService(s, runtime.CreateOptions{
|
||||||
Type: k.options.Type,
|
Type: k.options.Type,
|
||||||
Source: k.options.Source,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
return service.Stop(k.client)
|
return service.Stop(k.client)
|
||||||
|
@ -71,9 +71,6 @@ func newService(s *runtime.Service, c runtime.CreateOptions) *service {
|
|||||||
// specify the command to exec
|
// specify the command to exec
|
||||||
if len(c.Command) > 0 {
|
if len(c.Command) > 0 {
|
||||||
kdeploy.Spec.Template.PodSpec.Containers[0].Command = c.Command
|
kdeploy.Spec.Template.PodSpec.Containers[0].Command = c.Command
|
||||||
} else if len(s.Source) > 0 {
|
|
||||||
// default command for our k8s service should be source
|
|
||||||
kdeploy.Spec.Template.PodSpec.Containers[0].Command = []string{"go", "run", s.Source}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return &service{
|
return &service{
|
||||||
|
@ -51,8 +51,6 @@ type CreateOptions struct {
|
|||||||
Output io.Writer
|
Output io.Writer
|
||||||
// Type of service to create
|
// Type of service to create
|
||||||
Type string
|
Type string
|
||||||
// Source of the code
|
|
||||||
Source string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReadOptions queries runtime services
|
// ReadOptions queries runtime services
|
||||||
|
Loading…
x
Reference in New Issue
Block a user