newdeploy executor to work with specific namespaces (#2590)

This commit is contained in:
Shubham Bansal
2022-10-31 12:55:57 +05:30
committed by GitHub
parent a64fcc3faf
commit 9ff9a6e075
@@ -778,15 +778,17 @@ func (deploy *NewDeploy) idleObjectReaper(ctx context.Context) {
}
func (deploy *NewDeploy) doIdleObjectReaper(ctx context.Context) {
envs, err := deploy.fissionClient.CoreV1().Environments(metav1.NamespaceAll).List(ctx, metav1.ListOptions{})
envList := make(map[k8sTypes.UID]struct{})
for _, namespace := range utils.GetNamespaces() {
envs, err := deploy.fissionClient.CoreV1().Environments(namespace).List(ctx, metav1.ListOptions{})
if err != nil {
deploy.logger.Fatal("failed to get environment list", zap.Error(err))
deploy.logger.Fatal("failed to get environment list", zap.Error(err), zap.String("namespace", namespace))
}
envList := make(map[k8sTypes.UID]struct{})
for _, env := range envs.Items {
envList[env.ObjectMeta.UID] = struct{}{}
}
}
funcSvcs, err := deploy.fsCache.ListOld(time.Second * 5)
if err != nil {