Skip to content

Commit

Permalink
Add option to pass Client Certificate and Key (#187)
Browse files Browse the repository at this point in the history
* Add option to pass Client Certificate and Key

* update darwin build

* remote extra test

* Revert "remote extra test"

This reverts commit 98d15c2.
  • Loading branch information
marcelobartsch-jt authored Aug 3, 2022
1 parent 1917df8 commit 408af72
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ windows: fmtcheck
darwin: fmtcheck
@mkdir -p bin/
GOOS=darwin GOARCH=amd64 go build -v -o bin/$(BINARY)_$(VERSION)_darwin_amd64
GOOS=darwin GOARCH=386 go build -v -o bin/$(BINARY)_$(VERSION)_darwin_x86
GOOS=darwin GOARCH=arm64 go build -v -o bin/$(BINARY)_$(VERSION)_darwin_arm64

freebsd: fmtcheck
@mkdir -p bin/
Expand Down
14 changes: 14 additions & 0 deletions argocd/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ func Provider() *schema.Provider {
Type: schema.TypeString,
Optional: true,
},
"client_cert_file": {
Type: schema.TypeString,
Optional: true,
},
"client_cert_key": {
Type: schema.TypeString,
Optional: true,
},
"plain_text": {
Type: schema.TypeBool,
Optional: true,
Expand Down Expand Up @@ -203,6 +211,12 @@ func initApiClient(d *schema.ResourceData) (
if v, ok := d.GetOk("cert_file"); ok {
opts.CertFile = v.(string)
}
if v, ok := d.GetOk("client_cert_file"); ok {
opts.ClientCertFile = v.(string)
}
if v, ok := d.GetOk("client_cert_key"); ok {
opts.ClientCertKeyFile = v.(string)
}
if v, ok := d.GetOk("context"); ok {
opts.Context = v.(string)
}
Expand Down
2 changes: 2 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ provider "argocd" {
* `username` - (Optional) authentication username. Can be set through the `ARGOCD_AUTH_USERNAME` environment variable.
* `password` - (Optional) authentication password. Can be set through the `ARGOCD_AUTH_PASSWORD` environment variable.
* `cert_file` - (Optional) Additional root CA certificates file to add to the client TLS connection pool.
* `client_cert_file` - (Optional) Client Certificate.
* `client_cert_key` - (Optional) Client Certificate Key.
* `plain_text` - (Optional) Boolean, whether to initiate an unencrypted connection to ArgoCD server.
* `context` - (Optional) Kubernetes context to load from an existing `.kube/config` file. Can be set through `ARGOCD_CONTEXT` environment variable.
* `user_agent` - (Optional)
Expand Down

0 comments on commit 408af72

Please sign in to comment.