From 92483fa68cad8c3d4972c088093511a5f52bd46a Mon Sep 17 00:00:00 2001 From: Chad Roberts Date: Mon, 14 Aug 2023 09:51:18 -0400 Subject: [PATCH 1/3] Removing unused error type check --- .../activedirectory/activedirectory_provider.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pkg/auth/providers/activedirectory/activedirectory_provider.go b/pkg/auth/providers/activedirectory/activedirectory_provider.go index c6b121a777b..f8722c84724 100644 --- a/pkg/auth/providers/activedirectory/activedirectory_provider.go +++ b/pkg/auth/providers/activedirectory/activedirectory_provider.go @@ -11,6 +11,10 @@ import ( "github.com/mitchellh/mapstructure" "github.com/pkg/errors" "github.com/rancher/norman/types" + "github.com/sirupsen/logrus" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + v32 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" "github.com/rancher/rancher/pkg/auth/providers/common" "github.com/rancher/rancher/pkg/auth/tokens" @@ -20,9 +24,6 @@ import ( v3 "github.com/rancher/rancher/pkg/generated/norman/management.cattle.io/v3" "github.com/rancher/rancher/pkg/types/config" "github.com/rancher/rancher/pkg/user" - "github.com/sirupsen/logrus" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" ) const ( @@ -274,8 +275,3 @@ func (p *adProvider) IsDisabledProvider() (bool, error) { } return !adConfig.Enabled, nil } - -// IsStatusLoginDisabledError will return true when the login is disabled due to a migration in process. -func IsStatusLoginDisabledError(err error) bool { - return errors.Is(err, LoginDisabledError{}) -} From a89977922b7c1f957ed0fc932a8f90d7d525ea70 Mon Sep 17 00:00:00 2001 From: nflynt Date: Mon, 14 Aug 2023 10:08:24 -0400 Subject: [PATCH 2/3] Update cleanup/ad-guid-README.md Co-authored-by: Michael Bolot --- cleanup/ad-guid-README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cleanup/ad-guid-README.md b/cleanup/ad-guid-README.md index 5f0e9746c85..102b1b7f196 100644 --- a/cleanup/ad-guid-README.md +++ b/cleanup/ad-guid-README.md @@ -45,7 +45,7 @@ Active Directory is not the authentication provider, this utility will take no a ## Additional notes -* The utility will create a configmap named ad-guid-migration in the cattle-system namespace. This configmap contains +* The utility will create a configmap named `ad-guid-migration` in the `cattle-system` namespace. This configmap contains a data entry with a key named "ad-guid-migration-status". If the utility is currently active, that status will be set to "Running". After the utility has completed, the status will be set to "Finished". If a run is interrupted prior to completion, that configmap will retain the status of "Running" and subsequent attempts to run the script will From f8369c8f5aa85e4ca37359ff2f0d54e26ce07301 Mon Sep 17 00:00:00 2001 From: Chad Roberts Date: Mon, 14 Aug 2023 10:12:31 -0400 Subject: [PATCH 3/3] Display banner before doing version check --- cleanup/ad-guid-unmigration.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cleanup/ad-guid-unmigration.sh b/cleanup/ad-guid-unmigration.sh index 24cf5ec3870..485a88d7593 100755 --- a/cleanup/ad-guid-unmigration.sh +++ b/cleanup/ad-guid-unmigration.sh @@ -177,6 +177,8 @@ if [ $# -lt 1 ]; then exit 1 fi +display_banner "${banner_text}" + if [ "$dry_run" != true ] then # Check the Rancher version before doing anything. @@ -194,7 +196,6 @@ then fi fi -display_banner "${banner_text}" read -p "Do you want to continue? (y/n): " choice if [[ ! $choice =~ ^[Yy]$ ]]; then echo "Exiting..."