Skip to content

Commit

Permalink
Add log and lint changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aravindnswamy committed Feb 8, 2024
1 parent b4b7f3e commit 65993a9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions internal/argocd/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ package argocd
import (
"context"
"io"
"log"

argocdclient "github.com/argoproj/argo-cd/v2/pkg/apiclient"
applicationpkg "github.com/argoproj/argo-cd/v2/pkg/apiclient/application"
argoio "github.com/argoproj/argo-cd/v2/util/io"
)

//nolint:lll // go generate is ugly.
// Interface is an interface for API.
//
//nolint:lll // go generate is ugly.
type Interface interface {
Sync(appName string) error
}
Expand All @@ -23,8 +25,8 @@ type API struct {

// APIOptions is options for API.
type APIOptions struct {
Address string
Token string
Address string
Token string
DisableTlsVerification bool
}

Expand All @@ -34,10 +36,13 @@ func NewAPI(options *APIOptions) API {
ServerAddr: options.Address,
AuthToken: options.Token,
GRPCWeb: true,
Insecure: options.DisableTlsVerification,
Insecure: options.DisableTlsVerification,
}

connection, client := argocdclient.NewClientOrDie(&clientOptions).NewApplicationClientOrDie()
if options.DisableTlsVerification {
log.Println("Skip TLS Validation option is enabled")
}

return API{client: client, connection: connection}
}
Expand Down

0 comments on commit 65993a9

Please sign in to comment.