diff --git a/cmd/gateway_validate.go b/cmd/gateway_validate.go index 7999da537..d3f394bcb 100644 --- a/cmd/gateway_validate.go +++ b/cmd/gateway_validate.go @@ -19,11 +19,11 @@ import ( var ( validateCmdKongStateFile []string validateCmdOnlineEntitiesFilter []string - validateCmdRBACResourcesOnly bool - validateOnline bool - validateWorkspace string - validateParallelism int - validateKonnectCompatibility bool + validateCmdRBACResourcesOnly bool + validateOnline bool + validateKonnectCompatibility bool + validateWorkspace string + validateParallelism int ) func executeValidate(cmd *cobra.Command, _ []string) error { @@ -211,7 +211,7 @@ this command unless --online flag is used. if len(validateCmdKongStateFile) == 0 { validateCmdKongStateFile = []string{"-"} } - + // Iterate over the input values and validate them against the keys in entityMap for _, value := range validateCmdOnlineEntitiesFilter { // Check if the value is valid by comparing it with keys in entityMap @@ -300,11 +300,11 @@ func validateWithKong( return []error{fmt.Errorf("parsing Kong version: %w", err)} } opts := validate.ValidatorOpts{ - Ctx: ctx, - State: ks, - Client: kongClient, - Parallelism: validateParallelism, - RBACResourcesOnly: validateCmdRBACResourcesOnly, + Ctx: ctx, + State: ks, + Client: kongClient, + Parallelism: validateParallelism, + RBACResourcesOnly: validateCmdRBACResourcesOnly, OnlineEntitiesFilter: validateCmdOnlineEntitiesFilter, } validator := validate.NewValidator(opts) diff --git a/validate/validate.go b/validate/validate.go index dce8f0c31..1c1e4e245 100644 --- a/validate/validate.go +++ b/validate/validate.go @@ -158,7 +158,7 @@ func (v *Validator) Validate(formatVersion semver.Version) []error { } // Create a copy of entityMap with only the specififed resources to check online. - filteredEntityMap := make(map[string]string) + filteredEntityMap := make(map[string]string) if len(v.onlineEntitiesFilter) > 0 { for _, value := range v.onlineEntitiesFilter { for key, entityName := range EntityMap {