Commit f072f11c authored by Yannik Dällenbach's avatar Yannik Dällenbach 🤼 Committed by Yannik Dällenbach
Browse files

Refactor `TagMap` creation into own method

parent e856dc4b
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -26,6 +26,10 @@ type instanceGroup struct {
	authorizedKey []byte
}

func (*instanceGroup) tagMap() cloudscale.TagMap {
	return cloudscale.TagMap{"fleeting": "true"}
}

// Check if interface `InstanceGroup` is implemented.
var _ provider.InstanceGroup = (*instanceGroup)(nil)

@@ -72,7 +76,7 @@ func (g *instanceGroup) Increase(ctx context.Context, delta int) (succeeded int,
	servers := make([]*cloudscale.Server, 0, delta)
	errs := make([]error, 0)

	tagMap := cloudscale.TagMap{"fleeting": "true"}
	tagMap := g.tagMap()

	for range delta {
		serverName := strings.ToLower(rand.Text()[:5])