From 037a95ed41d82d3db0a9d7d31b5093b65f058188 Mon Sep 17 00:00:00 2001 From: den-rgb Date: Mon, 22 Jul 2024 16:26:06 +0100 Subject: [PATCH] OCM-9617 | feat: adding extra validation to fix panic introduced with httpTokens --- pkg/machinepool/machinepool.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/machinepool/machinepool.go b/pkg/machinepool/machinepool.go index e61a61f1c7..6bc3b2f82f 100644 --- a/pkg/machinepool/machinepool.go +++ b/pkg/machinepool/machinepool.go @@ -955,12 +955,10 @@ func (m *machinePool) AddNodePool(cmd *cobra.Command, clusterKey string, cluster return fmt.Errorf("Expected a valid http tokens value : %v", err) } } + if err = ocm.ValidateHttpTokensValue(httpTokens); err != nil { return fmt.Errorf("Expected a valid http tokens value : %v", err) } - if err := ocm.ValidateHttpTokensVersion(ocm.GetVersionMinor(version), httpTokens); err != nil { - return fmt.Errorf(err.Error()) - } npBuilder.AWSNodePool(createAwsNodePoolBuilder(instanceType, securityGroupIds, httpTokens, awsTags))