Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions pkg/appStore/deployment/service/InstalledAppService.go
Original file line number Diff line number Diff line change
Expand Up @@ -1118,17 +1118,17 @@ func (impl InstalledAppServiceImpl) FetchResourceTreeWithHibernateForACD(rctx co
func checkHibernate(impl InstalledAppServiceImpl, resp *bean2.AppDetailContainer, ctx context.Context) map[string]interface{} {

responseTree := resp.ResourceTree
deploymentAppName := resp.AppName + "-" + resp.EnvironmentName

for _, node := range responseTree["nodes"].(interface{}).([]interface{}) {
currNode := node.(interface{}).(map[string]interface{})
name := resp.AppName + "-" + resp.Namespace
resName := util3.InterfaceToString(currNode["name"])
resKind := util3.InterfaceToString(currNode["kind"])
resGroup := util3.InterfaceToString(currNode["group"])
resVersion := util3.InterfaceToString(currNode["version"])
resNamespace := util3.InterfaceToString(currNode["namespace"])
rQuery := &application.ApplicationResourceRequest{
Name: &name,
Name: &deploymentAppName,
ResourceName: &resName,
Kind: &resKind,
Group: &resGroup,
Expand All @@ -1137,11 +1137,11 @@ func checkHibernate(impl InstalledAppServiceImpl, resp *bean2.AppDetailContainer
}
ctx, _ := context.WithTimeout(ctx, 60*time.Second)
if currNode["parentRefs"] == nil {

t0 := time.Now()
res, err := impl.acdClient.GetResource(ctx, rQuery)
if err != nil {
impl.logger.Errorw("GRPC_GET_RESOURCE", "data", res, "timeTaken", time.Since(time.Now()), "err", err)
return responseTree
impl.logger.Errorw("error getting response from acdClient", "request", rQuery, "data", res, "timeTaken", time.Since(t0), "err", err)
continue
}
if res.Manifest != nil {
manifest, _ := gjson.Parse(*res.Manifest).Value().(map[string]interface{})
Expand All @@ -1161,9 +1161,6 @@ func checkHibernate(impl InstalledAppServiceImpl, resp *bean2.AppDetailContainer

}

if err != nil {
impl.logger.Errorw("GRPC_GET_RESOURCE", "data", res, "timeTaken", time.Since(time.Now()), "err", err)
}
}
node = currNode
}
Expand Down
1 change: 1 addition & 0 deletions pkg/user/casbin/rbac.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ func (e *EnforcerImpl) enforceByEmailInBatchSync(wg *sync.WaitGroup, mutex *sync
}

func (e *EnforcerImpl) EnforceByEmailInBatch(emailId string, resource string, action string, vals []string) map[string]bool {
emailId = strings.ToLower(emailId)
var totalTimeGap int64 = 0
var maxTimegap int64 = 0
var minTimegap int64 = math.MaxInt64
Expand Down