diff --git a/pkg/aws/ec2helpers.go b/pkg/aws/ec2helpers.go index b3df80af..a2c1ccc5 100644 --- a/pkg/aws/ec2helpers.go +++ b/pkg/aws/ec2helpers.go @@ -19,7 +19,6 @@ limitations under the License. package aws import ( - "fmt" "strings" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -41,7 +40,7 @@ func ec2Tag(key, value string) types.Tag { } func ec2FilterByTag(tag types.Tag) types.Filter { - return ec2Filter(fmt.Sprintf("tag:%s", *tag.Key), *tag.Value) + return ec2Filter("tag:"+*tag.Key, *tag.Value) } func hasTag(tags []types.Tag, desired types.Tag) bool { diff --git a/pkg/aws/errors.go b/pkg/aws/errors.go index 73c60f59..6a6dd85f 100644 --- a/pkg/aws/errors.go +++ b/pkg/aws/errors.go @@ -30,7 +30,7 @@ type notFoundError struct { } func (e notFoundError) Error() string { - return fmt.Sprintf("%s not found", e.s) + return e.s + " not found" } func newNotFoundError(msg string, args ...interface{}) error { diff --git a/pkg/aws/securitygroups.go b/pkg/aws/securitygroups.go index 0edfe079..472f4c13 100644 --- a/pkg/aws/securitygroups.go +++ b/pkg/aws/securitygroups.go @@ -20,7 +20,6 @@ package aws import ( "context" - "fmt" "strings" "time" @@ -145,19 +144,19 @@ func (ac *awsCloud) allowPortInCluster(vpcID string, port uint16, protocol strin } } - err = ac.createClusterSGRule(workerGroupID, workerGroupID, port, protocol, fmt.Sprintf("%s between the workers", internalTraffic)) + err = ac.createClusterSGRule(workerGroupID, workerGroupID, port, protocol, internalTraffic+" between the workers") if err != nil { return err } err = ac.createClusterSGRule(workerGroupID, controlPlaneGroupID, port, protocol, - fmt.Sprintf("%s from worker to control plane nodes", internalTraffic)) + internalTraffic+" from worker to control plane nodes") if err != nil { return err } return ac.createClusterSGRule(controlPlaneGroupID, workerGroupID, port, protocol, - fmt.Sprintf("%s from control plane to worker nodes", internalTraffic)) + internalTraffic+" from control plane to worker nodes") } func (ac *awsCloud) createPublicSGRule(groupID *string, port uint16, protocol, description string) error { diff --git a/pkg/gcp/firewall_rules.go b/pkg/gcp/firewall_rules.go index 8a2ae71c..93d82f5b 100644 --- a/pkg/gcp/firewall_rules.go +++ b/pkg/gcp/firewall_rules.go @@ -52,12 +52,12 @@ func newInternalFirewallRule(projectID, infraID string, ports []api.PortSpec) *c rule := newFirewallRule(projectID, infraID, ingressName, ingressDirection, ports) rule.TargetTags = []string{ - fmt.Sprintf("%s-worker", infraID), - fmt.Sprintf("%s-master", infraID), + infraID + "-worker", + infraID + "-master", } rule.SourceTags = []string{ - fmt.Sprintf("%s-worker", infraID), - fmt.Sprintf("%s-master", infraID), + infraID + "-worker", + infraID + "-master", } return rule