From 579cbbbef4b2611582d4a580c7ff031c1388bb00 Mon Sep 17 00:00:00 2001 From: Jooseppi Luna Date: Mon, 12 Feb 2024 13:58:58 -0500 Subject: [PATCH 01/26] actions --- .github/workflows/actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 004110707..2e3d20c34 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -1,7 +1,7 @@ name: Workflow on: push: - branches: [ main ] + branches: [ auth-proxy-status-fix ] pull_request: branches: [ '**' ] jobs: From 204ad552d494d2626a4397d6deeba67b50afa77f Mon Sep 17 00:00:00 2001 From: Jooseppi Luna Date: Mon, 12 Feb 2024 22:09:03 -0500 Subject: [PATCH 02/26] working on auth proxy status check --- controllers/csm_controller.go | 2 +- pkg/utils/status.go | 88 +++++++++++++++++++++++++++++++++-- 2 files changed, 85 insertions(+), 5 deletions(-) diff --git a/controllers/csm_controller.go b/controllers/csm_controller.go index 55a986799..6d40b93fa 100644 --- a/controllers/csm_controller.go +++ b/controllers/csm_controller.go @@ -1194,7 +1194,7 @@ func (r *ContainerStorageModuleReconciler) removeDriver(ctx context.Context, ins return nil } -// removeModule - remove authorization proxy server +// removeModule - remove standalone modules func (r *ContainerStorageModuleReconciler) removeModule(ctx context.Context, instance csmv1.ContainerStorageModule, operatorConfig utils.OperatorConfig, ctrlClient client.Client) error { log := logger.GetLogger(ctx) diff --git a/pkg/utils/status.go b/pkg/utils/status.go index 8d12b007a..ef7053a1c 100644 --- a/pkg/utils/status.go +++ b/pkg/utils/status.go @@ -41,6 +41,7 @@ var dMutex sync.RWMutex var checkModuleStatus = map[csmv1.ModuleType]func(context.Context, *csmv1.ContainerStorageModule, ReconcileCSM, *csmv1.ContainerStorageModuleStatus) (bool, error){ csmv1.Observability: observabilityStatusCheck, csmv1.ApplicationMobility: appMobStatusCheck, + csmv1.AuthorizationServer: authProxyStatusCheck, } func getInt32(pointer *int32) int32 { @@ -804,9 +805,8 @@ func observabilityStatusCheck(ctx context.Context, instance *csmv1.ContainerStor } } - namespace := "karavi" opts := []client.ListOption{ - client.InNamespace(namespace), + client.InNamespace(ObservabilityNamespace), } deploymentList := &appsv1.DeploymentList{} err := r.GetClient().List(ctx, deploymentList, opts...) @@ -825,11 +825,11 @@ func observabilityStatusCheck(ctx context.Context, instance *csmv1.ContainerStor if otelEnabled { otelRunning = checkFn(&deployment) } - case fmt.Sprintf("%s-metrics-%s", namespace, instance.Spec.Driver.CSIDriverType): + case fmt.Sprintf("%s-metrics-%s", ObservabilityNamespace, instance.Spec.Driver.CSIDriverType): if metricsEnabled { metricsRunning = checkFn(&deployment) } - case fmt.Sprintf("%s-topology", namespace): + case fmt.Sprintf("%s-topology", ObservabilityNamespace): if topologyEnabled { topologyRunning = checkFn(&deployment) } @@ -891,3 +891,83 @@ func observabilityStatusCheck(ctx context.Context, instance *csmv1.ContainerStor return false, nil } + +// authProxyStatusCheck - calculate success state for auth proxy +func authProxyStatusCheck(ctx context.Context, instance *csmv1.ContainerStorageModule, r ReconcileCSM, _ *csmv1.ContainerStorageModuleStatus) (bool, error) { + + certEnabled := false + nginxEnabled := false + certManagerRunning := false + certManagerCainInjectorRunning := false + certManagerWebhookRunning := false + nginxRunning := false + + for _, m := range instance.Spec.Modules { + if m.Name == csmv1.Observability { + for _, c := range m.Components { + if c.Name == "ingress-nginx" && *c.Enabled { + nginxEnabled = true + } + if c.Name == "cert-manager" && *c.Enabled { + certEnabled = true + } + } + } + } + + opts := []client.ListOption{ + client.InNamespace(instance.GetNamespace()), + } + deploymentList := &appsv1.DeploymentList{} + err := r.GetClient().List(ctx, deploymentList, opts...) + if err != nil { + return false, err + } + + checkFn := func(deployment *appsv1.Deployment) bool { + return deployment.Status.ReadyReplicas == *deployment.Spec.Replicas + } + +deployment.apps/authorization-ingress-nginx-controller 1/1 1 1 55s +deployment.apps/cert-manager 1/1 1 1 55s +deployment.apps/cert-manager-cainjector 1/1 1 1 55s +deployment.apps/cert-manager-webhook 1/1 1 1 55s +deployment.apps/proxy-server 1/1 1 1 57s +deployment.apps/redis-commander 1/1 1 1 57s +deployment.apps/redis-primary 1/1 1 1 57s +deployment.apps/role-service 1/1 1 1 57s +deployment.apps/storage-service 1/1 1 1 57s +deployment.apps/tenant-service 1/1 1 1 57s + + + for _, deployment := range deploymentList.Items { + deployment := deployment + switch deployment.Name { + case "authorization-ingress-nginx-controller": + if nginxEnabled { + nginxRunning = checkFn(&deployment) + } + case "cert-manager": + if certEnabled { + certManagerRunning = checkFn(&deployment) + } + case "cert-manager-cainjector": + if certEnabled { + certManagerCainInjectorRunning = checkFn(&deployment) + } + case "cert-manager-webhook": + if certEnabled { + certManagerWebhookRunning = checkFn(&deployment) + } + case "proxy-server": + } + } + + certEnabled := false + nginxEnabled := false + certManagerRunning := false + certManagerCainInjectorRunning := false + certManagerWebhookRunning := false + nginxRunning := false + return authRunning && (!certEnabled || (certManagerRunning && certManagerCainInjectorRunning && certManagerWebhookRunning)) && (!nginxEnabled or nginxRunning) +} From c50c068fc02307dbc2d4a7413678bdecf3f3ec53 Mon Sep 17 00:00:00 2001 From: Jooseppi Luna Date: Mon, 12 Feb 2024 22:20:37 -0500 Subject: [PATCH 03/26] finished status check --- pkg/utils/status.go | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/pkg/utils/status.go b/pkg/utils/status.go index ef7053a1c..ca2d24f38 100644 --- a/pkg/utils/status.go +++ b/pkg/utils/status.go @@ -901,6 +901,12 @@ func authProxyStatusCheck(ctx context.Context, instance *csmv1.ContainerStorageM certManagerCainInjectorRunning := false certManagerWebhookRunning := false nginxRunning := false + proxyServerRunning := false + redisCommanderRunning := false + redisPrimaryRunning := false + roleServiceRunning := false + storageServiceRunning := false + tenantServiceRunning := false for _, m := range instance.Spec.Modules { if m.Name == csmv1.Observability { @@ -928,18 +934,6 @@ func authProxyStatusCheck(ctx context.Context, instance *csmv1.ContainerStorageM return deployment.Status.ReadyReplicas == *deployment.Spec.Replicas } -deployment.apps/authorization-ingress-nginx-controller 1/1 1 1 55s -deployment.apps/cert-manager 1/1 1 1 55s -deployment.apps/cert-manager-cainjector 1/1 1 1 55s -deployment.apps/cert-manager-webhook 1/1 1 1 55s -deployment.apps/proxy-server 1/1 1 1 57s -deployment.apps/redis-commander 1/1 1 1 57s -deployment.apps/redis-primary 1/1 1 1 57s -deployment.apps/role-service 1/1 1 1 57s -deployment.apps/storage-service 1/1 1 1 57s -deployment.apps/tenant-service 1/1 1 1 57s - - for _, deployment := range deploymentList.Items { deployment := deployment switch deployment.Name { @@ -960,14 +954,25 @@ deployment.apps/tenant-service 1/1 1 1 certManagerWebhookRunning = checkFn(&deployment) } case "proxy-server": + proxyServerRunning = checkFn(&deployment) + } + case "redis-commander": + redisCommanderRunning = checkFn(&deployment) + } + case "redis-primary": + redisPrimaryRunning = checkFn(&deployment) + } + case "role-service": + roleServiceRunning = checkFn(&deployment) + } + case "storage-service": + storageServiceRunning = checkFn(&deployment) + } + case "tenant-service": + tenantServiceRunning = checkFn(&deployment) } } - certEnabled := false - nginxEnabled := false - certManagerRunning := false - certManagerCainInjectorRunning := false - certManagerWebhookRunning := false - nginxRunning := false - return authRunning && (!certEnabled || (certManagerRunning && certManagerCainInjectorRunning && certManagerWebhookRunning)) && (!nginxEnabled or nginxRunning) + return proxyServerRunning && redisCommanderRunning && redisPrimaryRunning && roleServiceRunning && storageServiceRunning && tenantServiceRunning && + (!certEnabled || (certManagerRunning && certManagerCainInjectorRunning && certManagerWebhookRunning)) && (!nginxEnabled or nginxRunning) } From d4bb334006d816ba9ff646ba615af811a214581f Mon Sep 17 00:00:00 2001 From: Jooseppi Luna Date: Mon, 12 Feb 2024 22:24:57 -0500 Subject: [PATCH 04/26] fix 1 --- pkg/utils/status.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pkg/utils/status.go b/pkg/utils/status.go index ca2d24f38..cbcd7b894 100644 --- a/pkg/utils/status.go +++ b/pkg/utils/status.go @@ -955,22 +955,16 @@ func authProxyStatusCheck(ctx context.Context, instance *csmv1.ContainerStorageM } case "proxy-server": proxyServerRunning = checkFn(&deployment) - } case "redis-commander": redisCommanderRunning = checkFn(&deployment) - } case "redis-primary": redisPrimaryRunning = checkFn(&deployment) - } case "role-service": roleServiceRunning = checkFn(&deployment) - } case "storage-service": storageServiceRunning = checkFn(&deployment) - } case "tenant-service": tenantServiceRunning = checkFn(&deployment) - } } return proxyServerRunning && redisCommanderRunning && redisPrimaryRunning && roleServiceRunning && storageServiceRunning && tenantServiceRunning && From 9e920ba93432cc1d75e8e218f0ad9a8b31223521 Mon Sep 17 00:00:00 2001 From: Jooseppi Luna Date: Mon, 12 Feb 2024 22:26:38 -0500 Subject: [PATCH 05/26] fix or --- pkg/utils/status.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/utils/status.go b/pkg/utils/status.go index cbcd7b894..62f86f5e1 100644 --- a/pkg/utils/status.go +++ b/pkg/utils/status.go @@ -968,5 +968,5 @@ func authProxyStatusCheck(ctx context.Context, instance *csmv1.ContainerStorageM } return proxyServerRunning && redisCommanderRunning && redisPrimaryRunning && roleServiceRunning && storageServiceRunning && tenantServiceRunning && - (!certEnabled || (certManagerRunning && certManagerCainInjectorRunning && certManagerWebhookRunning)) && (!nginxEnabled or nginxRunning) + (!certEnabled || (certManagerRunning && certManagerCainInjectorRunning && certManagerWebhookRunning)) && (!nginxEnabled || nginxRunning) } From 1cf11ebe5ceeeff007223e30c32e055c4bda8d91 Mon Sep 17 00:00:00 2001 From: Jooseppi Luna Date: Mon, 12 Feb 2024 22:34:53 -0500 Subject: [PATCH 06/26] code compiles --- pkg/utils/status.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/utils/status.go b/pkg/utils/status.go index 62f86f5e1..2688ed923 100644 --- a/pkg/utils/status.go +++ b/pkg/utils/status.go @@ -909,7 +909,7 @@ func authProxyStatusCheck(ctx context.Context, instance *csmv1.ContainerStorageM tenantServiceRunning := false for _, m := range instance.Spec.Modules { - if m.Name == csmv1.Observability { + if m.Name == csmv1.AuthorizationServer { for _, c := range m.Components { if c.Name == "ingress-nginx" && *c.Enabled { nginxEnabled = true @@ -965,8 +965,9 @@ func authProxyStatusCheck(ctx context.Context, instance *csmv1.ContainerStorageM storageServiceRunning = checkFn(&deployment) case "tenant-service": tenantServiceRunning = checkFn(&deployment) + } } return proxyServerRunning && redisCommanderRunning && redisPrimaryRunning && roleServiceRunning && storageServiceRunning && tenantServiceRunning && - (!certEnabled || (certManagerRunning && certManagerCainInjectorRunning && certManagerWebhookRunning)) && (!nginxEnabled || nginxRunning) + (!certEnabled || (certManagerRunning && certManagerCainInjectorRunning && certManagerWebhookRunning)) && (!nginxEnabled || nginxRunning), nil } From b7bd55c46f948120b2c817e8850f387446dccb14 Mon Sep 17 00:00:00 2001 From: Jooseppi Luna Date: Mon, 12 Feb 2024 23:18:28 -0500 Subject: [PATCH 07/26] keep auth proxy out of daemonset check --- pkg/utils/status.go | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/pkg/utils/status.go b/pkg/utils/status.go index 2688ed923..d6464ae0c 100644 --- a/pkg/utils/status.go +++ b/pkg/utils/status.go @@ -335,6 +335,7 @@ func calculateState(ctx context.Context, instance *csmv1.ContainerStorageModule, log := logger.GetLogger(ctx) running := true var err error = nil + nodeStatusGood := true // TODO: Currently commented this block of code as the API used to get the latest deployment status is not working as expected // TODO: Can be uncommented once this issues gets sorted out /* controllerReplicas, controllerStatus, controllerErr := getDeploymentStatus(ctx, instance, r) @@ -342,8 +343,21 @@ func calculateState(ctx context.Context, instance *csmv1.ContainerStorageModule, newStatus.ControllerStatus = controllerStatus newStatus.NodeStatus = nodeStatus */ - expected, nodeStatus, daemonSetErr := getDaemonSetStatus(ctx, instance, r) - newStatus.NodeStatus = nodeStatus + // Auth proxy has no daemonset. Putting this if/else in here and setting nodeStatusGood to true by + // default is a little hacky but will be fixed when we refactor the status code in CSM 1.10 or 1.11 + if instance.GetName() != string(csmv1.AuthorizationServer) { + expected, nodeStatus, daemonSetErr := getDaemonSetStatus(ctx, instance, r) + newStatus.NodeStatus = nodeStatus + if daemonSetErr != nil { + err = daemonSetErr + log.Infof("calculate Daemonseterror msg [%s]", daemonSetErr.Error()) + } + + log.Infof("daemonset expected [%d]", expected) + log.Infof("daemonset nodeStatus.Available [%s]", nodeStatus.Available) + nodeStatusGood = (fmt.Sprintf("%d", expected) == nodeStatus.Available) + } + controllerReplicas := newStatus.ControllerStatus.Desired controllerStatus := newStatus.ControllerStatus @@ -351,10 +365,7 @@ func calculateState(ctx context.Context, instance *csmv1.ContainerStorageModule, log.Infof("deployment controllerReplicas [%s]", controllerReplicas) log.Infof("deployment controllerStatus.Available [%s]", controllerStatus.Available) - log.Infof("daemonset expected [%d]", expected) - log.Infof("daemonset nodeStatus.Available [%s]", nodeStatus.Available) - - if (controllerReplicas == controllerStatus.Available) && (fmt.Sprintf("%d", expected) == nodeStatus.Available) { + if (controllerReplicas == controllerStatus.Available) && nodeStatusGood { for _, module := range instance.Spec.Modules { moduleStatus, exists := checkModuleStatus[module.Name] @@ -377,11 +388,6 @@ func calculateState(ctx context.Context, instance *csmv1.ContainerStorageModule, newStatus.State = constants.Failed } - if daemonSetErr != nil { - err = daemonSetErr - log.Infof("calculate Daemonseterror msg [%s]", daemonSetErr.Error()) - } - SetStatus(ctx, r, instance, newStatus) return running, err } @@ -554,6 +560,7 @@ func HandleSuccess(ctx context.Context, instance *csmv1.ContainerStorageModule, log := logger.GetLogger(ctx) running, err := calculateState(ctx, instance, r, newStatus) + log.Info("calculateState returns ", "running", running) if err != nil { log.Error("HandleSuccess Driver status ", "error", err.Error()) newStatus.State = constants.Failed From d477487e43141c939e979c94e345c60cabe07d51 Mon Sep 17 00:00:00 2001 From: Jooseppi Luna Date: Mon, 12 Feb 2024 23:30:41 -0500 Subject: [PATCH 08/26] trying to figure out deployment name --- pkg/utils/status.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/utils/status.go b/pkg/utils/status.go index d6464ae0c..512108029 100644 --- a/pkg/utils/status.go +++ b/pkg/utils/status.go @@ -345,6 +345,7 @@ func calculateState(ctx context.Context, instance *csmv1.ContainerStorageModule, // Auth proxy has no daemonset. Putting this if/else in here and setting nodeStatusGood to true by // default is a little hacky but will be fixed when we refactor the status code in CSM 1.10 or 1.11 + log.Infof("instance.GetName() is %s", instance.GetName()) if instance.GetName() != string(csmv1.AuthorizationServer) { expected, nodeStatus, daemonSetErr := getDaemonSetStatus(ctx, instance, r) newStatus.NodeStatus = nodeStatus From d16a842ec18a8965b8213bddd9ccdf558562dd84 Mon Sep 17 00:00:00 2001 From: Jooseppi Luna Date: Mon, 12 Feb 2024 23:42:12 -0500 Subject: [PATCH 09/26] formatting --- pkg/utils/status.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/utils/status.go b/pkg/utils/status.go index 512108029..04a35c2c2 100644 --- a/pkg/utils/status.go +++ b/pkg/utils/status.go @@ -976,6 +976,6 @@ func authProxyStatusCheck(ctx context.Context, instance *csmv1.ContainerStorageM } } - return proxyServerRunning && redisCommanderRunning && redisPrimaryRunning && roleServiceRunning && storageServiceRunning && tenantServiceRunning && + return proxyServerRunning && redisCommanderRunning && redisPrimaryRunning && roleServiceRunning && storageServiceRunning && tenantServiceRunning && (!certEnabled || (certManagerRunning && certManagerCainInjectorRunning && certManagerWebhookRunning)) && (!nginxEnabled || nginxRunning), nil } From cb0b8c359bdd5bbb2752d7bf6e807b9915331f40 Mon Sep 17 00:00:00 2001 From: Jooseppi Luna Date: Tue, 13 Feb 2024 06:34:53 -0500 Subject: [PATCH 10/26] fix auth name in if condition --- pkg/utils/status.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/utils/status.go b/pkg/utils/status.go index 04a35c2c2..28f2f349e 100644 --- a/pkg/utils/status.go +++ b/pkg/utils/status.go @@ -346,7 +346,7 @@ func calculateState(ctx context.Context, instance *csmv1.ContainerStorageModule, // Auth proxy has no daemonset. Putting this if/else in here and setting nodeStatusGood to true by // default is a little hacky but will be fixed when we refactor the status code in CSM 1.10 or 1.11 log.Infof("instance.GetName() is %s", instance.GetName()) - if instance.GetName() != string(csmv1.AuthorizationServer) { + if instance.GetName() != "authorization" { expected, nodeStatus, daemonSetErr := getDaemonSetStatus(ctx, instance, r) newStatus.NodeStatus = nodeStatus if daemonSetErr != nil { From 9c225bbd1c1c89a4f7202070cd653e3895292546 Mon Sep 17 00:00:00 2001 From: Jooseppi Luna Date: Tue, 13 Feb 2024 07:27:47 -0500 Subject: [PATCH 11/26] no daemonset --- controllers/csm_controller.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/controllers/csm_controller.go b/controllers/csm_controller.go index 6d40b93fa..88d27fc0e 100644 --- a/controllers/csm_controller.go +++ b/controllers/csm_controller.go @@ -841,9 +841,11 @@ func (r *ContainerStorageModuleReconciler) SyncCSM(ctx context.Context, cr csmv1 return err } - // Create/Update DeamonSet - if err = daemonset.SyncDaemonset(ctx, node.DaemonSetApplyConfig, cluster.ClusterK8sClient, cr.Name); err != nil { - return err + // Create/Update DeamonSet, except for auth proxy + if !authorizationEnabled { + if err = daemonset.SyncDaemonset(ctx, node.DaemonSetApplyConfig, cluster.ClusterK8sClient, cr.Name); err != nil { + return err + } } if replicationEnabled { From 8a5d31cfa200aa4a4a2121f3e56b0aad6b7088ad Mon Sep 17 00:00:00 2001 From: Jooseppi Luna Date: Tue, 13 Feb 2024 07:35:26 -0500 Subject: [PATCH 12/26] fix --- controllers/csm_controller.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controllers/csm_controller.go b/controllers/csm_controller.go index 88d27fc0e..5cd4daf32 100644 --- a/controllers/csm_controller.go +++ b/controllers/csm_controller.go @@ -677,7 +677,8 @@ func (r *ContainerStorageModuleReconciler) SyncCSM(ctx context.Context, cr csmv1 log := logger.GetLogger(ctx) // Create/Update Authorization Proxy Server - if authorizationEnabled, _ := utils.IsModuleEnabled(ctx, cr, csmv1.AuthorizationServer); authorizationEnabled { + authorizationEnabled, _ := utils.IsModuleEnabled(ctx, cr, csmv1.AuthorizationServer) + if authorizationEnabled { log.Infow("Create/Update authorization") if err := r.reconcileAuthorization(ctx, false, operatorConfig, cr, ctrlClient); err != nil { return fmt.Errorf("failed to deploy authorization proxy server: %v", err) From 0a336f74244dffb7f94d2c6f964d5782e2ad39c9 Mon Sep 17 00:00:00 2001 From: Jooseppi Luna Date: Tue, 13 Feb 2024 07:53:56 -0500 Subject: [PATCH 13/26] added log statements --- pkg/utils/status.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/utils/status.go b/pkg/utils/status.go index 28f2f349e..625dd5f45 100644 --- a/pkg/utils/status.go +++ b/pkg/utils/status.go @@ -336,6 +336,7 @@ func calculateState(ctx context.Context, instance *csmv1.ContainerStorageModule, running := true var err error = nil nodeStatusGood := true + newStatus.State = constants.Succeeded // TODO: Currently commented this block of code as the API used to get the latest deployment status is not working as expected // TODO: Can be uncommented once this issues gets sorted out /* controllerReplicas, controllerStatus, controllerErr := getDeploymentStatus(ctx, instance, r) @@ -362,7 +363,6 @@ func calculateState(ctx context.Context, instance *csmv1.ContainerStorageModule, controllerReplicas := newStatus.ControllerStatus.Desired controllerStatus := newStatus.ControllerStatus - newStatus.State = constants.Succeeded log.Infof("deployment controllerReplicas [%s]", controllerReplicas) log.Infof("deployment controllerStatus.Available [%s]", controllerStatus.Available) @@ -382,9 +382,14 @@ func calculateState(ctx context.Context, instance *csmv1.ContainerStorageModule, log.Infof("%s module not running", module) break } + log.Infof("%s module running", module.Name) } } } else { + log.Infof("either controllerReplicas != controllerStatus.Available or nodeStatus is bad") + log.Infof("controllerReplicas", controllerReplicas) + log.Infof("controllerStatus.Available", controllerStatus.Available) + log.Infof("nodeStatusGood", nodeStatusGood) running = false newStatus.State = constants.Failed } From 6c8629f0cc11007281f11236b4579d8aefb597db Mon Sep 17 00:00:00 2001 From: Jooseppi Luna Date: Tue, 13 Feb 2024 08:17:09 -0500 Subject: [PATCH 14/26] added another log statement --- pkg/utils/status.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/utils/status.go b/pkg/utils/status.go index 625dd5f45..2d05943a3 100644 --- a/pkg/utils/status.go +++ b/pkg/utils/status.go @@ -347,7 +347,7 @@ func calculateState(ctx context.Context, instance *csmv1.ContainerStorageModule, // Auth proxy has no daemonset. Putting this if/else in here and setting nodeStatusGood to true by // default is a little hacky but will be fixed when we refactor the status code in CSM 1.10 or 1.11 log.Infof("instance.GetName() is %s", instance.GetName()) - if instance.GetName() != "authorization" { + if instance.GetName() != string(csmv1.Authorization) { expected, nodeStatus, daemonSetErr := getDaemonSetStatus(ctx, instance, r) newStatus.NodeStatus = nodeStatus if daemonSetErr != nil { @@ -394,6 +394,7 @@ func calculateState(ctx context.Context, instance *csmv1.ContainerStorageModule, newStatus.State = constants.Failed } + log.Infof("setting status to ", "newStatus", newStatus) SetStatus(ctx, r, instance, newStatus) return running, err } From 0a6f9d9a103977bcce121ea061dfa73f1252c03c Mon Sep 17 00:00:00 2001 From: Jooseppi Luna Date: Tue, 13 Feb 2024 09:15:30 -0500 Subject: [PATCH 15/26] fix log statement --- pkg/utils/status.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/utils/status.go b/pkg/utils/status.go index 2d05943a3..52c47b701 100644 --- a/pkg/utils/status.go +++ b/pkg/utils/status.go @@ -379,7 +379,7 @@ func calculateState(ctx context.Context, instance *csmv1.ContainerStorageModule, if !moduleRunning { running = false newStatus.State = constants.Failed - log.Infof("%s module not running", module) + log.Infof("%s module not running", module.Name) break } log.Infof("%s module running", module.Name) From c68cc0e1eb053862aea9497fef715a047dcfbc36 Mon Sep 17 00:00:00 2001 From: Jooseppi Luna Date: Tue, 13 Feb 2024 09:32:32 -0500 Subject: [PATCH 16/26] logs logs logs --- pkg/utils/status.go | 58 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 45 insertions(+), 13 deletions(-) diff --git a/pkg/utils/status.go b/pkg/utils/status.go index 52c47b701..20a66bce8 100644 --- a/pkg/utils/status.go +++ b/pkg/utils/status.go @@ -908,7 +908,7 @@ func observabilityStatusCheck(ctx context.Context, instance *csmv1.ContainerStor // authProxyStatusCheck - calculate success state for auth proxy func authProxyStatusCheck(ctx context.Context, instance *csmv1.ContainerStorageModule, r ReconcileCSM, _ *csmv1.ContainerStorageModuleStatus) (bool, error) { - + log := logger.GetLogger(ctx) certEnabled := false nginxEnabled := false certManagerRunning := false @@ -953,35 +953,67 @@ func authProxyStatusCheck(ctx context.Context, instance *csmv1.ContainerStorageM switch deployment.Name { case "authorization-ingress-nginx-controller": if nginxEnabled { - nginxRunning = checkFn(&deployment) + if !checkFn(&deployment) { + log.Info("%s component not running in auth proxy deployment", deployment.Name) + return false, nil + } } case "cert-manager": if certEnabled { - certManagerRunning = checkFn(&deployment) + if !checkFn(&deployment) { + log.Info("%s component not running in auth proxy deployment", deployment.Name) + return false, nil + } } case "cert-manager-cainjector": if certEnabled { - certManagerCainInjectorRunning = checkFn(&deployment) + if !checkFn(&deployment) { + log.Info("%s component not running in auth proxy deployment", deployment.Name) + return false, nil + } } case "cert-manager-webhook": if certEnabled { - certManagerWebhookRunning = checkFn(&deployment) + if !checkFn(&deployment) { + log.Info("%s component not running in auth proxy deployment", deployment.Name) + return false, nil + } } case "proxy-server": - proxyServerRunning = checkFn(&deployment) + if !checkFn(&deployment) { + log.Info("%s component not running in auth proxy deployment", deployment.Name) + return false, nil + } case "redis-commander": - redisCommanderRunning = checkFn(&deployment) + if !checkFn(&deployment) { + log.Info("%s component not running in auth proxy deployment", deployment.Name) + return false, nil + } case "redis-primary": - redisPrimaryRunning = checkFn(&deployment) + if !checkFn(&deployment) { + log.Info("%s component not running in auth proxy deployment", deployment.Name) + return false, nil + } case "role-service": - roleServiceRunning = checkFn(&deployment) + if !checkFn(&deployment) { + log.Info("%s component not running in auth proxy deployment", deployment.Name) + return false, nil + } case "storage-service": - storageServiceRunning = checkFn(&deployment) + if !checkFn(&deployment) { + log.Info("%s component not running in auth proxy deployment", deployment.Name) + return false, nil + } case "tenant-service": - tenantServiceRunning = checkFn(&deployment) + if !checkFn(&deployment) { + log.Info("%s component not running in auth proxy deployment", deployment.Name) + return false, nil + } } } - return proxyServerRunning && redisCommanderRunning && redisPrimaryRunning && roleServiceRunning && storageServiceRunning && tenantServiceRunning && - (!certEnabled || (certManagerRunning && certManagerCainInjectorRunning && certManagerWebhookRunning)) && (!nginxEnabled || nginxRunning), nil + return true, nil + + //return proxyServerRunning && redisCommanderRunning && redisPrimaryRunning && roleServiceRunning && storageServiceRunning && tenantServiceRunning && + //(!certEnabled || (certManagerRunning && certManagerCainInjectorRunning && certManagerWebhookRunning)) && (!nginxEnabled || nginxRunning), nil } From c9f9c912e4303862b330fd8c69bd129a960298a1 Mon Sep 17 00:00:00 2001 From: Jooseppi Luna Date: Tue, 13 Feb 2024 09:45:37 -0500 Subject: [PATCH 17/26] compile --- pkg/utils/status.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/pkg/utils/status.go b/pkg/utils/status.go index 20a66bce8..e36b540cc 100644 --- a/pkg/utils/status.go +++ b/pkg/utils/status.go @@ -911,16 +911,6 @@ func authProxyStatusCheck(ctx context.Context, instance *csmv1.ContainerStorageM log := logger.GetLogger(ctx) certEnabled := false nginxEnabled := false - certManagerRunning := false - certManagerCainInjectorRunning := false - certManagerWebhookRunning := false - nginxRunning := false - proxyServerRunning := false - redisCommanderRunning := false - redisPrimaryRunning := false - roleServiceRunning := false - storageServiceRunning := false - tenantServiceRunning := false for _, m := range instance.Spec.Modules { if m.Name == csmv1.AuthorizationServer { From dd1e1ad3b2bf9be7769c025670e1cc6085cf8a88 Mon Sep 17 00:00:00 2001 From: Jooseppi Luna Date: Tue, 13 Feb 2024 11:41:09 -0500 Subject: [PATCH 18/26] more logs --- controllers/csm_controller.go | 2 +- pkg/utils/status.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/controllers/csm_controller.go b/controllers/csm_controller.go index 5cd4daf32..179b0d5a4 100644 --- a/controllers/csm_controller.go +++ b/controllers/csm_controller.go @@ -370,7 +370,7 @@ func (r *ContainerStorageModuleReconciler) handleDeploymentUpdate(oldObj interfa return } - log.Debugw("deployment modified generation", d.Generation, old.Generation) + log.Debugw("deployment modified generation", d.Name, d.Generation, old.Generation) desired := d.Status.Replicas available := d.Status.AvailableReplicas diff --git a/pkg/utils/status.go b/pkg/utils/status.go index e36b540cc..73e890bfb 100644 --- a/pkg/utils/status.go +++ b/pkg/utils/status.go @@ -1002,6 +1002,8 @@ func authProxyStatusCheck(ctx context.Context, instance *csmv1.ContainerStorageM } } + log.Info("auth proxy deployment successful") + return true, nil //return proxyServerRunning && redisCommanderRunning && redisPrimaryRunning && roleServiceRunning && storageServiceRunning && tenantServiceRunning && From ae541291f74f223b5db642362ad35f068bbd8b00 Mon Sep 17 00:00:00 2001 From: Jooseppi Luna Date: Tue, 13 Feb 2024 11:52:08 -0500 Subject: [PATCH 19/26] add logs and try updating status from handlesuccess --- pkg/utils/status.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/utils/status.go b/pkg/utils/status.go index 73e890bfb..9324f5d05 100644 --- a/pkg/utils/status.go +++ b/pkg/utils/status.go @@ -573,13 +573,15 @@ func HandleSuccess(ctx context.Context, instance *csmv1.ContainerStorageModule, newStatus.State = constants.Failed } if running { - newStatus.State = constants.Running + newStatus.State = constants.Succeeded } log.Infow("HandleSuccess Driver state ", "newStatus.State", newStatus.State) - if newStatus.State == constants.Running { + if newStatus.State == constants.Succeeded { // If previously we were in running state - if oldStatus.State == constants.Running { - log.Info("HandleSuccess Driver state didn't change from Running") + if oldStatus.State == constants.Succeeded { + log.Info("HandleSuccess Driver state didn't change from Succeeded") + } else { + UpdateStatus(ctx, instance, r, newStatus) } return reconcile.Result{}, nil } From f6e5c33daaf3f1e41ec157d4b0a4889a3e4544b8 Mon Sep 17 00:00:00 2001 From: Jooseppi Luna Date: Tue, 13 Feb 2024 14:37:44 -0500 Subject: [PATCH 20/26] remove UpdateStatus call for now --- pkg/utils/status.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/utils/status.go b/pkg/utils/status.go index 9324f5d05..6b9b17da3 100644 --- a/pkg/utils/status.go +++ b/pkg/utils/status.go @@ -581,7 +581,7 @@ func HandleSuccess(ctx context.Context, instance *csmv1.ContainerStorageModule, if oldStatus.State == constants.Succeeded { log.Info("HandleSuccess Driver state didn't change from Succeeded") } else { - UpdateStatus(ctx, instance, r, newStatus) + log.Info("HandleSuccess Driver stat changed to Succeeded") } return reconcile.Result{}, nil } From a5793e0c009a25b80c504874fe112fc05d69e4e7 Mon Sep 17 00:00:00 2001 From: Jooseppi Luna Date: Tue, 13 Feb 2024 16:48:31 -0500 Subject: [PATCH 21/26] adding csm label to auth --- .../moduleconfig/authorization/v1.7.0/deployment.yaml | 8 +++++++- .../authorization/v1.7.0/nginx-ingress-controller.yaml | 3 ++- .../moduleconfig/authorization/v1.8.0/deployment.yaml | 8 +++++++- .../authorization/v1.8.0/nginx-ingress-controller.yaml | 3 ++- .../moduleconfig/authorization/v1.9.0/deployment.yaml | 8 +++++++- .../authorization/v1.9.0/nginx-ingress-controller.yaml | 3 ++- .../moduleconfig/authorization/v1.9.1/deployment.yaml | 8 +++++++- .../authorization/v1.9.1/nginx-ingress-controller.yaml | 3 ++- pkg/modules/application_mobility.go | 2 -- pkg/modules/authorization.go | 5 +++++ pkg/modules/commonconfig.go | 2 ++ 11 files changed, 43 insertions(+), 10 deletions(-) diff --git a/operatorconfig/moduleconfig/authorization/v1.7.0/deployment.yaml b/operatorconfig/moduleconfig/authorization/v1.7.0/deployment.yaml index 935fdbc80..25051dd6d 100644 --- a/operatorconfig/moduleconfig/authorization/v1.7.0/deployment.yaml +++ b/operatorconfig/moduleconfig/authorization/v1.7.0/deployment.yaml @@ -14,6 +14,7 @@ spec: template: metadata: labels: + csm: app: proxy-server spec: containers: @@ -92,6 +93,7 @@ spec: template: metadata: labels: + csm: app: tenant-service spec: containers: @@ -176,6 +178,7 @@ spec: template: metadata: labels: + csm: app: role-service spec: serviceAccountName: role-service @@ -254,6 +257,7 @@ spec: template: metadata: labels: + csm: app: storage-service spec: serviceAccountName: storage-service @@ -316,6 +320,7 @@ spec: template: metadata: labels: + csm: app: redis role: primary tier: backend @@ -367,6 +372,7 @@ spec: template: metadata: labels: + csm: app: redis-commander tier: backend spec: @@ -496,4 +502,4 @@ roleRef: subjects: - kind: Group name: system:serviceaccounts:authorization - apiGroup: rbac.authorization.k8s.io \ No newline at end of file + apiGroup: rbac.authorization.k8s.io diff --git a/operatorconfig/moduleconfig/authorization/v1.7.0/nginx-ingress-controller.yaml b/operatorconfig/moduleconfig/authorization/v1.7.0/nginx-ingress-controller.yaml index 3bafbb56f..bd6feeab0 100644 --- a/operatorconfig/moduleconfig/authorization/v1.7.0/nginx-ingress-controller.yaml +++ b/operatorconfig/moduleconfig/authorization/v1.7.0/nginx-ingress-controller.yaml @@ -426,6 +426,7 @@ spec: template: metadata: labels: + csm: app.kubernetes.io/component: controller app.kubernetes.io/instance: app.kubernetes.io/name: ingress-nginx @@ -660,4 +661,4 @@ webhooks: resources: - ingresses sideEffects: None - \ No newline at end of file + diff --git a/operatorconfig/moduleconfig/authorization/v1.8.0/deployment.yaml b/operatorconfig/moduleconfig/authorization/v1.8.0/deployment.yaml index 935fdbc80..25051dd6d 100644 --- a/operatorconfig/moduleconfig/authorization/v1.8.0/deployment.yaml +++ b/operatorconfig/moduleconfig/authorization/v1.8.0/deployment.yaml @@ -14,6 +14,7 @@ spec: template: metadata: labels: + csm: app: proxy-server spec: containers: @@ -92,6 +93,7 @@ spec: template: metadata: labels: + csm: app: tenant-service spec: containers: @@ -176,6 +178,7 @@ spec: template: metadata: labels: + csm: app: role-service spec: serviceAccountName: role-service @@ -254,6 +257,7 @@ spec: template: metadata: labels: + csm: app: storage-service spec: serviceAccountName: storage-service @@ -316,6 +320,7 @@ spec: template: metadata: labels: + csm: app: redis role: primary tier: backend @@ -367,6 +372,7 @@ spec: template: metadata: labels: + csm: app: redis-commander tier: backend spec: @@ -496,4 +502,4 @@ roleRef: subjects: - kind: Group name: system:serviceaccounts:authorization - apiGroup: rbac.authorization.k8s.io \ No newline at end of file + apiGroup: rbac.authorization.k8s.io diff --git a/operatorconfig/moduleconfig/authorization/v1.8.0/nginx-ingress-controller.yaml b/operatorconfig/moduleconfig/authorization/v1.8.0/nginx-ingress-controller.yaml index 3bafbb56f..bd6feeab0 100644 --- a/operatorconfig/moduleconfig/authorization/v1.8.0/nginx-ingress-controller.yaml +++ b/operatorconfig/moduleconfig/authorization/v1.8.0/nginx-ingress-controller.yaml @@ -426,6 +426,7 @@ spec: template: metadata: labels: + csm: app.kubernetes.io/component: controller app.kubernetes.io/instance: app.kubernetes.io/name: ingress-nginx @@ -660,4 +661,4 @@ webhooks: resources: - ingresses sideEffects: None - \ No newline at end of file + diff --git a/operatorconfig/moduleconfig/authorization/v1.9.0/deployment.yaml b/operatorconfig/moduleconfig/authorization/v1.9.0/deployment.yaml index 935fdbc80..c171dd8e6 100644 --- a/operatorconfig/moduleconfig/authorization/v1.9.0/deployment.yaml +++ b/operatorconfig/moduleconfig/authorization/v1.9.0/deployment.yaml @@ -15,6 +15,7 @@ spec: metadata: labels: app: proxy-server + csm: spec: containers: - name: proxy-server @@ -93,6 +94,7 @@ spec: metadata: labels: app: tenant-service + csm: spec: containers: - name: tenant-service @@ -176,6 +178,7 @@ spec: template: metadata: labels: + csm: app: role-service spec: serviceAccountName: role-service @@ -254,6 +257,7 @@ spec: template: metadata: labels: + csm: app: storage-service spec: serviceAccountName: storage-service @@ -316,6 +320,7 @@ spec: template: metadata: labels: + csm: app: redis role: primary tier: backend @@ -367,6 +372,7 @@ spec: template: metadata: labels: + csm: app: redis-commander tier: backend spec: @@ -496,4 +502,4 @@ roleRef: subjects: - kind: Group name: system:serviceaccounts:authorization - apiGroup: rbac.authorization.k8s.io \ No newline at end of file + apiGroup: rbac.authorization.k8s.io diff --git a/operatorconfig/moduleconfig/authorization/v1.9.0/nginx-ingress-controller.yaml b/operatorconfig/moduleconfig/authorization/v1.9.0/nginx-ingress-controller.yaml index 3bafbb56f..bd6feeab0 100644 --- a/operatorconfig/moduleconfig/authorization/v1.9.0/nginx-ingress-controller.yaml +++ b/operatorconfig/moduleconfig/authorization/v1.9.0/nginx-ingress-controller.yaml @@ -426,6 +426,7 @@ spec: template: metadata: labels: + csm: app.kubernetes.io/component: controller app.kubernetes.io/instance: app.kubernetes.io/name: ingress-nginx @@ -660,4 +661,4 @@ webhooks: resources: - ingresses sideEffects: None - \ No newline at end of file + diff --git a/operatorconfig/moduleconfig/authorization/v1.9.1/deployment.yaml b/operatorconfig/moduleconfig/authorization/v1.9.1/deployment.yaml index 935fdbc80..22ce47e52 100644 --- a/operatorconfig/moduleconfig/authorization/v1.9.1/deployment.yaml +++ b/operatorconfig/moduleconfig/authorization/v1.9.1/deployment.yaml @@ -15,6 +15,7 @@ spec: metadata: labels: app: proxy-server + csm: spec: containers: - name: proxy-server @@ -93,6 +94,7 @@ spec: metadata: labels: app: tenant-service + csm: spec: containers: - name: tenant-service @@ -176,6 +178,7 @@ spec: template: metadata: labels: + csm: app: role-service spec: serviceAccountName: role-service @@ -255,6 +258,7 @@ spec: metadata: labels: app: storage-service + csm: spec: serviceAccountName: storage-service containers: @@ -319,6 +323,7 @@ spec: app: redis role: primary tier: backend + csm: spec: containers: - name: primary @@ -369,6 +374,7 @@ spec: labels: app: redis-commander tier: backend + csm: spec: containers: - name: redis-commander @@ -496,4 +502,4 @@ roleRef: subjects: - kind: Group name: system:serviceaccounts:authorization - apiGroup: rbac.authorization.k8s.io \ No newline at end of file + apiGroup: rbac.authorization.k8s.io diff --git a/operatorconfig/moduleconfig/authorization/v1.9.1/nginx-ingress-controller.yaml b/operatorconfig/moduleconfig/authorization/v1.9.1/nginx-ingress-controller.yaml index 3bafbb56f..135f8afa5 100644 --- a/operatorconfig/moduleconfig/authorization/v1.9.1/nginx-ingress-controller.yaml +++ b/operatorconfig/moduleconfig/authorization/v1.9.1/nginx-ingress-controller.yaml @@ -429,6 +429,7 @@ spec: app.kubernetes.io/component: controller app.kubernetes.io/instance: app.kubernetes.io/name: ingress-nginx + csm: spec: containers: - args: @@ -660,4 +661,4 @@ webhooks: resources: - ingresses sideEffects: None - \ No newline at end of file + diff --git a/pkg/modules/application_mobility.go b/pkg/modules/application_mobility.go index 9248a48e9..94df5dd53 100644 --- a/pkg/modules/application_mobility.go +++ b/pkg/modules/application_mobility.go @@ -105,8 +105,6 @@ const ( AppMobCertManagerComponent = "cert-manager" // AppMobVeleroComponent - velero component AppMobVeleroComponent = "velero" - // CSMName - name - CSMName = "" ) // getAppMobilityModule - get instance of app mobility module diff --git a/pkg/modules/authorization.go b/pkg/modules/authorization.go index f9360410e..027f5fe5a 100644 --- a/pkg/modules/authorization.go +++ b/pkg/modules/authorization.go @@ -493,6 +493,7 @@ func getAuthorizationServerDeployment(op utils.OperatorConfig, cr csmv1.Containe YamlString = strings.ReplaceAll(YamlString, AuthStorageServiceImage, component.StorageService) YamlString = strings.ReplaceAll(YamlString, AuthRedisImage, component.Redis) YamlString = strings.ReplaceAll(YamlString, AuthRedisCommanderImage, component.Commander) + YamlString = strings.ReplaceAll(YamlString, CSMName, cr.Name) for _, env := range component.Envs { if env.Name == "REDIS_STORAGE_CLASS" { @@ -504,6 +505,7 @@ func getAuthorizationServerDeployment(op utils.OperatorConfig, cr csmv1.Containe YamlString = strings.ReplaceAll(YamlString, AuthNamespace, authNamespace) YamlString = strings.ReplaceAll(YamlString, AuthRedisStorageClass, redisStorageClass) + YamlString = strings.ReplaceAll(YamlString, CSMName, cr.Name) return YamlString, nil } @@ -570,6 +572,7 @@ func getAuthorizationIngressRules(op utils.OperatorConfig, cr csmv1.ContainerSto YamlString = strings.ReplaceAll(YamlString, AuthProxyHost, authHostname) YamlString = strings.ReplaceAll(YamlString, AuthProxyIngressHost, proxyIngressHost) YamlString = strings.ReplaceAll(YamlString, AuthProxyIngressClassName, proxyIngressClassName) + YamlString = strings.ReplaceAll(YamlString, CSMName, cr.Name) return YamlString, nil } @@ -625,6 +628,7 @@ func getNginxIngressController(op utils.OperatorConfig, cr csmv1.ContainerStorag YamlString = string(buf) authNamespace := cr.Namespace YamlString = strings.ReplaceAll(YamlString, AuthNamespace, authNamespace) + YamlString = strings.ReplaceAll(YamlString, CSMName, cr.Name) return YamlString, nil } @@ -674,6 +678,7 @@ func getPolicies(op utils.OperatorConfig, cr csmv1.ContainerStorageModule) (stri YamlString = string(buf) authNamespace := cr.Namespace YamlString = strings.ReplaceAll(YamlString, AuthNamespace, authNamespace) + YamlString = strings.ReplaceAll(YamlString, CSMName, cr.Name) return YamlString, nil } diff --git a/pkg/modules/commonconfig.go b/pkg/modules/commonconfig.go index 7deb10719..000a325fa 100644 --- a/pkg/modules/commonconfig.go +++ b/pkg/modules/commonconfig.go @@ -33,6 +33,8 @@ const ( CertManagerManifest = "cert-manager.yaml" // CommonNamespace - CommonNamespace = "" + // CSMName - name + CSMName = "" ) // SupportedDriverParam - From 8aa9080f331ff856f8763d6bf2140ef2753044ec Mon Sep 17 00:00:00 2001 From: Jooseppi Luna Date: Tue, 13 Feb 2024 17:22:49 -0500 Subject: [PATCH 22/26] remove extraneous string replacement --- pkg/modules/authorization.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/modules/authorization.go b/pkg/modules/authorization.go index 027f5fe5a..f49faf5b7 100644 --- a/pkg/modules/authorization.go +++ b/pkg/modules/authorization.go @@ -678,7 +678,6 @@ func getPolicies(op utils.OperatorConfig, cr csmv1.ContainerStorageModule) (stri YamlString = string(buf) authNamespace := cr.Namespace YamlString = strings.ReplaceAll(YamlString, AuthNamespace, authNamespace) - YamlString = strings.ReplaceAll(YamlString, CSMName, cr.Name) return YamlString, nil } From c2f5f41ddbf2d153c9fbdf289fcb106804c099cd Mon Sep 17 00:00:00 2001 From: Jooseppi Luna Date: Tue, 13 Feb 2024 17:36:21 -0500 Subject: [PATCH 23/26] removing commented code --- pkg/utils/status.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkg/utils/status.go b/pkg/utils/status.go index 6b9b17da3..29b62b57a 100644 --- a/pkg/utils/status.go +++ b/pkg/utils/status.go @@ -1007,7 +1007,4 @@ func authProxyStatusCheck(ctx context.Context, instance *csmv1.ContainerStorageM log.Info("auth proxy deployment successful") return true, nil - - //return proxyServerRunning && redisCommanderRunning && redisPrimaryRunning && roleServiceRunning && storageServiceRunning && tenantServiceRunning && - //(!certEnabled || (certManagerRunning && certManagerCainInjectorRunning && certManagerWebhookRunning)) && (!nginxEnabled || nginxRunning), nil } From 32408beec2f6621becb84d8304f930a1501e37e6 Mon Sep 17 00:00:00 2001 From: Jooseppi Luna Date: Tue, 13 Feb 2024 18:04:26 -0500 Subject: [PATCH 24/26] Update actions.yml --- .github/workflows/actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 2e3d20c34..004110707 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -1,7 +1,7 @@ name: Workflow on: push: - branches: [ auth-proxy-status-fix ] + branches: [ main ] pull_request: branches: [ '**' ] jobs: From b387b644bed99a4bbbae663f6811f14119ef5678 Mon Sep 17 00:00:00 2001 From: Jooseppi Luna Date: Tue, 13 Feb 2024 18:10:23 -0500 Subject: [PATCH 25/26] fix merge issue --- pkg/utils/status.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/utils/status.go b/pkg/utils/status.go index 23182c526..b9bbb8bbb 100644 --- a/pkg/utils/status.go +++ b/pkg/utils/status.go @@ -420,7 +420,7 @@ func calculateState(ctx context.Context, instance *csmv1.ContainerStorageModule, log.Infof("deployment controllerReplicas [%s]", controllerReplicas) log.Infof("deployment controllerStatus.Available [%s]", controllerStatus.Available) - if (controllerReplicas == controllerStatus.Available) && nodeStatusGood { + if (fmt.Sprintf("%d", controllerReplicas) == controllerStatus.Available) && nodeStatusGood { for _, module := range instance.Spec.Modules { From 0bd012488ba3750a75cba38a3c07610501378844 Mon Sep 17 00:00:00 2001 From: Jooseppi Luna Date: Tue, 13 Feb 2024 18:15:45 -0500 Subject: [PATCH 26/26] fix fmt --- pkg/utils/status.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/utils/status.go b/pkg/utils/status.go index b9bbb8bbb..c540005b6 100644 --- a/pkg/utils/status.go +++ b/pkg/utils/status.go @@ -422,7 +422,6 @@ func calculateState(ctx context.Context, instance *csmv1.ContainerStorageModule, if (fmt.Sprintf("%d", controllerReplicas) == controllerStatus.Available) && nodeStatusGood { - for _, module := range instance.Spec.Modules { moduleStatus, exists := checkModuleStatus[module.Name] if exists && module.Enabled {