-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add buttons to select between AWS and GCP * Revert "Add buttons to select between AWS and GCP" This reverts commit 3659d09. * Add screen to select between multiple cloud provider * add feature to go back to cloud selection screen * Add gcp storage view * Separate GCP and AWS resource screens * Add header in gcp * Add cloud selection flags * Fix page switching * Add sub-commands to select aws or gcp * Fix csv creation for gcp resources * Seperate gcp and aws commands and validate aws profile and region * Fix tests * storge partial commit * Implement folder view in storage resource * Add dowloand object functionality to gcp storage bucket * Add functionality to get pre-signed url * Change storage_buck_obj file name to storage_bucket_obj * improve cloud selection ui * Enable use of localstack with aws sub-command * Fix region flag in aws sub command * Remove unused code and add comment * Fix prompt on gcp screen * Add cloudlens logo * aws credentials bug fix * Refactor getCfg function to handle multiple config methods * Add test cases for storage resource --------- Co-authored-by: pratikjethe <pratikjethe93@gmail.com> Co-authored-by: Ramana Reddy <ramanaredy.manda@gmail.com>
- Loading branch information
1 parent
c6a4d2d
commit 70274b4
Showing
39 changed files
with
1,454 additions
and
274 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/one2nc/cloudlens/internal" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func awsCommand() *cobra.Command { | ||
|
||
command := cobra.Command{ | ||
Use: "aws", | ||
Short: "Select aws", | ||
Long: "Selects aws as default cloud", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
selectAWS() | ||
}, | ||
} | ||
|
||
command.Flags().StringVarP(&profile, "profile", "p", "default", "Read aws profile") | ||
|
||
command.Flags().StringVarP(®ion, "region", "r", "", "Read aws region") | ||
command.Flags().BoolVarP(&useLocalStack, "localstack", "l", false, "Use localsatck instead of AWS") | ||
|
||
return &command | ||
} | ||
|
||
func selectAWS() { | ||
cloudConfig.SelectedCloud = internal.AWS | ||
cloudConfig.AWSConfig.Profile = profile | ||
cloudConfig.AWSConfig.Region = region | ||
cloudConfig.AWSConfig.UseLocalStack = useLocalStack | ||
|
||
initView() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package cmd | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/one2nc/cloudlens/internal" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func gcpCommand() *cobra.Command { | ||
|
||
command := cobra.Command{ | ||
Use: "gcp", | ||
Short: "Select gcp (set GOOGLE_APPLICATION_CREDENTIALS env variable or use \"gcp\" sub-command )", | ||
Long: "Selects gcp as default cloud", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
selectGCP() | ||
}, | ||
} | ||
|
||
command.Flags().StringVarP(&gcpCredFilePath, "cf", "", "", "Read GCP credential file") | ||
command.MarkFlagRequired("cf") | ||
return &command | ||
} | ||
|
||
func selectGCP() { | ||
cloudConfig.SelectedCloud = internal.GCP | ||
os.Setenv("GOOGLE_APPLICATION_CREDENTIALS", gcpCredFilePath) | ||
cloudConfig.CredFilePath = gcpCredFilePath | ||
|
||
initView() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.