Skip to content

Commit 47115ea

Browse files
authored
Add option to pass enableOCI (#209)
* 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]>
1 parent 2dbefb5 commit 47115ea

File tree

6 files changed

+18
-0
lines changed

6 files changed

+18
-0
lines changed

argocd/schema_repository.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ func repositorySchema() map[string]*schema.Schema {
6464
// TODO: add a validator
6565
Optional: true,
6666
},
67+
"enable_oci": {
68+
Type: schema.TypeBool,
69+
Description: "Specify whether the repo server should be viewed as OCI compliant",
70+
Optional: true,
71+
},
6772
"type": {
6873
Type: schema.TypeString,
6974
Description: "type of the repo, may be 'git' or 'helm', defaults to 'git'",

argocd/schema_repository_credentials.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,10 @@ func repositoryCredentialsSchema() map[string]*schema.Schema {
4242
// TODO: add a validator
4343
Optional: true,
4444
},
45+
"enable_oci": {
46+
Type: schema.TypeBool,
47+
Description: "Specify whether the repo server should be viewed as OCI compliant",
48+
Optional: true,
49+
},
4550
}
4651
}

argocd/structure_repository.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ func expandRepository(d *schema.ResourceData) *application.Repository {
4040
if v, ok := d.GetOk("tls_client_cert_key"); ok {
4141
repository.TLSClientCertKey = v.(string)
4242
}
43+
if v, ok := d.GetOk("enable_oci"); ok {
44+
repository.EnableOCI = v.(bool)
45+
}
4346
if v, ok := d.GetOk("type"); ok {
4447
repository.Type = v.(string)
4548
}

argocd/structure_repository_credentials.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ func expandRepositoryCredentials(d *schema.ResourceData) *application.RepoCreds
3131
if v, ok := d.GetOk("tls_client_cert_key"); ok {
3232
repoCreds.TLSClientCertKey = v.(string)
3333
}
34+
if v, ok := d.GetOk("enable_oci"); ok {
35+
repoCreds.EnableOCI = v.(bool)
36+
}
3437
return repoCreds
3538
}
3639

docs/resources/repository.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ resource "argocd_repository" "private" {
3838
* `ssh_private_key` - (Optional), string, SSH private key data to authenticate against the repository server. **Only for Git repositories**.
3939
* `tls_client_cert_data` - (Optional), TLS client cert data to authenticate against the repository server.
4040
* `tls_client_cert_key` - (Optional), TLS client cert key to authenticate against the repository server.
41+
* `enable_oci` - (Optional), specify whether the repository server should be viewed as OCI compliant.
4142

4243
# Exported Attributes
4344

docs/resources/repository_credentials.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ resource "argocd_repository" "private" {
2626
* `ssh_private_key` - (Optional), string, SSH private key data to authenticate against the repository server. **Only for Git repositories**.
2727
* `tls_client_cert_data` - (Optional), TLS client cert data to authenticate against the repository server.
2828
* `tls_client_cert_key` - (Optional), TLS client cert key to authenticate against the repository server.
29+
* `enable_oci` - (Optional), specify whether the repository server should be viewed as OCI compliant.
2930

3031
## Import
3132

0 commit comments

Comments
 (0)