diff --git a/internal/jimm/cloudcredential.go b/internal/jimm/cloudcredential.go index 9e710a982..037ebcd87 100644 --- a/internal/jimm/cloudcredential.go +++ b/internal/jimm/cloudcredential.go @@ -377,8 +377,5 @@ func (j *JIMM) getCloudCredentialAttributes(ctx context.Context, cred *dbmodel.C if err != nil { return nil, errors.E(op, err) } - if len(attr) == 0 && cred.AuthType != "empty" { - return nil, errors.E(op, errors.CodeNotFound, "cloud-credential attributes not found") - } return attr, nil } diff --git a/internal/jujuapi/cloud.go b/internal/jujuapi/cloud.go index ba33787b7..1adb9b775 100644 --- a/internal/jujuapi/cloud.go +++ b/internal/jujuapi/cloud.go @@ -322,11 +322,7 @@ func getIdentityCredentials(ctx context.Context, user *openfga.User, j JIMM, arg var err error content.Attributes, _, err = j.GetCloudCredentialAttributes(ctx, user, c, args.IncludeSecrets) if err != nil { - if errors.ErrorCode(err) == errors.CodeNotFound { - content.Attributes = map[string]string{} - } else { - return nil, errors.E(err) - } + return nil, errors.E(err) } mas := make([]jujuparams.ModelAccess, len(c.Models)) for i, m := range c.Models {