Skip to content

Commit

Permalink
bug: fail fast with Ubuntu 22.04 clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarpicas committed Feb 1, 2023
1 parent ae9bded commit f719f53
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions lib/backend/resources/operations/clustertasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,17 +183,34 @@ func (instance *Cluster) taskCreateCluster(inctx context.Context, params interfa
if req.Flavor == clusterflavor.K8S {
lowerOS := strings.ToLower(req.GatewaysDef.Image)
if strings.Contains(lowerOS, "centos 7") {
return nil, fail.NewError("K8s with CentOS 7 not supported")
return nil, fail.NewError("Sorry, K8s with CentOS 7 not supported")
}

lowerOS = strings.ToLower(req.MastersDef.Image)
if strings.Contains(lowerOS, "centos 7") {
return nil, fail.NewError("K8s with CentOS 7 not supported")
return nil, fail.NewError("Sorry, K8s with CentOS 7 not supported")
}

lowerOS = strings.ToLower(req.NodesDef.Image)
if strings.Contains(lowerOS, "centos 7") {
return nil, fail.NewError("K8s with CentOS 7 not supported")
return nil, fail.NewError("Sorry, K8s with CentOS 7 not supported")
}
}

if req.Flavor != 0 {
lowerOS := strings.ToLower(req.GatewaysDef.Image)
if strings.Contains(lowerOS, "ubuntu 22.04") {
return nil, fail.NewError("Sorry, Ubuntu 22.04 not supported")
}

lowerOS = strings.ToLower(req.MastersDef.Image)
if strings.Contains(lowerOS, "ubuntu 22.04") {
return nil, fail.NewError("Sorry, Ubuntu 22.04 not supported")
}

lowerOS = strings.ToLower(req.NodesDef.Image)
if strings.Contains(lowerOS, "ubuntu 22.04") {
return nil, fail.NewError("Sorry, Ubuntu 22.04 not supported")
}
}

Expand Down

0 comments on commit f719f53

Please sign in to comment.