refactor: deploy global service using Deployment with RollingStrategy

This commit is contained in:
Pavel Sviderski
2025-02-14 20:45:23 +10:00
parent a53fa2c1d8
commit c4398f9f06
7 changed files with 111 additions and 120 deletions
+5
View File
@@ -20,6 +20,11 @@ type Container struct {
types.ContainerJSON
}
// NameWithoutSlash returns the container name without the leading slash.
func (c *Container) NameWithoutSlash() string {
return c.Name[1:]
}
// ServiceID returns the ID of the service this container belongs to.
func (c *Container) ServiceID() string {
return c.Config.Labels[LabelServiceID]
+1 -2
View File
@@ -53,8 +53,7 @@ type ContainerSpec struct {
}
func (s *ContainerSpec) Validate() error {
_, err := reference.ParseDockerRef(s.Image)
if err != nil {
if _, err := reference.ParseDockerRef(s.Image); err != nil {
return fmt.Errorf("invalid image: %w", err)
}