Skip to content

Commit

Permalink
Merge branch 'uuid-unmigration' of github.com:nflynt/rancher into uui…
Browse files Browse the repository at this point in the history
…d-unmigration
  • Loading branch information
nflynt committed Aug 14, 2023
2 parents a3e85de + 516bdeb commit 14c5f72
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cleanup/ad-guid-README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion cleanup/ad-guid-unmigration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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..."
Expand Down
12 changes: 4 additions & 8 deletions pkg/auth/providers/activedirectory/activedirectory_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 (
Expand Down Expand Up @@ -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{})
}

0 comments on commit 14c5f72

Please sign in to comment.