mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 19:13:34 +00:00
feat: rolling deploy strategy for global service, always recreate
This commit is contained in:
@@ -69,6 +69,12 @@ func (c *Container) ServicePorts() ([]PortSpec, error) {
|
||||
return ports, nil
|
||||
}
|
||||
|
||||
func (c *Container) ServiceSpec() ServiceSpec {
|
||||
// TODO: migrate api.Container type to use ContainerJSON to make it possible to construct
|
||||
// a ServiceSpec from a Container.
|
||||
return ServiceSpec{}
|
||||
}
|
||||
|
||||
// runningStatusRegex matches the status string of a running container.
|
||||
// - "Up 3 minutes (healthy)" -> groups: ["Up 3 minutes (healthy)", "healthy"]
|
||||
// - "Up 5 seconds" -> groups: ["Up 5 seconds", ""]
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/distribution/reference"
|
||||
"reflect"
|
||||
"uncloud/internal/machine/api/pb"
|
||||
)
|
||||
|
||||
@@ -37,6 +38,10 @@ func (s *ServiceSpec) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *ServiceSpec) Equals(spec ServiceSpec) bool {
|
||||
return reflect.DeepEqual(*s, spec)
|
||||
}
|
||||
|
||||
type ContainerSpec struct {
|
||||
Command []string
|
||||
Image string
|
||||
|
||||
Reference in New Issue
Block a user