Skip to content

Commit

Permalink
Merge pull request #9 from liornoy/specify-static-entries-namespace
Browse files Browse the repository at this point in the history
Specify static entries namespace
  • Loading branch information
sabinaaledort authored Jul 2, 2024
2 parents 5d707fe + 8e1c369 commit cbcd3d4
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 106 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Examples are available in the `example-custom-entries` files.
The following environment variables are used to configure:
```
FORMAT (csv/json/yaml)
CLUSTER_ENV (baremetal/aws)
CLUSTER_ENV (baremetal/cloud)
DEST_DIR (path to the directory containing the artifacts)
DEPLOYMENT (mno/sno)
CUSTOM_ENTRIES_PATH (path to the file containing custom entries to add to the matrix)
Expand Down
6 changes: 3 additions & 3 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func main() {

flag.StringVar(&destDir, "destDir", "communication-matrix", "Output files dir")
flag.StringVar(&format, "format", "csv", "Desired format (json,yaml,csv)")
flag.StringVar(&envStr, "env", "baremetal", "Cluster environment (baremetal/aws)")
flag.StringVar(&envStr, "env", "baremetal", "Cluster environment (baremetal/cloud)")
flag.StringVar(&deploymentStr, "deployment", "mno", "Deployment type (mno/sno)")
flag.StringVar(&customEntriesPath, "customEntriesPath", "", "Add custom entries from a file to the matrix")
flag.StringVar(&customEntriesFormat, "customEntriesFormat", "", "Set the format of the custom entries file (json,yaml,csv)")
Expand All @@ -60,8 +60,8 @@ func main() {
switch envStr {
case "baremetal":
env = commatrix.Baremetal
case "aws":
env = commatrix.AWS
case "cloud":
env = commatrix.Cloud
default:
panic(fmt.Sprintf("invalid cluster environment: %s", envStr))
}
Expand Down
8 changes: 4 additions & 4 deletions commatrix/commatrix.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type Env int

const (
Baremetal Env = iota
AWS
Cloud
)

type Deployment int
Expand Down Expand Up @@ -125,12 +125,12 @@ func getStaticEntries(e Env, d Deployment) ([]types.ComDetails, error) {
break
}
comDetails = append(comDetails, baremetalStaticEntriesWorker...)
case AWS:
comDetails = append(comDetails, awsCloudStaticEntriesMaster...)
case Cloud:
comDetails = append(comDetails, cloudStaticEntriesMaster...)
if d == SNO {
break
}
comDetails = append(comDetails, awsCloudStaticEntriesWorker...)
comDetails = append(comDetails, cloudStaticEntriesWorker...)
default:
return nil, fmt.Errorf("invalid value for cluster environment")
}
Expand Down
Loading

0 comments on commit cbcd3d4

Please sign in to comment.