Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A bit of code refactoring #805

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Next Next commit
Skipping "IsOutdatedConfig" because I think is useless, it only check…
…s if the length of the registries is > 0 which we're doing after that and is not being used anywhere else
Eloy Tolosa committed Nov 14, 2024
commit f72b649891377504c9499314f94b4c7c831b63cc
13 changes: 6 additions & 7 deletions pkg/autosync/autosync.go
Original file line number Diff line number Diff line change
@@ -12,20 +12,19 @@ import (
// in case where user specific values that are defined in granted.yml's `templateValues` are not available.
// this is done so that users are aware of required keys when granted's credential-process is used through the AWS CLI.
func Run(ctx context.Context, interactive bool) {
if registry.IsOutdatedConfig() {
clio.Warn("Outdated Profile Registry Configuration. Use `granted registry migrate` to update your configuration.")

clio.Warn("Skipping Profile Registry sync.")

return
}

registries, err := registry.GetProfileRegistries(interactive)
if err != nil {
clio.Debugf("unable to load granted config file with err %s", err.Error())
return
}

if len(registries) > 0 {
clio.Warn("Outdated Profile Registry Configuration. Use `granted registry migrate` to update your configuration.")
clio.Warn("Skipping Profile Registry sync.")
return
}

// check if registry has been configured or not.
// should skip registry sync if no profile registry.
if len(registries) == 0 {