Skip to content

Commit

Permalink
Add GetClusterKey to runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
tbrisker committed Jun 28, 2022
1 parent e4ebe87 commit f651a65
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions pkg/rosa/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ import (
)

type Runtime struct {
Reporter *reporter.Object
Logger *logrus.Logger
OCMClient *ocm.Client
AWSClient aws.Client
Creator *aws.Creator
Reporter *reporter.Object
Logger *logrus.Logger
OCMClient *ocm.Client
AWSClient aws.Client
Creator *aws.Creator
ClusterKey string
}

func NewRuntime() *Runtime {
Expand Down Expand Up @@ -55,3 +56,14 @@ func (r *Runtime) Cleanup() {
}
}
}

// Load the cluster key provided by the user into the runtime and return it
func (r *Runtime) GetClusterKey() string {
clusterKey, err := ocm.GetClusterKey()
if err != nil {
r.Reporter.Errorf("%s", err)
os.Exit(1)
}
r.ClusterKey = clusterKey
return clusterKey
}

0 comments on commit f651a65

Please sign in to comment.