optimize code (#1694)
* fix something Signed-off-by: lijianxin <1430473452@qq.com>
This commit is contained in:
parent
224e0f6c6a
commit
b6ad96f105
|
|
@ -6,6 +6,7 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"regexp"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"github.com/helmfile/helmfile/pkg/runtime"
|
||||
|
|
@ -34,7 +35,7 @@ func forbidEnvironmentsWithReleases(filePath string, content []byte) (bool, erro
|
|||
result := []string{}
|
||||
resultKeys := map[string]interface{}{}
|
||||
for _, k := range topKeys {
|
||||
if k == "environments" || k == "releases" || k == "---" {
|
||||
if slices.Contains([]string{"environments", "releases", "---"}, k) {
|
||||
if _, ok := resultKeys[k]; !ok {
|
||||
result = append(result, k)
|
||||
if k != "---" {
|
||||
|
|
|
|||
Loading…
Reference in New Issue