Skip to content

Commit

Permalink
Red Hat OpenShift Service on AWS
Browse files Browse the repository at this point in the history
This renames every instance of MOA to ROSA. This should be both
backwards compatible with the current deployment OCM (using MOA) and
future-proof for a future deployment of OCM (using ROSA).
  • Loading branch information
vkareh committed Oct 26, 2020
1 parent 7f2292e commit 4132824
Show file tree
Hide file tree
Showing 96 changed files with 488 additions and 483 deletions.
14 changes: 7 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
.vscode/
docs/*.1
docs/*.rst
/moactl
/moactl-darwin-amd64
/moactl-darwin-amd64.sha256
/moactl-linux-amd64
/moactl-linux-amd64.sha256
/moactl-windows-amd64.exe
/moactl-windows-amd64.sha256
/rosa
/rosa-darwin-amd64
/rosa-darwin-amd64.sha256
/rosa-linux-amd64
/rosa-linux-amd64.sha256
/rosa-windows-amd64.exe
/rosa-windows-amd64.sha256
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ export CGO_ENABLED=0
unexport GOFLAGS

.PHONY: build
moactl: generate
go build ./cmd/moactl
rosa: generate
go build ./cmd/rosa

.PHONY: test
test:
go test ./...

.PHONY: install
install:
go install ./cmd/moactl
go install ./cmd/rosa

.PHONY: fmt
fmt:
Expand All @@ -47,7 +47,7 @@ lint:
.PHONY: clean
clean:
rm -rf \
moactl \
rosa \
*-darwin-amd64 \
*-linux-amd64 \
*-windows-amd64 \
Expand All @@ -60,9 +60,9 @@ generate:
go-bindata -nometadata -nocompress -pkg assets -o ./assets/bindata.go ./templates/...

.PHONY: docs
docs: moactl
docs: rosa
rm -rf docs && mkdir docs
./moactl docs -d ./docs -f markdown
./rosa docs -d ./docs -f markdown

mocks:
mockgen -package mocks -destination=pkg/aws/mocks/iamapi.go github.com/aws/aws-sdk-go/service/iam/iamiface IAMAPI
Expand Down
172 changes: 86 additions & 86 deletions README.md

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions assets/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions build_tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@ function build_cmds {

# Build the command line tools:
echo "Building binaries for OS '${os}' and architecture '${arch}'"
make moactl
make rosa

# Rename the generated binaries adding the operating system and architecture
# name and generate a SHA256 sum:
echo "Calculating SHA 256 sums"
if [ -f "moactl.exe" ]
if [ -f "rosa.exe" ]
then
mv "moactl.exe" "moactl-${os}-${arch}.exe"
sha256sum "moactl-${os}-${arch}.exe" > "moactl-${os}-${arch}.sha256"
mv "rosa.exe" "rosa-${os}-${arch}.exe"
sha256sum "rosa-${os}-${arch}.exe" > "rosa-${os}-${arch}.sha256"
else
mv "moactl" "moactl-${os}-${arch}"
sha256sum "moactl-${os}-${arch}" > "moactl-${os}-${arch}.sha256"
mv "rosa" "rosa-${os}-${arch}"
sha256sum "rosa-${os}-${arch}" > "rosa-${os}-${arch}.sha256"
fi
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/completion/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ var Cmd = &cobra.Command{
Short: "Generates bash completion scripts",
Long: `To load completion run
. <(moactl completion)
. <(rosa completion)
To configure your bash shell to load completions for each session add to your bashrc
# ~/.bashrc or ~/.profile
. <(moactl completion)
. <(rosa completion)
`,
Run: func(cmd *cobra.Command, args []string) {
cmd.Root().GenBashCompletion(os.Stdout)
Expand Down
4 changes: 2 additions & 2 deletions cmd/create/addon/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var Cmd = &cobra.Command{
Short: "Install add-ons on cluster",
Long: "Install Red Hat managed add-ons on a cluster",
Example: ` # Add the CodeReady Workspaces add-on installation to the cluster
moactl create addon --cluster=mycluster codeready-workspaces`,
rosa create addon --cluster=mycluster codeready-workspaces`,
Run: run,
}

Expand Down Expand Up @@ -141,7 +141,7 @@ func run(_ *cobra.Command, argv []string) {
reporter.Errorf("Failed to add add-on installation '%s' for cluster '%s': %s", addOnID, clusterKey, err)
os.Exit(1)
}
reporter.Infof("Add-on '%s' is now installing. To check the status run 'moactl list addons -c %s'",
reporter.Infof("Add-on '%s' is now installing. To check the status run 'rosa list addons -c %s'",
addOnID, clusterKey)
}
}
4 changes: 2 additions & 2 deletions cmd/create/admin/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var Cmd = &cobra.Command{
Short: "Creates an admin user to login to the cluster",
Long: "Creates a cluster-admin user with an auto-generated password to login to the cluster",
Example: ` # Create an admin user to login to the cluster
moactl create admin --cluster=mycluster`,
rosa create admin --cluster=mycluster`,
Run: run,
}

Expand Down Expand Up @@ -78,7 +78,7 @@ func run(cmd *cobra.Command, _ []string) {
}

reporter.Warnf("It is recommended to add an identity provider to login to this cluster. " +
"See 'moactl create idp --help' for more information.")
"See 'rosa create idp --help' for more information.")

// Create the AWS client:
awsClient, err := aws.NewClient().
Expand Down
12 changes: 6 additions & 6 deletions cmd/create/cluster/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ var Cmd = &cobra.Command{
Short: "Create cluster",
Long: "Create cluster.",
Example: ` # Create a cluster named "mycluster"
moactl create cluster --cluster-name=mycluster
rosa create cluster --cluster-name=mycluster
# Create a cluster in the us-east-2 region
moactl create cluster --cluster-name=mycluster --region=us-east-2`,
rosa create cluster --cluster-name=mycluster --region=us-east-2`,
Run: run,
PersistentPreRun: v.Validations,
}
Expand Down Expand Up @@ -535,23 +535,23 @@ func run(cmd *cobra.Command, _ []string) {
}

reporter.Infof("Creating cluster with identifier '%s' and name '%s'", cluster.ID(), clusterName)
reporter.Infof("To view list of clusters and their status, run 'moactl list clusters'")
reporter.Infof("To view a list of clusters and their status, run 'rosa list clusters'")

reporter.Infof("Cluster '%s' has been created.", clusterName)
reporter.Infof(
"Once the cluster is installed you will need to add an Identity Provider " +
"before you can login into the cluster. See 'moactl create idp --help' " +
"before you can login into the cluster. See 'rosa create idp --help' " +
"for more information.")

if args.watch {
installLogs.Cmd.Run(cmd, []string{cluster.ID()})
} else {
reporter.Infof(
"To determine when your cluster is Ready, run 'moactl describe cluster -c %s'.",
"To determine when your cluster is Ready, run 'rosa describe cluster -c %s'.",
clusterName,
)
reporter.Infof(
"To watch your cluster installation logs, run 'moactl logs install -c %s --watch'.",
"To watch your cluster installation logs, run 'rosa logs install -c %s --watch'.",
clusterName,
)
}
Expand Down
7 changes: 3 additions & 4 deletions cmd/create/idp/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,17 @@ var args struct {
openidScopes string
}

// TODO: Add gitlab
var validIdps []string = []string{"github", "gitlab", "google", "ldap", "openid"}

var Cmd = &cobra.Command{
Use: "idp",
Short: "Add IDP for cluster",
Long: "Add an Identity providers to determine how users log into the cluster.",
Example: ` # Add a GitHub identity provider to a cluster named "mycluster"
moactl create idp --type=github --cluster=mycluster
rosa create idp --type=github --cluster=mycluster
# Add an identity provider following interactive prompts
moactl create idp --cluster=mycluster --interactive`,
rosa create idp --cluster=mycluster --interactive`,
Run: run,
}

Expand Down Expand Up @@ -426,7 +425,7 @@ func run(cmd *cobra.Command, _ []string) {
reporter.Infof(
"Identity Provider '%s' has been created.\n"+
" It will take up to 1 minute for this configuration to be enabled.\n"+
" To add cluster administrators, see 'moactl create user --help'.\n"+
" To add cluster administrators, see 'rosa create user --help'.\n"+
" To login into the console, open %s and click on %s.",
idpName, cluster.Console().URL(), idpName,
)
Expand Down
6 changes: 3 additions & 3 deletions cmd/create/ingress/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ var Cmd = &cobra.Command{
Short: "Add Ingress to cluster",
Long: "Add an Ingress endpoint to determine API access to the cluster.",
Example: ` # Add an internal ingress to a cluster named "mycluster"
moactl create ingress --private --cluster=mycluster
rosa create ingress --private --cluster=mycluster
# Add a public ingress to a cluster
moactl create ingress --cluster=mycluster
rosa create ingress --cluster=mycluster
# Add an ingress with route selector label match
moactl create ingress -c mycluster --label-match="foo=bar,bar=baz"`,
rosa create ingress -c mycluster --label-match="foo=bar,bar=baz"`,
Run: run,
}

Expand Down
6 changes: 3 additions & 3 deletions cmd/create/user/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ var Cmd = &cobra.Command{
Short: "Configure user access for cluster",
Long: "Configure user access for cluster",
Example: ` # Add a user to the cluster-admins group
moactl create user --cluster=mycluster --cluster-admins=myusername
rosa create user --cluster=mycluster --cluster-admins=myusername
# Add a user to the dedicated-admins group
moactl create user --cluster=mycluster --dedicated-admins=myusername
rosa create user --cluster=mycluster --dedicated-admins=myusername
# Add a user following interactive prompts
moactl create user --cluster=mycluster`,
rosa create user --cluster=mycluster`,
Run: run,
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/describe/addon/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var Cmd = &cobra.Command{
Short: "Show details of an add-on",
Long: "Show details of an add-on",
Example: ` # Describe an add-on named "codeready-workspaces"
moactl describe addon codeready-workspaces`,
rosa describe addon codeready-workspaces`,
Run: run,
}

Expand Down Expand Up @@ -76,7 +76,7 @@ func run(_ *cobra.Command, argv []string) {
addOn, err := ocm.GetAddOn(addOnsCollection, addOnID)
if err != nil {
reporter.Errorf("Failed to get add-on '%s': %s\n"+
"Try running 'moactl list addons' to see all available add-ons.",
"Try running 'rosa list addons' to see all available add-ons.",
addOnID, err)
os.Exit(1)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/describe/admin/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var Cmd = &cobra.Command{
Short: "Show details of the cluster-admin user",
Long: "Show details of the cluster-admin user and a command to login to the cluster",
Example: ` # Describe cluster-admin user of a cluster named mycluster
moactl describe admin -c mycluster`,
rosa describe admin -c mycluster`,
Run: run,
}

Expand Down Expand Up @@ -137,7 +137,7 @@ func run(cmd *cobra.Command, _ []string) {
}
if idp == nil || idp.Htpasswd() == nil {
reporter.Warnf("There is no admin on cluster '%s'. To create it run the following command:\n"+
" moactl create admin -c %s", clusterKey, clusterKey)
" rosa create admin -c %s", clusterKey, clusterKey)
os.Exit(0)
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/describe/cluster/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ var Cmd = &cobra.Command{
Short: "Show details of a cluster",
Long: "Show details of a cluster",
Example: ` # Describe a cluster named "mycluster"
moactl describe cluster mycluster
rosa describe cluster mycluster
# Describe a cluster using the --cluster flag
moactl describe cluster --cluster=mycluster`,
rosa describe cluster --cluster=mycluster`,
Run: run,
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/dlt/admin/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var Cmd = &cobra.Command{
Short: "Deletes the admin user",
Long: "Deletes the cluster-admin user used to login to the cluster",
Example: ` # Delete the admin user
moactl delete admin --cluster=mycluster`,
rosa delete admin --cluster=mycluster`,
Run: run,
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/dlt/cluster/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ var Cmd = &cobra.Command{
Short: "Delete cluster",
Long: "Delete cluster.",
Example: ` # Delete a cluster named "mycluster"
moactl delete cluster mycluster
rosa delete cluster mycluster
# Delete a cluster using the --cluster flag
moactl delete cluster --cluster=mycluster`,
rosa delete cluster --cluster=mycluster`,
Run: run,
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/dlt/idp/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var Cmd = &cobra.Command{
Short: "Delete cluster IDPs",
Long: "Delete a specific identity provider for a cluster.",
Example: ` # Delete an identity provider named github-1
moactl delete idp github-1 --cluster=mycluster`,
rosa delete idp github-1 --cluster=mycluster`,
Run: run,
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/dlt/ingress/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ var Cmd = &cobra.Command{
Short: "Delete cluster ingress",
Long: "Delete the additional non-default application router for a cluster.",
Example: ` # Delete ingress with ID a1b2 from a cluster named 'mycluster'
moactl delete ingress --cluster=mycluster a1b2
rosa delete ingress --cluster=mycluster a1b2
# Delete secondary ingress using the sub-domain name
moactl delete ingress --cluster=mycluster apps2`,
rosa delete ingress --cluster=mycluster apps2`,
Run: run,
}

Expand Down
6 changes: 3 additions & 3 deletions cmd/dlt/user/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ var Cmd = &cobra.Command{
Short: "Delete cluster users",
Long: "Delete administrative cluster users.",
Example: ` # Delete a user from the cluster-admins group
moactl delete user --cluster=mycluster --cluster-admins=myusername
rosa delete user --cluster=mycluster --cluster-admins=myusername
# Delete a user from the dedicated-admins group
moactl delete user --cluster=mycluster --dedicated-admins=myusername
rosa delete user --cluster=mycluster --dedicated-admins=myusername
# Delete a user following interactive prompts
moactl delete user --cluster=mycluster`,
rosa delete user --cluster=mycluster`,
Run: run,
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/docs/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func run(cmd *cobra.Command, _ []string) (err error) {
err = doc.GenMarkdownTree(cmd.Root(), args.dir)
case "man":
header := &doc.GenManHeader{
Title: "MOACTL",
Title: "ROSA",
Section: "1",
Source: "Copyright (c) 2020 Red Hat, Inc.",
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/download/oc/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var Cmd = &cobra.Command{
Short: "Download OpenShift client tools",
Long: "Downloads to latest compatible version of the OpenShift client tools.",
Example: ` # Download oc client tools
moactl download oc`,
rosa download oc`,
Run: run,
}

Expand Down
6 changes: 3 additions & 3 deletions cmd/edit/cluster/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ var Cmd = &cobra.Command{
Short: "Edit cluster",
Long: "Edit cluster.",
Example: ` # Edit a cluster named "mycluster" to make it private
moactl edit cluster mycluster --private
rosa edit cluster mycluster --private
# Enable the cluster-admins group using the --cluster flag
moactl edit cluster --cluster=mycluster --enable-cluster-admins
rosa edit cluster --cluster=mycluster --enable-cluster-admins
# Edit all options interactively
moactl edit cluster -c mycluster --interactive`,
rosa edit cluster -c mycluster --interactive`,
Run: run,
}

Expand Down
Loading

0 comments on commit 4132824

Please sign in to comment.