From e00257472974647fcacf55a237712dc975ab8f19 Mon Sep 17 00:00:00 2001 From: MinUk Song Date: Tue, 9 Jan 2024 18:41:07 +0900 Subject: [PATCH] fix: Fix query opreator --- docs/data-sources/accounts.md | 2 +- docs/data-sources/cidrs.md | 6 +++--- docs/data-sources/clusterrolebindings.md | 2 +- docs/data-sources/clusters.md | 2 +- docs/data-sources/images.md | 4 ++-- docs/data-sources/namespaces.md | 2 +- docs/data-sources/oidcauths.md | 2 +- docs/data-sources/rolebindings.md | 4 ++-- docs/data-sources/users.md | 2 +- docs/data-sources/vendors.md | 2 +- docs/index.md | 5 +---- examples/data-sources/bluechip_cidrs/data-source.tf | 4 ++-- examples/data-sources/bluechip_images/data-source.tf | 2 +- examples/data-sources/bluechip_rolebindings/data-source.tf | 2 +- pkg/bluechip_client/bluechip_models/lists.go | 4 ++-- pkg/framework/fwtype/filter.go | 2 +- 16 files changed, 22 insertions(+), 25 deletions(-) diff --git a/docs/data-sources/accounts.md b/docs/data-sources/accounts.md index 0f3a55d..22d21dc 100644 --- a/docs/data-sources/accounts.md +++ b/docs/data-sources/accounts.md @@ -41,7 +41,7 @@ data "bluechip_accounts" "current" { Required: - `field` (String) Field to use for the query term. -- `operator` (String) Operator to use for the query term. One of ['equal', 'notEqual', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. +- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. - `value` (String) Value to use for the query term. diff --git a/docs/data-sources/cidrs.md b/docs/data-sources/cidrs.md index f8592d5..21a70e2 100644 --- a/docs/data-sources/cidrs.md +++ b/docs/data-sources/cidrs.md @@ -50,7 +50,7 @@ resource "bluechip_cidr" "c2" { data "bluechip_cidrs" "office" { namespace = "default" filter { - operator = "equal" + operator = "equals" field = "metadata.annotations.office" value = "true" } @@ -60,7 +60,7 @@ data "bluechip_cidrs" "seoul" { namespace = "default" filter { - operator = "equal" + operator = "equals" field = "metadata.annotations.bluechip.example.com/location" value = "true" } @@ -90,7 +90,7 @@ data "bluechip_cidrs" "seoul" { Required: - `field` (String) Field to use for the query term. -- `operator` (String) Operator to use for the query term. One of ['equal', 'notEqual', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. +- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. - `value` (String) Value to use for the query term. diff --git a/docs/data-sources/clusterrolebindings.md b/docs/data-sources/clusterrolebindings.md index a3078d7..cc0d39b 100644 --- a/docs/data-sources/clusterrolebindings.md +++ b/docs/data-sources/clusterrolebindings.md @@ -36,7 +36,7 @@ data "bluechip_clusterrolebindings" "current" { Required: - `field` (String) Field to use for the query term. -- `operator` (String) Operator to use for the query term. One of ['equal', 'notEqual', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. +- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. - `value` (String) Value to use for the query term. diff --git a/docs/data-sources/clusters.md b/docs/data-sources/clusters.md index 9a553d9..5458efc 100644 --- a/docs/data-sources/clusters.md +++ b/docs/data-sources/clusters.md @@ -41,7 +41,7 @@ data "bluechip_clusters" "current" { Required: - `field` (String) Field to use for the query term. -- `operator` (String) Operator to use for the query term. One of ['equal', 'notEqual', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. +- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. - `value` (String) Value to use for the query term. diff --git a/docs/data-sources/images.md b/docs/data-sources/images.md index 05993a2..1795615 100644 --- a/docs/data-sources/images.md +++ b/docs/data-sources/images.md @@ -15,7 +15,7 @@ description: |- ```terraform data "bluechip_images" "current" { filter { - operator = "equal" + operator = "equals" field = "spec.commitHash" value = "6874ece755439b5b3473b5b910fb4938751d6689" } @@ -46,7 +46,7 @@ data "bluechip_images" "current" { Required: - `field` (String) Field to use for the query term. -- `operator` (String) Operator to use for the query term. One of ['equal', 'notEqual', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. +- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. - `value` (String) Value to use for the query term. diff --git a/docs/data-sources/namespaces.md b/docs/data-sources/namespaces.md index e19ef05..dad259a 100644 --- a/docs/data-sources/namespaces.md +++ b/docs/data-sources/namespaces.md @@ -36,7 +36,7 @@ data "bluechip_namespaces" "current" { Required: - `field` (String) Field to use for the query term. -- `operator` (String) Operator to use for the query term. One of ['equal', 'notEqual', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. +- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. - `value` (String) Value to use for the query term. diff --git a/docs/data-sources/oidcauths.md b/docs/data-sources/oidcauths.md index c5dfe18..33dac74 100644 --- a/docs/data-sources/oidcauths.md +++ b/docs/data-sources/oidcauths.md @@ -36,7 +36,7 @@ data "bluechip_oidcauths" "current" { Required: - `field` (String) Field to use for the query term. -- `operator` (String) Operator to use for the query term. One of ['equal', 'notEqual', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. +- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. - `value` (String) Value to use for the query term. diff --git a/docs/data-sources/rolebindings.md b/docs/data-sources/rolebindings.md index 84ca962..c86a4fd 100644 --- a/docs/data-sources/rolebindings.md +++ b/docs/data-sources/rolebindings.md @@ -15,7 +15,7 @@ description: |- ```terraform data "bluechip_rolebindings" "current" { filter { - operator = "equal" + operator = "equals" key = "metadata.name" value = "" } @@ -46,7 +46,7 @@ data "bluechip_rolebindings" "current" { Required: - `field` (String) Field to use for the query term. -- `operator` (String) Operator to use for the query term. One of ['equal', 'notEqual', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. +- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. - `value` (String) Value to use for the query term. diff --git a/docs/data-sources/users.md b/docs/data-sources/users.md index 07e4cf1..bab0152 100644 --- a/docs/data-sources/users.md +++ b/docs/data-sources/users.md @@ -36,7 +36,7 @@ data "bluechip_users" "current" { Required: - `field` (String) Field to use for the query term. -- `operator` (String) Operator to use for the query term. One of ['equal', 'notEqual', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. +- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. - `value` (String) Value to use for the query term. diff --git a/docs/data-sources/vendors.md b/docs/data-sources/vendors.md index 8f041eb..3485b34 100644 --- a/docs/data-sources/vendors.md +++ b/docs/data-sources/vendors.md @@ -36,7 +36,7 @@ data "bluechip_vendors" "current" { Required: - `field` (String) Field to use for the query term. -- `operator` (String) Operator to use for the query term. One of ['equal', 'notEqual', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. +- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. - `value` (String) Value to use for the query term. diff --git a/docs/index.md b/docs/index.md index bd4c4da..09d6704 100644 --- a/docs/index.md +++ b/docs/index.md @@ -60,15 +60,12 @@ provider "bluechip" { ### Nested Schema for `aws_auth` -Required: - -- `region` (String) - Optional: - `access_key` (String) - `cluster_name` (String) - `profile` (String) +- `region` (String) - `secret_access_key` (String) - `session_token` (String) diff --git a/examples/data-sources/bluechip_cidrs/data-source.tf b/examples/data-sources/bluechip_cidrs/data-source.tf index a2030da..02fb383 100644 --- a/examples/data-sources/bluechip_cidrs/data-source.tf +++ b/examples/data-sources/bluechip_cidrs/data-source.tf @@ -35,7 +35,7 @@ resource "bluechip_cidr" "c2" { data "bluechip_cidrs" "office" { namespace = "default" filter { - operator = "equal" + operator = "equals" field = "metadata.annotations.office" value = "true" } @@ -45,7 +45,7 @@ data "bluechip_cidrs" "seoul" { namespace = "default" filter { - operator = "equal" + operator = "equals" field = "metadata.annotations.bluechip.example.com/location" value = "true" } diff --git a/examples/data-sources/bluechip_images/data-source.tf b/examples/data-sources/bluechip_images/data-source.tf index 876baad..a249a3b 100644 --- a/examples/data-sources/bluechip_images/data-source.tf +++ b/examples/data-sources/bluechip_images/data-source.tf @@ -1,6 +1,6 @@ data "bluechip_images" "current" { filter { - operator = "equal" + operator = "equals" field = "spec.commitHash" value = "6874ece755439b5b3473b5b910fb4938751d6689" } diff --git a/examples/data-sources/bluechip_rolebindings/data-source.tf b/examples/data-sources/bluechip_rolebindings/data-source.tf index 676a2f6..ed03147 100644 --- a/examples/data-sources/bluechip_rolebindings/data-source.tf +++ b/examples/data-sources/bluechip_rolebindings/data-source.tf @@ -1,6 +1,6 @@ data "bluechip_rolebindings" "current" { filter { - operator = "equal" + operator = "equals" key = "metadata.name" value = "" } diff --git a/pkg/bluechip_client/bluechip_models/lists.go b/pkg/bluechip_client/bluechip_models/lists.go index 088c17c..af0dd6f 100644 --- a/pkg/bluechip_client/bluechip_models/lists.go +++ b/pkg/bluechip_client/bluechip_models/lists.go @@ -24,8 +24,8 @@ type ListRequest struct { } const OperatorFuzzy = "fuzzy" -const OperatorEquals = "equal" -const OperatorNotEquals = "notEqual" +const OperatorEquals = "equals" +const OperatorNotEquals = "notEquals" const OperatorWildcard = "wildcard" const OperatorRegex = "regex" const OperatorMatchPhrase = "matchPhrase" diff --git a/pkg/framework/fwtype/filter.go b/pkg/framework/fwtype/filter.go index e0247cc..0ee0ff1 100644 --- a/pkg/framework/fwtype/filter.go +++ b/pkg/framework/fwtype/filter.go @@ -30,7 +30,7 @@ func (FilterType) Schema() *schema.Schema { }, "operator": { Type: schema.TypeString, - Description: "Operator to use for the query term. One of ['equal', 'notEqual', 'fuzzy', 'wildcard', 'regex', 'matchPhrase'].", + Description: "Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase'].", Required: true, ValidateFunc: validation.StringInSlice([]string{ bluechip_models.OperatorEquals,