mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-06 13:18:58 +00:00
fix: check latest Caddy image only if not specified for 'uc caddy deploy'
This commit is contained in:
1 parent
11c2e641f1
commit
e35e69b4be
2 files changed
+14
-12
No files matched your search
+5
-5
@@ -24,12 +24,12 @@ var caddyImageTagRegex = regexp.MustCompile(`^2\.\d+\.\d+$`)
|
||||
// The service is deployed in global mode to all machines in the cluster. If the image is not provided, the latest
|
||||
// version of the official Caddy Docker image is used.
|
||||
func (cli *Client) NewCaddyDeployment(image string, placement api.Placement) (*deploy.Deployment, error) {
|
||||
latest, err := LatestCaddyImage()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("look up latest Caddy image: %w", err)
|
||||
}
|
||||
|
||||
if image == "" {
|
||||
latest, err := LatestCaddyImage()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("look up latest Caddy image: %w", err)
|
||||
}
|
||||
|
||||
image = reference.FamiliarString(latest)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user