Skip to content

Commit

Permalink
Merge pull request #240 from mjlshen/OSD-12759
Browse files Browse the repository at this point in the history
OSD-12759 Updating deps to fix a servicelog bug in FedRAMP
  • Loading branch information
openshift-ci[bot] authored Aug 4, 2022
2 parents 300d504 + db0e5cb commit 2f74fd5
Show file tree
Hide file tree
Showing 4 changed files with 335 additions and 158 deletions.
31 changes: 15 additions & 16 deletions cmd/federatedrole/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"path/filepath"

awsv1alpha1 "github.com/openshift/aws-account-operator/pkg/apis/aws/v1alpha1"
"github.com/pkg/errors"
"github.com/spf13/cobra"

"k8s.io/apimachinery/pkg/util/yaml"
Expand Down Expand Up @@ -96,7 +95,7 @@ func (o *applyOptions) run() error {
}

if resp.StatusCode/100 != 2 {
return errors.New(fmt.Sprintf("Failed to GET %s, status code %d", o.url, resp.StatusCode))
return fmt.Errorf("failed to GET %s, status code %d", o.url, resp.StatusCode)
}

defer resp.Body.Close()
Expand Down Expand Up @@ -148,15 +147,15 @@ func (o *applyOptions) run() error {
if federatedAccount.Spec.AWSFederatedRole.Namespace == federatedRole.Namespace &&
federatedAccount.Spec.AWSFederatedRole.Name == federatedRole.Name {
if accountID, ok = federatedAccount.Labels[awsAccountIDLabel]; !ok {
return errors.New(fmt.Sprintf(
"Unable to get AWS AccountID label for AWS federated account access CR %s/%s",
federatedAccount.Namespace, federatedAccount.Name))
return fmt.Errorf(
"unable to get AWS AccountID label for AWS federated account access CR %s/%s",
federatedAccount.Namespace, federatedAccount.Name)
}

if uid, ok = federatedAccount.Labels[uidLabel]; !ok {
return errors.New(fmt.Sprintf(
"Unable to get UID label for AWS federated account access CR %s/%s",
federatedAccount.Namespace, federatedAccount.Name))
return fmt.Errorf(
"unable to get UID label for AWS federated account access CR %s/%s",
federatedAccount.Namespace, federatedAccount.Name)
}

var awsClient awsprovider.Client
Expand All @@ -165,16 +164,16 @@ func (o *applyOptions) run() error {
federatedAccount.Spec.AWSCustomerCredentialSecret.Namespace,
federatedAccount.Spec.AWSCustomerCredentialSecret.Name)
if err != nil {
return errors.Wrap(err, fmt.Sprintf(
"Failed to get AWS credentials for AWS federated account access CR %s/%s",
federatedAccount.Namespace, federatedAccount.Name))
return fmt.Errorf(
"failed to get AWS credentials for AWS federated account access CR %s/%s: %w",
federatedAccount.Namespace, federatedAccount.Name, err)
}

awsClient, err = awsprovider.NewAwsClientWithInput(creds)
if err != nil {
return errors.Wrap(err, fmt.Sprintf(
"Failed to create AWS Setup Client for AWS federated account access CR %s/%s",
federatedAccount.Namespace, federatedAccount.Name))
return fmt.Errorf(
"failed to create AWS Setup Client for AWS federated account access CR %s/%s: %w",
federatedAccount.Namespace, federatedAccount.Name, err)
}
awsClients[federatedAccount.Namespace] = awsClient
}
Expand All @@ -183,8 +182,8 @@ func (o *applyOptions) run() error {
federatedAccount.Namespace, federatedAccount.Name))

if err := awsprovider.RefreshIAMPolicy(awsClient, &federatedRole, accountID, uid); err != nil {
return errors.Wrap(err, fmt.Sprintf("Failed to apply IAM policy for AWS federated account access CR %s/%s",
federatedAccount.Namespace, federatedAccount.Name))
return fmt.Errorf("failed to apply IAM policy for AWS federated account access CR %s/%s: %w",
federatedAccount.Namespace, federatedAccount.Name, err)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/servicelog/post.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ func printClusters(clusters []*v1.Cluster) (err error) {
table := printer.NewTablePrinter(os.Stdout, 20, 1, 3, ' ')
table.AddRow([]string{"Name", "ID", "State", "Version", "Cloud Provider", "Region"})
for _, cluster := range clusters {
table.AddRow([]string{cluster.DisplayName(), cluster.ID(), string(cluster.State()), cluster.OpenshiftVersion(), cluster.CloudProvider().ID(), cluster.Region().ID()})
table.AddRow([]string{cluster.Name(), cluster.ID(), string(cluster.State()), cluster.OpenshiftVersion(), cluster.CloudProvider().ID(), cluster.Region().ID()})
}

// Add empty row for readability
Expand Down
34 changes: 16 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,35 @@ module github.com/openshift/osdctl
go 1.16

require (
github.com/aws/aws-sdk-go v1.42.20
github.com/aws/aws-sdk-go v1.44.66
github.com/aws/aws-sdk-go-v2/credentials v1.12.2
github.com/coreos/go-semver v0.3.0
github.com/deckarep/golang-set v1.7.1
github.com/golang/mock v1.6.0
github.com/imdario/mergo v0.3.12 // indirect
github.com/onsi/gomega v1.16.0
github.com/openshift-online/ocm-cli v0.1.59
github.com/openshift-online/ocm-sdk-go v0.1.224
github.com/onsi/gomega v1.20.0
github.com/openshift-online/ocm-cli v0.1.64
github.com/openshift-online/ocm-sdk-go v0.1.273
github.com/openshift/api v3.9.1-0.20191111211345-a27ff30ebf09+incompatible
github.com/openshift/aws-account-operator/pkg/apis v0.0.0-20210611151019-01b1df7a3e9e
github.com/openshift/gcp-project-operator v0.0.0-20210906153132-ce9b2425f1a7
github.com/openshift/hive v1.0.5
github.com/openshift/osd-network-verifier v0.0.0-20220518154805-047e42cfe29f
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4
github.com/pkg/errors v0.9.1
github.com/prometheus/common v0.28.0
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
github.com/prometheus/common v0.37.0
github.com/shopspring/decimal v1.2.0
github.com/sirupsen/logrus v1.6.0
github.com/spf13/cobra v1.4.0
github.com/sirupsen/logrus v1.9.0
github.com/spf13/cobra v1.5.0
github.com/spf13/pflag v1.0.5
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.16.0 // indirect
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.18.5
k8s.io/apimachinery v0.18.5
k8s.io/cli-runtime v0.18.3
k8s.io/apimachinery v0.24.3
k8s.io/cli-runtime v0.18.5
k8s.io/client-go v12.0.0+incompatible
k8s.io/klog/v2 v2.9.0
k8s.io/kubectl v0.18.3
k8s.io/utils v0.0.0-20200327001022-6496210b90e8
k8s.io/klog/v2 v2.30.0
k8s.io/kubectl v0.18.5
k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b
sigs.k8s.io/controller-runtime v0.6.0
)

Expand All @@ -47,7 +43,9 @@ replace (
github.com/openshift/api v3.9.0+incompatible => github.com/openshift/api v0.0.0-20200617152309-e9562717e6cd
github.com/terraform-providers/terraform-provider-aws => github.com/openshift/terraform-provider-aws v1.60.1-0.20200526184553-1a716dcc0fa8 // Pin to openshift fork with tag v2.60.0-openshift-1
github.com/terraform-providers/terraform-provider-azurerm => github.com/openshift/terraform-provider-azurerm v1.41.1-openshift-3 // Pin to openshift fork with IPv6 fixes
k8s.io/client-go => k8s.io/client-go v0.18.3
k8s.io/apimachinery => k8s.io/apimachinery v0.18.5
k8s.io/client-go => k8s.io/client-go v0.18.5
k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6 // Needed until we can go to k8s.io >= v0.19
sigs.k8s.io/cluster-api-provider-aws => github.com/openshift/cluster-api-provider-aws v0.2.1-0.20200506073438-9d49428ff837 // Pin OpenShift fork
sigs.k8s.io/cluster-api-provider-azure => github.com/openshift/cluster-api-provider-azure v0.1.0-alpha.3.0.20200120114645-8a9592f1f87b // Pin OpenShift fork
sigs.k8s.io/cluster-api-provider-openstack => github.com/openshift/cluster-api-provider-openstack v0.0.0-20200526112135-319a35b2e38e // Pin OpenShift fork
Expand Down
Loading

0 comments on commit 2f74fd5

Please sign in to comment.