Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineJac committed Nov 28, 2024
1 parent c077ab7 commit 2c22772
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions cmd/gateway_validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,23 +212,21 @@ this command unless --online flag is used.
validateCmdKongStateFile = []string{"-"}
}

if validateCmdOnlineEntitiesFilter != nil {
// 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
isValid := false
for key := range validate.EntityMap {
if value == key {
isValid = true
break
}
// 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
isValid := false
for key := range validate.EntityMap {
if value == key {
isValid = true
break
}
}

if !isValid {
// Generate an error message stating that the value should be part of Kong entities
return fmt.Errorf("invalid value '%s' for --check-online-plugins-only; it should be a valid Kong entity",
value)
}
if !isValid {
// Generate an error message stating that the value should be part of Kong entities
return fmt.Errorf("invalid value '%s' for --check-online-plugins-only; it should be a valid Kong entity",
value)
}
}
return preRunSilenceEventsFlag()
Expand Down

0 comments on commit 2c22772

Please sign in to comment.