Skip to content
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

Merged
merged 12 commits into from
Aug 23, 2024
Merged

133 bug bash script fixes #139

merged 12 commits into from
Aug 23, 2024

Conversation

ichung08
Copy link
Collaborator

@ichung08 ichung08 commented Aug 22, 2024

Description

  • Fix issues in script and improve the user experience
  • improve data source docs

🎟 Issue(s)

🧪 Functional Testing

📸 Screenshots

📋 Checklist

  • Added/updated applicable tests
  • Added/updated examples in the examples/ directory
  • Updated any related documentation

@ichung08 ichung08 self-assigned this Aug 22, 2024
@@ -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")
Copy link
Collaborator Author

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?

Copy link
Collaborator

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")
Copy link
Collaborator Author

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 {
Copy link
Collaborator Author

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

@ichung08 ichung08 marked this pull request as ready for review August 22, 2024 19:10
@ichung08 ichung08 requested review from vandyliu, sunkickr and a team as code owners August 22, 2024 19:10
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
docs/data-sources/api_token.md Outdated Show resolved Hide resolved
docs/data-sources/api_tokens.md Outdated Show resolved Hide resolved
docs/data-sources/workspace.md Show resolved Hide resolved
@@ -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")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep

@ichung08 ichung08 merged commit dd5c6f3 into main Aug 23, 2024
9 checks passed
@ichung08 ichung08 deleted the 133-bug-bash-script-fixes branch August 23, 2024 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants