Skip to content

Commit

Permalink
Add option to pass enableOCI (#209)
Browse files Browse the repository at this point in the history
* Add option to specify if repo server is OCI compliant

* Add enable_oci in docs for Argument Reference

Co-authored-by: Daniel Kem <[email protected]>
  • Loading branch information
Danielkem and Danielkem authored Oct 17, 2022
1 parent 2dbefb5 commit 47115ea
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions argocd/schema_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ func repositorySchema() map[string]*schema.Schema {
// TODO: add a validator
Optional: true,
},
"enable_oci": {
Type: schema.TypeBool,
Description: "Specify whether the repo server should be viewed as OCI compliant",
Optional: true,
},
"type": {
Type: schema.TypeString,
Description: "type of the repo, may be 'git' or 'helm', defaults to 'git'",
Expand Down
5 changes: 5 additions & 0 deletions argocd/schema_repository_credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,10 @@ func repositoryCredentialsSchema() map[string]*schema.Schema {
// TODO: add a validator
Optional: true,
},
"enable_oci": {
Type: schema.TypeBool,
Description: "Specify whether the repo server should be viewed as OCI compliant",
Optional: true,
},
}
}
3 changes: 3 additions & 0 deletions argocd/structure_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ func expandRepository(d *schema.ResourceData) *application.Repository {
if v, ok := d.GetOk("tls_client_cert_key"); ok {
repository.TLSClientCertKey = v.(string)
}
if v, ok := d.GetOk("enable_oci"); ok {
repository.EnableOCI = v.(bool)
}
if v, ok := d.GetOk("type"); ok {
repository.Type = v.(string)
}
Expand Down
3 changes: 3 additions & 0 deletions argocd/structure_repository_credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ func expandRepositoryCredentials(d *schema.ResourceData) *application.RepoCreds
if v, ok := d.GetOk("tls_client_cert_key"); ok {
repoCreds.TLSClientCertKey = v.(string)
}
if v, ok := d.GetOk("enable_oci"); ok {
repoCreds.EnableOCI = v.(bool)
}
return repoCreds
}

Expand Down
1 change: 1 addition & 0 deletions docs/resources/repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ resource "argocd_repository" "private" {
* `ssh_private_key` - (Optional), string, SSH private key data to authenticate against the repository server. **Only for Git repositories**.
* `tls_client_cert_data` - (Optional), TLS client cert data to authenticate against the repository server.
* `tls_client_cert_key` - (Optional), TLS client cert key to authenticate against the repository server.
* `enable_oci` - (Optional), specify whether the repository server should be viewed as OCI compliant.

# Exported Attributes

Expand Down
1 change: 1 addition & 0 deletions docs/resources/repository_credentials.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ resource "argocd_repository" "private" {
* `ssh_private_key` - (Optional), string, SSH private key data to authenticate against the repository server. **Only for Git repositories**.
* `tls_client_cert_data` - (Optional), TLS client cert data to authenticate against the repository server.
* `tls_client_cert_key` - (Optional), TLS client cert key to authenticate against the repository server.
* `enable_oci` - (Optional), specify whether the repository server should be viewed as OCI compliant.

## Import

Expand Down

0 comments on commit 47115ea

Please sign in to comment.