Skip to content

Commit 3087e4d

Browse files
fix lint
Signed-off-by: Jintao Zhang <[email protected]>
1 parent 6c7403d commit 3087e4d

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

test/conformance/suite_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"github.com/kong/kong-operator/modules/manager/scheme"
2323
testutils "github.com/kong/kong-operator/pkg/utils/test"
2424
"github.com/kong/kong-operator/test"
25-
"github.com/kong/kong-operator/test/helpers"
25+
inthelpers "github.com/kong/kong-operator/test/integration/helpers"
2626
)
2727

2828
// -----------------------------------------------------------------------------
@@ -104,11 +104,11 @@ func TestMain(m *testing.M) {
104104
exitOnErr(testutils.DeployCRDs(ctx, path.Join(configPath, "/crd"), clients.OperatorClient, env.Cluster()))
105105
}
106106

107-
cleanupTelepresence, err := helpers.SetupTelepresence(ctx)
107+
cleanupTelepresence, err := inthelpers.SetupTelepresence(ctx)
108108
exitOnErr(err)
109109
defer cleanupTelepresence()
110110

111-
cleanupIntercept, err := helpers.SetupNetworkIntercepts(ctx, clients)
111+
cleanupIntercept, err := inthelpers.SetupNetworkIntercepts(ctx, clients)
112112
exitOnErr(err)
113113
defer cleanupIntercept()
114114

test/helpers/network_intercept.go renamed to test/integration/helpers/network_intercept.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ func applyTelepresenceEnvFile(path string) error {
298298
if line == "" || strings.HasPrefix(line, "#") {
299299
continue
300300
}
301-
if strings.HasPrefix(line, "export ") {
302-
line = strings.TrimSpace(strings.TrimPrefix(line, "export "))
301+
if after, ok := strings.CutPrefix(line, "export "); ok {
302+
line = strings.TrimSpace(after)
303303
}
304304
key, value, found := strings.Cut(line, "=")
305305
if !found || key == "" {
@@ -344,7 +344,7 @@ func writePodLabelsOverride(labels map[string]string) (string, error) {
344344
lines = append(lines, fmt.Sprintf("%s=%q", key, labels[key]))
345345
}
346346

347-
if err := os.WriteFile(file.Name(), []byte(strings.Join(lines, "\n")), 0o644); err != nil {
347+
if err := os.WriteFile(file.Name(), []byte(strings.Join(lines, "\n")), 0o600); err != nil {
348348
return "", fmt.Errorf("failed to write pod labels temp file: %w", err)
349349
}
350350
return file.Name(), nil
File renamed without changes.

test/integration/suite_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
testutils "github.com/kong/kong-operator/pkg/utils/test"
2424
"github.com/kong/kong-operator/test"
2525
"github.com/kong/kong-operator/test/helpers"
26+
inthelpers "github.com/kong/kong-operator/test/integration/helpers"
2627
)
2728

2829
// -----------------------------------------------------------------------------
@@ -129,11 +130,11 @@ func TestMain(m *testing.M) {
129130
exitOnErr(testutils.DeployCRDs(GetCtx(), path.Join(configPath, "/crd"), GetClients().OperatorClient, GetEnv().Cluster()))
130131
}
131132

132-
cleanupTelepresence, err := helpers.SetupTelepresence(ctx)
133+
cleanupTelepresence, err := inthelpers.SetupTelepresence(ctx)
133134
exitOnErr(err)
134135
defer cleanupTelepresence()
135136

136-
cleanupIntercept, err := helpers.SetupNetworkIntercepts(ctx, GetClients())
137+
cleanupIntercept, err := inthelpers.SetupNetworkIntercepts(ctx, GetClients())
137138
exitOnErr(err)
138139
defer cleanupIntercept()
139140

0 commit comments

Comments
 (0)