forked from flyteorg/flyte
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add API to get domain (flyteorg#5443)
Signed-off-by: zychen5186 <[email protected]>
- Loading branch information
1 parent
717cc6c
commit f054d6b
Showing
30 changed files
with
1,844 additions
and
701 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package ext | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" | ||
) | ||
|
||
func (a *AdminFetcherExtClient) GetDomains(ctx context.Context) (*admin.GetDomainsResponse, error) { | ||
domains, err := a.AdminServiceClient().GetDomains(ctx, &admin.GetDomainRequest{}) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return domains, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package ext | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/flyteorg/flyte/flyteidl/clients/go/admin/mocks" | ||
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" | ||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/mock" | ||
) | ||
|
||
func TestAdminFetcherExtClient_GetDomains(t *testing.T) { | ||
domain1 := &admin.Domain{ | ||
Id: "development", | ||
Name: "development", | ||
} | ||
domain2 := &admin.Domain{ | ||
Id: "staging", | ||
Name: "staging", | ||
} | ||
domain3 := &admin.Domain{ | ||
Id: "production", | ||
Name: "production", | ||
} | ||
domains := &admin.GetDomainsResponse{ | ||
Domains: []*admin.Domain{domain1, domain2, domain3}, | ||
} | ||
|
||
adminClient := new(mocks.AdminServiceClient) | ||
adminFetcherExt := AdminFetcherExtClient{AdminClient: adminClient} | ||
|
||
adminClient.OnGetDomainsMatch(mock.Anything, mock.Anything).Return(domains, nil) | ||
_, err := adminFetcherExt.GetDomains(ctx) | ||
assert.Nil(t, err) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.