Skip to content

Commit

Permalink
Merge pull request #535 from openinfradev/byok
Browse files Browse the repository at this point in the history
feature. add import api to stacks resource
  • Loading branch information
ktkfree authored Jul 18, 2024
2 parents 1679c30 + eacd1fd commit 2ca311d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/repository/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (r *ClusterRepository) GetByName(ctx context.Context, organizationId string
func (r *ClusterRepository) Create(ctx context.Context, dto model.Cluster) (clusterId domain.ClusterId, err error) {
var cloudAccountId *uuid.UUID
cloudAccountId = dto.CloudAccountId
if dto.CloudService == domain.CloudService_BYOH || *dto.CloudAccountId == uuid.Nil {
if dto.CloudService == domain.CloudService_BYOH || dto.CloudService == domain.CloudService_BYOK || *dto.CloudAccountId == uuid.Nil {
cloudAccountId = nil
}
if dto.ID == "" {
Expand Down
2 changes: 1 addition & 1 deletion internal/usecase/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ func (u *StackUsecase) Import(ctx context.Context, dto model.Stack) (stackId dom
"base_repo_branch=" + viper.GetString("revision"),
"policy_ids=" + strings.Join(dto.PolicyIds, ","),
"cluster_domains=" + strings.Join(domains, ","),
"kubeconfig=" + dto.Kubeconfig,
"kubeconfig_string=" + dto.Kubeconfig,
},
})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/domain/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ type ClusterSiteValuesResponse struct {
TksUserNodeType string `json:"tksUserNodeType,omitempty"`
ByoClusterEndpointHost string `json:"byoClusterEndpointHost"`
ByoClusterEndpointPort int `json:"byoClusterEndpointPort"`
Domains []ClusterDomain `json:"domains,omitempty"`
Domains []ClusterDomain `json:"domains"`
}

type GetClustersResponse struct {
Expand Down

0 comments on commit 2ca311d

Please sign in to comment.