Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
anil-intelops committed Aug 19, 2023
1 parent 908e612 commit dab0a04
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
1 change: 1 addition & 0 deletions server/pkg/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

const (
organizationIDAttribute = "organizationid"
clusterIDAttribute = "organizationid"
)

type Server struct {
Expand Down
25 changes: 20 additions & 5 deletions server/pkg/api/store_apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,7 @@ func (s *Server) GetStoreAppValues(ctx context.Context, request *serverpb.GetSto
PrivilegedNamespace: config.PrivilegedNamespace,
Icon: config.Icon,
LaunchURL: config.LaunchUIURL,
// LaunchRedirectURL: config.LaunchUIRedirectURL,
ReleaseName: config.ReleaseName,
ReleaseName: config.ReleaseName,
}

return &serverpb.GetStoreAppValuesResponse{
Expand All @@ -252,8 +251,25 @@ func (s *Server) DeployStoreApp(ctx context.Context, request *serverpb.DeploySto
}, nil
}

orgId := "996162a1-1df7-44b7-8347-1cb1acc70688"
clusterId := "32e49adc-3c3f-11ee-84d2-1e155663be11"
metadataMap := metadataContextToMap(ctx)
orgId := metadataMap[organizationIDAttribute]
if orgId == "" {
s.log.Errorf("organization ID is missing in the request")
return &serverpb.DeployStoreAppResponse{
Status: serverpb.StatusCode_INTERNRAL_ERROR,
StatusMessage: "Organization Id is missing",
}, nil
}
clusterId := metadataMap[clusterIDAttribute]
if orgId == "" {
s.log.Errorf("cluster Id is missing in the request")
return &serverpb.DeployStoreAppResponse{
Status: serverpb.StatusCode_INTERNRAL_ERROR,
StatusMessage: "cluster Id is missing",
}, nil

}

agnetHandler := agent.NewAgentHandler(s.log, s.serverStore, s.oryClient)
agent, err := agnetHandler.GetAgent(orgId, clusterId)
if err != nil {
Expand All @@ -279,7 +295,6 @@ func (s *Server) DeployStoreApp(ctx context.Context, request *serverpb.DeploySto
PrivilegedNamespace: request.AppConfig.PrivilegedNamespace,
Icon: []byte(request.AppConfig.Icon),
LaunchURL: request.AppConfig.LaunchURL,
// LaunchRedirectURL: request.AppConfig.LaunchRedirectURL,
},
}

Expand Down

0 comments on commit dab0a04

Please sign in to comment.