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

chore: clean up #778

Merged
merged 1 commit into from
Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cmd/destroyLocalGithub.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ var destroyLocalGithubCmd = &cobra.Command{
Short: "A brief description of your command",
Long: `TDB`,
RunE: func(cmd *cobra.Command, args []string) error {
fmt.Println("destroy-local-github called")
config := configs.ReadConfig()

destroyFlags, err := flagset.ProcessDestroyFlags(cmd)
Expand Down
4 changes: 0 additions & 4 deletions cmd/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ func runLocal(cmd *cobra.Command, args []string) error {
// todo need to add go channel to control when ngrok should close
// and use context to handle closing the open goroutine/connection
go pkg.RunNgrok(context.TODO(), pkg.LocalAtlantisURL)
time.Sleep(5 * time.Second)

if !viper.GetBool("kubefirst.done") {
if viper.GetString("gitprovider") == "github" {
Expand Down Expand Up @@ -276,9 +275,6 @@ func runLocal(cmd *cobra.Command, args []string) error {

k8s.LoopUntilPodIsReady(dryRun)

// todo: can I remove it?
time.Sleep(20 * time.Second)

// configure vault with terraform
executionControl = viper.GetBool("terraform.vault.apply.complete")
if !executionControl {
Expand Down
19 changes: 9 additions & 10 deletions internal/argocd/argocd.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,21 +319,20 @@ func ApplyRegistry(dryRun bool) error {
func ApplyRegistryLocal(dryRun bool) error {
config := configs.ReadConfig()

if viper.GetBool("argocd.registry.applied") {
if viper.GetBool("argocd.registry.applied") || dryRun {
log.Println("skipped ApplyRegistryLocal - ")
return nil
}

if !dryRun {
_, _, err := pkg.ExecShellReturnStrings(config.KubectlClientPath, "--kubeconfig", config.KubeConfigPath, "-n", "argocd", "apply", "-f", fmt.Sprintf("%s/gitops/registry.yaml", config.K1FolderPath))
if err != nil {
log.Printf("failed to execute localhost kubectl apply of registry-base: %s", err)
return err
}
time.Sleep(45 * time.Second)
viper.Set("argocd.registry.applied", true)
viper.WriteConfig()
_, _, err := pkg.ExecShellReturnStrings(config.KubectlClientPath, "--kubeconfig", config.KubeConfigPath, "-n", "argocd", "apply", "-f", fmt.Sprintf("%s/gitops/registry.yaml", config.K1FolderPath))
if err != nil {
log.Printf("failed to execute localhost kubectl apply of registry-base: %s", err)
return err
}
time.Sleep(45 * time.Second)
viper.Set("argocd.registry.applied", true)
viper.WriteConfig()

return nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ func UpdateTerraformS3BackendForLocalhostAddress() error {
"http://minio.minio.svc.cluster.local:9000",
MinioURL,
); err != nil {
return err
log.Println(err)
}
}

Expand Down