-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
133 bug bash script fixes #139
Conversation
@@ -33,7 +35,7 @@ func main() { | |||
log.Println("Terraform Import Script Starting") | |||
|
|||
// collect all arguments from the user, indicating all the resources that need to be imported | |||
resourcesPtr := flag.String("resources", "", "Comma separated list of resources to import. The only accepted values are workspace, deployment, cluster, api_token, team, team_roles, user_roles") | |||
resourcesPtr := flag.String("resources", "workspace,deployment,cluster,api_token,team,team_roles,user_roles", "Comma separated list of resources to import. The only accepted values are workspace, deployment, cluster, api_token, team, team_roles, user_roles") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added default value
when users run ./import_script
even when -resource
flag is not set we will automatically default to importing all resources - is this ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep
} | ||
|
||
// Define the minimum required version | ||
minVersion, _ := version.NewVersion("1.7.0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
asks users to update terraform if version is not > 1.7.0
@@ -269,6 +275,70 @@ func printHelp() { | |||
log.Println("\nNote: If the -token flag is not provided, the script will attempt to use the ASTRO_API_TOKEN environment variable.") | |||
} | |||
|
|||
func checkRequiredArguments(resourcesPtr string, tokenPtr string, organizationIdPtr string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checks that required args are set
@@ -33,7 +35,7 @@ func main() { | |||
log.Println("Terraform Import Script Starting") | |||
|
|||
// collect all arguments from the user, indicating all the resources that need to be imported | |||
resourcesPtr := flag.String("resources", "", "Comma separated list of resources to import. The only accepted values are workspace, deployment, cluster, api_token, team, team_roles, user_roles") | |||
resourcesPtr := flag.String("resources", "workspace,deployment,cluster,api_token,team,team_roles,user_roles", "Comma separated list of resources to import. The only accepted values are workspace, deployment, cluster, api_token, team, team_roles, user_roles") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep
Description
🎟 Issue(s)
🧪 Functional Testing
📸 Screenshots
📋 Checklist
examples/
directory