Action Asim's Feedback
This commit is contained in:
@@ -327,7 +327,8 @@ func (k *kubernetes) List() ([]*runtime.Service, error) {
|
||||
func (k *kubernetes) Update(s *runtime.Service) error {
|
||||
// create new kubernetes micro service
|
||||
service := newService(s, runtime.CreateOptions{
|
||||
Type: k.options.Type,
|
||||
Type: k.options.Type,
|
||||
Source: k.options.Source,
|
||||
})
|
||||
|
||||
// update build time annotation
|
||||
@@ -343,8 +344,8 @@ func (k *kubernetes) Delete(s *runtime.Service) error {
|
||||
|
||||
// create new kubernetes micro service
|
||||
service := newService(s, runtime.CreateOptions{
|
||||
Type: k.options.Type,
|
||||
BaseImage: k.options.Source,
|
||||
Type: k.options.Type,
|
||||
Source: k.options.Source,
|
||||
})
|
||||
|
||||
return service.Stop(k.client)
|
||||
|
@@ -34,6 +34,13 @@ 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 {
|
||||
for _, c := range kdeploy.Spec.Template.PodSpec.Containers {
|
||||
c.Image = s.Source
|
||||
c.Command = []string{name}
|
||||
}
|
||||
}
|
||||
|
||||
// attach our values to the deployment; name, version, source
|
||||
kdeploy.Metadata.Annotations["name"] = s.Name
|
||||
kdeploy.Metadata.Annotations["version"] = s.Version
|
||||
|
@@ -51,8 +51,8 @@ type CreateOptions struct {
|
||||
Output io.Writer
|
||||
// Type of service to create
|
||||
Type string
|
||||
// Base image for docker
|
||||
BaseImage string
|
||||
// Source of the code
|
||||
Source string
|
||||
}
|
||||
|
||||
// ReadOptions queries runtime services
|
||||
@@ -94,13 +94,6 @@ func WithOutput(out io.Writer) CreateOption {
|
||||
}
|
||||
}
|
||||
|
||||
// WithBaseImage sets the docker img
|
||||
func WithBaseImage(img string) CreateOption {
|
||||
return func(o *CreateOptions) {
|
||||
o.BaseImage = img
|
||||
}
|
||||
}
|
||||
|
||||
// ReadService returns services with the given name
|
||||
func ReadService(service string) ReadOption {
|
||||
return func(o *ReadOptions) {
|
||||
|
Reference in New Issue
Block a user