Skip to content
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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/fatih/color v1.18.0
github.com/google/go-cmp v0.7.0
github.com/kong/go-apiops v0.2.0
github.com/kong/go-database-reconciler v1.29.0
github.com/kong/go-database-reconciler v1.29.1
github.com/kong/go-kong v0.69.0
github.com/mitchellh/go-homedir v1.1.0
github.com/spf13/cobra v1.9.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/q
github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
github.com/kong/go-apiops v0.2.0 h1:QzHmEvl12vr3lxayTuY40dFuQpPECHTvopsILpwuLdE=
github.com/kong/go-apiops v0.2.0/go.mod h1:yPwbl3P2eQinVGAEA0d3legaYmzPJ+WtJf9fSeGF4b8=
github.com/kong/go-database-reconciler v1.29.0 h1:C+gktZVLTpyw2ausZuXdfOluM7mxp926P3Izn3hC0KQ=
github.com/kong/go-database-reconciler v1.29.0/go.mod h1:DnqxRK/TH8HugJca1cw2n1NCApaNgpzEZhXUzITU0Ro=
github.com/kong/go-database-reconciler v1.29.1 h1:YC6AaHTcaGJMd/j38YbEIwhNXtwPjGT9vhZ4tHsX388=
github.com/kong/go-database-reconciler v1.29.1/go.mod h1:DnqxRK/TH8HugJca1cw2n1NCApaNgpzEZhXUzITU0Ro=
github.com/kong/go-kong v0.69.0 h1:1LHU3y+i23X+RxxXT/bKml5bsxeUfKTfWFa3RK85cSU=
github.com/kong/go-kong v0.69.0/go.mod h1:J0vGB3wsZ2i99zly1zTRe3v7rOKpkhQZRwbcTFP76qM=
github.com/kong/go-slugify v1.0.0 h1:vCFAyf2sdoSlBtLcrmDWUFn0ohlpKiKvQfXZkO5vSKY=
Expand Down
23 changes: 23 additions & 0 deletions tests/integration/dump_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,11 @@ func Test_Dump_SkipDefaults_Konnect(t *testing.T) {
stateFile: "testdata/dump/009-skip-defaults/konnect/plugin-partial-2.yaml",
expectedFile: "testdata/dump/009-skip-defaults/konnect/plugin-partial-2.expected.yaml",
},
{
name: "dump skip-defaults: vaults",
stateFile: "testdata/dump/009-skip-defaults/konnect/vaults.yaml",
expectedFile: "testdata/dump/009-skip-defaults/konnect/vaults.expected.yaml",
},
}

for _, tc := range tests {
Expand Down Expand Up @@ -1010,6 +1015,24 @@ func Test_Dump_SkipDefaults(t *testing.T) {
expectedFile: "testdata/dump/009-skip-defaults/enterprise/3.10+/plugin-partial-2.expected.yaml",
runWhen: func(t *testing.T) { runWhen(t, "enterprise", ">=3.10.0") },
},
{
name: "vaults skip-defaults 3.4",
stateFile: "testdata/dump/009-skip-defaults/enterprise/3.4/vaults.yaml",
expectedFile: "testdata/dump/009-skip-defaults/enterprise/3.4/vaults.expected.yaml",
runWhen: func(t *testing.T) { runWhen(t, "enterprise", ">=3.4.0 <3.5.0") },
},
{
name: "vaults skip-defaults 3.10+",
stateFile: "testdata/dump/009-skip-defaults/enterprise/3.4/vaults.yaml",
expectedFile: "testdata/dump/009-skip-defaults/enterprise/3.4/vaults.expected.yaml",
runWhen: func(t *testing.T) { runWhen(t, "enterprise", ">=3.10.0") },
},
{
name: "vaults skip-defaults 3.11+",
stateFile: "testdata/dump/009-skip-defaults/enterprise/3.11+/vaults.yaml",
expectedFile: "testdata/dump/009-skip-defaults/enterprise/3.11+/vaults.expected.yaml",
runWhen: func(t *testing.T) { runWhen(t, "enterprise", ">=3.11.0") },
},
}

for _, tc := range tests {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
_format_version: "3.0"
vaults:
- config:
account: test-ac
api_key: test-key
endpoint_url: http://example-server.test
login: test-id
name: conjur
prefix: my-conjur-vault
tags:
- tag1
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
_format_version: "3.0"
vaults:
- config:
account: test-ac
api_key: test-key
auth_method: api_key
base64_decode: false
endpoint_url: http://example-server.test
login: test-id
neg_ttl: null
resurrect_ttl: null
ttl: null
name: conjur
prefix: my-conjur-vault
tags:
- tag1
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
_format_version: "3.0"
vaults:
- config:
endpoint_url: https://example-aws.com
region: us-east-1
name: aws
prefix: my-aws-vault
tags:
- tag1
- config:
location: test-location
vault_uri: http://azure-vault.test
name: azure
prefix: my-azure-vault
tags:
- tag1
- config:
prefix: TEST_
name: env
prefix: my-env-vault
tags:
- tag1
- config:
project_id: test-123
name: gcp
prefix: my-gcp-vault
tags:
- tag1
- config:
token: example-token
name: hcv
prefix: my-hcv-vault1
tags:
- tag1
- config:
auth_method: kubernetes
kube_api_token_file: test-file
kube_role: test-role
name: hcv
prefix: my-hcv-vault2
tags:
- tag1
- config:
approle_response_wrapping: true
approle_role_id: test-id-123
approle_secret_id: test-secret-123
auth_method: approle
name: hcv
prefix: my-hcv-vault3
tags:
- tag2
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
_format_version: "3.0"
vaults:
- config:
endpoint_url: https://example-aws.com
region: us-east-1
name: aws
prefix: my-aws-vault
tags:
- tag1
- config:
location: test-location
vault_uri: http://azure-vault.test
name: azure
prefix: my-azure-vault
tags:
- tag1
- config:
prefix: TEST_
name: env
prefix: my-env-vault
tags:
- tag1
- config:
project_id: test-123
name: gcp
prefix: my-gcp-vault
tags:
- tag1
- config:
token: example-token
name: hcv
prefix: my-hcv-vault1
tags:
- tag1
- config:
auth_method: kubernetes
kube_api_token_file: test-file
kube_role: test-role
name: hcv
prefix: my-hcv-vault2
tags:
- tag1
- config:
approle_response_wrapping: true
approle_role_id: test-id-123
approle_secret_id: test-secret-123
auth_method: approle
name: hcv
prefix: my-hcv-vault3
tags:
- tag2
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
_format_version: "3.0"
_konnect:
control_plane_name: default
vaults:
- config:
endpoint_url: https://example-aws.com
region: us-east-1
name: aws
prefix: my-aws-vault
tags:
- tag1
- config:
endpoint_url: https://example-aws.com
region: ap-south-1
name: aws
prefix: my-aws-vault-2
tags:
- tag1
- config:
location: test-location
vault_uri: http://azure-vault.test
name: azure
prefix: my-azure-vault
tags:
- tag1
- config:
account: test-ac
api_key: test-key
endpoint_url: http://example-server.test
login: test-id
name: conjur
prefix: my-conjur-vault
tags:
- tag1
- config:
prefix: TEST_
name: env
prefix: my-env-vault
tags:
- tag1
- config:
project_id: test-123
name: gcp
prefix: my-gcp-vault
tags:
- tag1
- config:
host: 127.0.0.1
port: 8200
token: example-token
name: hcv
prefix: my-hcv-vault1
tags:
- tag1
- config:
auth_method: kubernetes
host: 127.0.0.1
kube_api_token_file: test-file
kube_role: test-role
port: 8200
name: hcv
prefix: my-hcv-vault2
tags:
- tag1
- config:
approle_response_wrapping: true
approle_role_id: test-id-123
approle_secret_id: test-secret-123
auth_method: approle
host: 127.0.0.1
port: 8200
name: hcv
prefix: my-hcv-vault3
tags:
- tag2
102 changes: 102 additions & 0 deletions tests/integration/testdata/dump/009-skip-defaults/konnect/vaults.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
_format_version: "3.0"
_konnect:
control_plane_name: default
vaults:
- config:
base64_decode: false
endpoint_url: https://example-aws.com
region: us-east-1
role_session_name: KongVault
name: aws
prefix: my-aws-vault
tags:
- tag1
- config:
base64_decode: false
endpoint_url: https://example-aws.com
region: ap-south-1
role_session_name: KongVault
name: aws
prefix: my-aws-vault-2
tags:
- tag1
- config:
base64_decode: false
credentials_prefix: AZURE
location: test-location
type: secrets
vault_uri: http://azure-vault.test
name: azure
prefix: my-azure-vault
tags:
- tag1
- config:
account: test-ac
api_key: test-key
auth_method: api_key
base64_decode: false
endpoint_url: http://example-server.test
login: test-id
name: conjur
prefix: my-conjur-vault
tags:
- tag1
- config:
base64_decode: false
prefix: TEST_
name: env
prefix: my-env-vault
tags:
- tag1
- config:
base64_decode: false
project_id: test-123
name: gcp
prefix: my-gcp-vault
tags:
- tag1
- config:
auth_method: token
base64_decode: false
host: 127.0.0.1
kube_auth_path: kubernetes
kv: v1
mount: secret
port: 8200
protocol: http
token: example-token
name: hcv
prefix: my-hcv-vault1
tags:
- tag1
- config:
auth_method: kubernetes
base64_decode: false
host: 127.0.0.1
kube_api_token_file: test-file
kube_auth_path: kubernetes
kube_role: test-role
kv: v1
mount: secret
port: 8200
protocol: http
name: hcv
prefix: my-hcv-vault2
tags:
- tag1
- config:
approle_response_wrapping: true
approle_role_id: test-id-123
approle_secret_id: test-secret-123
auth_method: approle
base64_decode: false
host: 127.0.0.1
kube_auth_path: kubernetes
kv: v1
mount: secret
port: 8200
protocol: http
name: hcv
prefix: my-hcv-vault3
tags:
- tag2
Loading