Skip to content

Commit

Permalink
fix(service): prevent image update flag from affecting service hash
Browse files Browse the repository at this point in the history
  • Loading branch information
yarlson committed Jan 20, 2025
1 parent 2707202 commit 6bd17c7
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
4 changes: 3 additions & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,9 @@ func extractNamedVolume(volRef string) string {
}

func (s *Service) Hash() (string, error) {
sortedService := s.sortServiceFields()
service := *s
service.ImageUpdated = false
sortedService := service.sortServiceFields()
bytes, err := json.Marshal(sortedService)
if err != nil {
return "", fmt.Errorf("failed to marshal sorted service: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/deployment/dependency.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ func (d *Deployment) startDependency(project string, dependency *config.Dependen
}

return nil
}
}
3 changes: 2 additions & 1 deletion pkg/deployment/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package deployment
import (
"context"
"fmt"
"github.com/yarlson/ftl/pkg/runner/local"
"io"
"path/filepath"
"strings"

"github.com/yarlson/ftl/pkg/runner/local"

"github.com/yarlson/ftl/pkg/config"
"github.com/yarlson/ftl/pkg/console"
)
Expand Down
3 changes: 2 additions & 1 deletion pkg/deployment/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package deployment
import (
"context"
"fmt"
"github.com/yarlson/ftl/pkg/config"
"strings"
"sync"
"time"

"github.com/yarlson/ftl/pkg/config"
)

func (d *Deployment) deployServices(ctx context.Context, project string, services []config.Service) error {
Expand Down
2 changes: 1 addition & 1 deletion pkg/deployment/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ func (d *Deployment) createVolume(ctx context.Context, project, volume string) e
}

return nil
}
}
3 changes: 2 additions & 1 deletion pkg/tunnel/tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package tunnel
import (
"context"
"fmt"
"github.com/yarlson/ftl/pkg/config"
"sync"
"time"

"github.com/yarlson/ftl/pkg/config"

"github.com/yarlson/ftl/pkg/ssh"
)

Expand Down

0 comments on commit 6bd17c7

Please sign in to comment.