From 669c47c4edc465f7e65c77ac517dd10da829bae0 Mon Sep 17 00:00:00 2001 From: Peter Rifel Date: Fri, 22 Aug 2025 20:25:23 -0500 Subject: [PATCH] Simplify boolean returns --- upup/pkg/fi/cloudup/openstack/instance.go | 5 +---- upup/pkg/fi/cloudup/template_functions.go | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/upup/pkg/fi/cloudup/openstack/instance.go b/upup/pkg/fi/cloudup/openstack/instance.go index 36c051229b..492cb7571f 100644 --- a/upup/pkg/fi/cloudup/openstack/instance.go +++ b/upup/pkg/fi/cloudup/openstack/instance.go @@ -66,10 +66,7 @@ func (c *openstackCloud) CreateInstance(opt servers.CreateOptsBuilder, scheduler } func IsPortInUse(err error) bool { - if gophercloud.ResponseCodeIs(err, http.StatusConflict) { - return true - } - return false + return gophercloud.ResponseCodeIs(err, http.StatusConflict) } // waitForStatusActive uses gopherclouds WaitFor() func to determine when the server becomes "ACTIVE". diff --git a/upup/pkg/fi/cloudup/template_functions.go b/upup/pkg/fi/cloudup/template_functions.go index 0ae70874b2..43f13cdd98 100644 --- a/upup/pkg/fi/cloudup/template_functions.go +++ b/upup/pkg/fi/cloudup/template_functions.go @@ -131,10 +131,7 @@ func (tf *TemplateFunctions) AddTo(dest template.FuncMap, secretStore fi.SecretS } dest["GossipEnabled"] = func() bool { - if cluster.UsesLegacyGossip() { - return true - } - return false + return cluster.UsesLegacyGossip() } dest["PublishesDNSRecords"] = func() bool { return cluster.PublishesDNSRecords()