Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <[email protected]>
  • Loading branch information
pingsutw committed Oct 17, 2023
1 parent 8bbcd21 commit c6fbc6b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion flytestdlib/resolver/k8s_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func parseResolverTarget(target resolver.Target) (targetInfo, error) {
}, nil
}

// Build creates a new resolver for the given target, e.g. kubernetes:///flyteagent:flyte:8000.
// Build creates a new resolver for the given target, e.g. k8s:///flyteagent:flyte:8000.
func (b *kubeBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error) {
ti, err := parseResolverTarget(target)
if err != nil {
Expand Down
64 changes: 32 additions & 32 deletions flytestdlib/resolver/k8s_resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,22 +105,22 @@ func TestParseResolverTargets(t *testing.T) {
err bool
}{
{"", targetInfo{}, true},
{"kubernetes:///", targetInfo{}, true},
{"kubernetes://a:30", targetInfo{"a", "", "30"}, false},
{"kubernetes://a/", targetInfo{"a", "", ""}, false},
{"kubernetes:///a", targetInfo{"a", "", ""}, false},
{"kubernetes://a/b", targetInfo{"b", "a", ""}, false},
{"kubernetes://a.b/", targetInfo{"a", "b", ""}, false},
{"kubernetes:///a.b:80", targetInfo{"a", "b", "80"}, false},
{"kubernetes:///a.b:port", targetInfo{"a", "b", "port"}, false},
{"kubernetes:///a:port", targetInfo{"a", "", "port"}, false},
{"kubernetes://x/a:port", targetInfo{"a", "x", "port"}, false},
{"kubernetes://a.x:30/", targetInfo{"a", "x", "30"}, false},
{"kubernetes://a.b.svc.cluster.local", targetInfo{"a", "b", ""}, false},
{"kubernetes://a.b.svc.cluster.local:80", targetInfo{"a", "b", "80"}, false},
{"kubernetes:///a.b.svc.cluster.local", targetInfo{"a", "b", ""}, false},
{"kubernetes:///a.b.svc.cluster.local:80", targetInfo{"a", "b", "80"}, false},
{"kubernetes:///a.b.svc.cluster.local:port", targetInfo{"a", "b", "port"}, false},
{"k8s:///", targetInfo{}, true},
{"k8s://a:30", targetInfo{"a", "", "30"}, false},
{"k8s://a/", targetInfo{"a", "", ""}, false},
{"k8s:///a", targetInfo{"a", "", ""}, false},
{"k8s://a/b", targetInfo{"b", "a", ""}, false},
{"k8s://a.b/", targetInfo{"a", "b", ""}, false},
{"k8s:///a.b:80", targetInfo{"a", "b", "80"}, false},
{"k8s:///a.b:port", targetInfo{"a", "b", "port"}, false},
{"k8s:///a:port", targetInfo{"a", "", "port"}, false},
{"k8s://x/a:port", targetInfo{"a", "x", "port"}, false},
{"k8s://a.x:30/", targetInfo{"a", "x", "30"}, false},
{"k8s://a.b.svc.cluster.local", targetInfo{"a", "b", ""}, false},
{"k8s://a.b.svc.cluster.local:80", targetInfo{"a", "b", "80"}, false},
{"k8s:///a.b.svc.cluster.local", targetInfo{"a", "b", ""}, false},
{"k8s:///a.b.svc.cluster.local:80", targetInfo{"a", "b", "80"}, false},
{"k8s:///a.b.svc.cluster.local:port", targetInfo{"a", "b", "port"}, false},
} {
got, err := parseResolverTarget(parseTarget(test.target))
if err == nil && test.err {
Expand All @@ -144,22 +144,22 @@ func TestParseTargets(t *testing.T) {
err bool
}{
{"", targetInfo{}, true},
{"kubernetes:///", targetInfo{}, true},
{"kubernetes://a:30", targetInfo{"a", "", "30"}, false},
{"kubernetes://a/", targetInfo{"a", "", ""}, false},
{"kubernetes:///a", targetInfo{"a", "", ""}, false},
{"kubernetes://a/b", targetInfo{"b", "a", ""}, false},
{"kubernetes://a.b/", targetInfo{"a", "b", ""}, false},
{"kubernetes:///a.b:80", targetInfo{"a", "b", "80"}, false},
{"kubernetes:///a.b:port", targetInfo{"a", "b", "port"}, false},
{"kubernetes:///a:port", targetInfo{"a", "", "port"}, false},
{"kubernetes://x/a:port", targetInfo{"a", "x", "port"}, false},
{"kubernetes://a.x:30/", targetInfo{"a", "x", "30"}, false},
{"kubernetes://a.b.svc.cluster.local", targetInfo{"a", "b", ""}, false},
{"kubernetes://a.b.svc.cluster.local:80", targetInfo{"a", "b", "80"}, false},
{"kubernetes:///a.b.svc.cluster.local", targetInfo{"a", "b", ""}, false},
{"kubernetes:///a.b.svc.cluster.local:80", targetInfo{"a", "b", "80"}, false},
{"kubernetes:///a.b.svc.cluster.local:port", targetInfo{"a", "b", "port"}, false},
{"k8s:///", targetInfo{}, true},
{"k8s://a:30", targetInfo{"a", "", "30"}, false},
{"k8s://a/", targetInfo{"a", "", ""}, false},
{"k8s:///a", targetInfo{"a", "", ""}, false},
{"k8s://a/b", targetInfo{"b", "a", ""}, false},
{"k8s://a.b/", targetInfo{"a", "b", ""}, false},
{"k8s:///a.b:80", targetInfo{"a", "b", "80"}, false},
{"k8s:///a.b:port", targetInfo{"a", "b", "port"}, false},
{"k8s:///a:port", targetInfo{"a", "", "port"}, false},
{"k8s://x/a:port", targetInfo{"a", "x", "port"}, false},
{"k8s://a.x:30/", targetInfo{"a", "x", "30"}, false},
{"k8s://a.b.svc.cluster.local", targetInfo{"a", "b", ""}, false},
{"k8s://a.b.svc.cluster.local:80", targetInfo{"a", "b", "80"}, false},
{"k8s:///a.b.svc.cluster.local", targetInfo{"a", "b", ""}, false},
{"k8s:///a.b.svc.cluster.local:80", targetInfo{"a", "b", "80"}, false},
{"k8s:///a.b.svc.cluster.local:port", targetInfo{"a", "b", "port"}, false},
} {
got, err := parseResolverTarget(parseTarget(test.target))
if err == nil && test.err {
Expand Down

0 comments on commit c6fbc6b

Please sign in to comment.