From 263ec8c476897e3cac3aeb180b463e632eb871b2 Mon Sep 17 00:00:00 2001 From: Matthew Casperson Date: Tue, 6 Aug 2024 10:07:28 +1000 Subject: [PATCH] Data source results must not be optional (#706) * The collection returned by data sources must not be optional * Updated test framework * Fixed modules --- go.mod | 18 +++++++++-------- go.sum | 20 +++++++++++++++++++ octopusdeploy/data_source_tenants.go | 6 +++++- octopusdeploy/schema_account_resource.go | 1 + ...a_azure_cloud_service_deployment_target.go | 2 +- ...ervice_fabric_cluster_deployment_target.go | 2 +- .../schema_azure_web_app_deployment_target.go | 2 +- octopusdeploy/schema_certificate.go | 2 +- octopusdeploy/schema_channel.go | 2 +- .../schema_cloud_region_deployment_target.go | 2 +- octopusdeploy/schema_deployment_target.go | 2 +- octopusdeploy/schema_environment.go | 2 +- octopusdeploy/schema_feed.go | 2 +- octopusdeploy/schema_git_credential.go | 2 +- ...hema_kubernetes_agent_deployment_target.go | 2 +- ...ma_kubernetes_cluster_deployment_target.go | 2 +- octopusdeploy/schema_library_variable_set.go | 2 +- octopusdeploy/schema_lifecycle.go | 2 +- ...ma_listening_tentacle_deployment_target.go | 2 +- octopusdeploy/schema_machine_policy.go | 2 +- ..._offline_package_drop_deployment_target.go | 2 +- ...hema_polling_tentacle_deployment_target.go | 2 +- octopusdeploy/schema_project.go | 2 +- octopusdeploy/schema_project_group.go | 2 +- octopusdeploy/schema_script_modules.go | 2 +- octopusdeploy/schema_space.go | 2 +- ...schema_ssh_connection_deployment_target.go | 2 +- octopusdeploy/schema_tag_set.go | 2 +- octopusdeploy/schema_team.go | 2 +- octopusdeploy/schema_tenant.go | 2 +- octopusdeploy/schema_user.go | 2 +- octopusdeploy/schema_user_role.go | 2 +- octopusdeploy/schema_worker_pool.go | 2 +- 33 files changed, 65 insertions(+), 38 deletions(-) diff --git a/go.mod b/go.mod index 816537f2c..9eb037e59 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21 require ( github.com/OctopusDeploy/go-octopusdeploy/v2 v2.43.0 - github.com/OctopusSolutionsEngineering/OctopusTerraformTestFramework v0.0.0-20240622231527-24df7b6eaa48 + github.com/OctopusSolutionsEngineering/OctopusTerraformTestFramework v0.0.0-20240729041805-46db6fb717b4 github.com/google/uuid v1.6.0 github.com/gruntwork-io/terratest v0.41.11 github.com/hashicorp/go-cty v1.4.1-0.20200723130312-85980079f637 @@ -29,8 +29,8 @@ require ( github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/semver/v3 v3.2.0 // indirect github.com/Masterminds/sprig/v3 v3.2.3 // indirect - github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/Microsoft/hcsshim v0.11.4 // indirect + github.com/Microsoft/go-winio v0.6.2 // indirect + github.com/Microsoft/hcsshim v0.11.5 // indirect github.com/ProtonMail/go-crypto v1.1.0-alpha.2 // indirect github.com/agext/levenshtein v1.2.3 // indirect github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect @@ -43,13 +43,14 @@ require ( github.com/buger/jsonparser v1.1.1 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/cloudflare/circl v1.3.7 // indirect - github.com/containerd/containerd v1.7.15 // indirect + github.com/containerd/containerd v1.7.18 // indirect + github.com/containerd/errdefs v0.1.0 // indirect github.com/containerd/log v0.1.0 // indirect github.com/cpuguy83/dockercfg v0.3.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dghubble/sling v1.4.1 // indirect - github.com/distribution/reference v0.5.0 // indirect - github.com/docker/docker v25.0.5+incompatible // indirect + github.com/distribution/reference v0.6.0 // indirect + github.com/docker/docker v27.0.3+incompatible // indirect github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/fatih/color v1.16.0 // indirect @@ -91,7 +92,7 @@ require ( github.com/imdario/mergo v0.3.15 // indirect github.com/jinzhu/copier v0.3.5 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect - github.com/klauspost/compress v1.16.0 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/leodido/go-urn v1.2.2 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/magiconair/properties v1.8.7 // indirect @@ -106,6 +107,7 @@ require ( github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect + github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/patternmatcher v0.6.0 // indirect github.com/moby/sys/sequential v0.5.0 // indirect github.com/moby/sys/user v0.1.0 // indirect @@ -125,7 +127,7 @@ require ( github.com/shopspring/decimal v1.3.1 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/spf13/cast v1.5.0 // indirect - github.com/testcontainers/testcontainers-go v0.31.0 // indirect + github.com/testcontainers/testcontainers-go v0.32.0 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/tmccombs/hcl2json v0.3.6 // indirect diff --git a/go.sum b/go.sum index 795d2a3cf..035921899 100644 --- a/go.sum +++ b/go.sum @@ -36,14 +36,20 @@ github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= +github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8= github.com/Microsoft/hcsshim v0.11.4/go.mod h1:smjE4dvqPX9Zldna+t5FG3rnoHhaB7QYxPRqGcpAD9w= +github.com/Microsoft/hcsshim v0.11.5 h1:haEcLNpj9Ka1gd3B3tAEs9CpE0c+1IhoL59w/exYU38= +github.com/Microsoft/hcsshim v0.11.5/go.mod h1:MV8xMfmECjl5HdO7U/3/hFVnkmSBjAjmA09d4bExKcU= github.com/OctopusDeploy/go-octopusdeploy/v2 v2.43.0 h1:fYwGBqG88xy3qHp5j1ySCztdqfw2NLfg2yp0N3XcBYg= github.com/OctopusDeploy/go-octopusdeploy/v2 v2.43.0/go.mod h1:GZmFu6LmN8Yg0tEoZx3ytk9FnaH+84cWm7u5TdWZC6E= github.com/OctopusSolutionsEngineering/OctopusTerraformTestFramework v0.0.0-20240502041300-f71244db277d h1:E0Rm52/XBlVzdkHET/+Js1FVVgf5/0oRk1tNkI4jcyk= github.com/OctopusSolutionsEngineering/OctopusTerraformTestFramework v0.0.0-20240502041300-f71244db277d/go.mod h1:Nyg+7cyTrSQ/lMIy5YY1UdJekRuoMWf4uHIPfaGmgTM= github.com/OctopusSolutionsEngineering/OctopusTerraformTestFramework v0.0.0-20240622231527-24df7b6eaa48 h1:lxcmT+JUYCe2pA7owBK47/z0jY3va03yl1sQA3n0/Xo= github.com/OctopusSolutionsEngineering/OctopusTerraformTestFramework v0.0.0-20240622231527-24df7b6eaa48/go.mod h1:/QwYrEWP690YoKAR9lUVEv2y1Ta0HY08OaWb4LMZCAw= +github.com/OctopusSolutionsEngineering/OctopusTerraformTestFramework v0.0.0-20240729041805-46db6fb717b4 h1:QfbVf0bOIRMp/WHAWsuVDB7KHoWnRsGbvDuOf2ua7k4= +github.com/OctopusSolutionsEngineering/OctopusTerraformTestFramework v0.0.0-20240729041805-46db6fb717b4/go.mod h1:Oq9KbiRNDBB5jFmrwnrgLX0urIqR/1ptY18TzkqXm7M= github.com/ProtonMail/go-crypto v1.1.0-alpha.2 h1:bkyFVUP+ROOARdgCiJzNQo2V2kiB97LyUpzH9P6Hrlg= github.com/ProtonMail/go-crypto v1.1.0-alpha.2/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= @@ -87,6 +93,10 @@ github.com/containerd/containerd v1.7.12 h1:+KQsnv4VnzyxWcfO9mlxxELaoztsDEjOuCMP github.com/containerd/containerd v1.7.12/go.mod h1:/5OMpE1p0ylxtEUGY8kuCYkDRzJm9NO1TFMWjUpdevk= github.com/containerd/containerd v1.7.15 h1:afEHXdil9iAm03BmhjzKyXnnEBtjaLJefdU7DV0IFes= github.com/containerd/containerd v1.7.15/go.mod h1:ISzRRTMF8EXNpJlTzyr2XMhN+j9K302C21/+cr3kUnY= +github.com/containerd/containerd v1.7.18 h1:jqjZTQNfXGoEaZdW1WwPU0RqSn1Bm2Ay/KJPUuO8nao= +github.com/containerd/containerd v1.7.18/go.mod h1:IYEk9/IO6wAPUz2bCMVUbsfXjzw5UNP5fLz4PsUygQ4= +github.com/containerd/errdefs v0.1.0 h1:m0wCRBiu1WJT/Fr+iOoQHMQS/eP5myQ8lCv4Dz5ZURM= +github.com/containerd/errdefs v0.1.0/go.mod h1:YgWiiHtLmSeBrvpw+UfPijzbLaB77mEG1WwJTDETIV0= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/cpuguy83/dockercfg v0.3.1 h1:/FpZ+JaygUR/lZP2NlFI2DVfrOEMAIKP5wWEJdoYe9E= @@ -103,8 +113,12 @@ github.com/dghubble/sling v1.4.1 h1:AxjTubpVyozMvbBCtXcsWEyGGgUZutC5YGrfxPNVOcQ= github.com/dghubble/sling v1.4.1/go.mod h1:QoMB1KL3GAo+7HsD8Itd6S+6tW91who8BGZzuLvpOyc= github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= +github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= +github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/docker/docker v25.0.5+incompatible h1:UmQydMduGkrD5nQde1mecF/YnSbTOaPeFIeP5C4W+DE= github.com/docker/docker v25.0.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v27.0.3+incompatible h1:aBGI9TeQ4MPlhquTQKq9XbK79rKFVwXNUAYz9aXyEBE= +github.com/docker/docker v27.0.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -296,6 +310,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.11.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4= github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= @@ -348,6 +364,8 @@ github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= +github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk= github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc= @@ -425,6 +443,8 @@ github.com/testcontainers/testcontainers-go v0.30.0 h1:jmn/XS22q4YRrcMwWg0pAwlCl github.com/testcontainers/testcontainers-go v0.30.0/go.mod h1:K+kHNGiM5zjklKjgTtcrEetF3uhWbMUyqAQoyoh8Pf0= github.com/testcontainers/testcontainers-go v0.31.0 h1:W0VwIhcEVhRflwL9as3dhY6jXjVCA27AkmbnZ+UTh3U= github.com/testcontainers/testcontainers-go v0.31.0/go.mod h1:D2lAoA0zUFiSY+eAflqK5mcUx/A5hrrORaEQrd0SefI= +github.com/testcontainers/testcontainers-go v0.32.0 h1:ug1aK08L3gCHdhknlTTwWjPHPS+/alvLJU/DRxTD/ME= +github.com/testcontainers/testcontainers-go v0.32.0/go.mod h1:CRHrzHLQhlXUsa5gXjTOfqIEJcrK5+xMDmBr/WMI88E= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= diff --git a/octopusdeploy/data_source_tenants.go b/octopusdeploy/data_source_tenants.go index fcbdceae8..d61d02ec3 100644 --- a/octopusdeploy/data_source_tenants.go +++ b/octopusdeploy/data_source_tenants.go @@ -44,7 +44,11 @@ func dataSourceTenantsRead(ctx context.Context, d *schema.ResourceData, meta int flattenedTenants = append(flattenedTenants, flattenTenant(tenant)) } - d.Set("tenants", flattenedTenants) + err = d.Set("tenants", flattenedTenants) + if err != nil { + return diag.FromErr(err) + } + d.SetId("Tenants " + time.Now().UTC().String()) return nil diff --git a/octopusdeploy/schema_account_resource.go b/octopusdeploy/schema_account_resource.go index 5dbee9361..4a31f5017 100644 --- a/octopusdeploy/schema_account_resource.go +++ b/octopusdeploy/schema_account_resource.go @@ -50,6 +50,7 @@ func getAccountResourceDataSchema() map[string]*schema.Schema { Description: "A list of accounts that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, Type: schema.TypeList, + Optional: false, }, "id": getDataSchemaID(), "space_id": getQuerySpaceID(), diff --git a/octopusdeploy/schema_azure_cloud_service_deployment_target.go b/octopusdeploy/schema_azure_cloud_service_deployment_target.go index 46488a934..45e00de20 100644 --- a/octopusdeploy/schema_azure_cloud_service_deployment_target.go +++ b/octopusdeploy/schema_azure_cloud_service_deployment_target.go @@ -70,7 +70,7 @@ func getAzureCloudServiceDeploymentTargetDataSchema() map[string]*schema.Schema Computed: true, Description: "A list of Azure cloud service deployment targets that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, } diff --git a/octopusdeploy/schema_azure_service_fabric_cluster_deployment_target.go b/octopusdeploy/schema_azure_service_fabric_cluster_deployment_target.go index 3f8af8905..639d08553 100644 --- a/octopusdeploy/schema_azure_service_fabric_cluster_deployment_target.go +++ b/octopusdeploy/schema_azure_service_fabric_cluster_deployment_target.go @@ -85,7 +85,7 @@ func getAzureServiceFabricClusterDeploymentTargetDataSchema() map[string]*schema Computed: true, Description: "A list of Azure service fabric cluster deployment targets that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, } diff --git a/octopusdeploy/schema_azure_web_app_deployment_target.go b/octopusdeploy/schema_azure_web_app_deployment_target.go index 8478378b6..f8b2cfe25 100644 --- a/octopusdeploy/schema_azure_web_app_deployment_target.go +++ b/octopusdeploy/schema_azure_web_app_deployment_target.go @@ -55,7 +55,7 @@ func getAzureWebAppDeploymentTargetDataSchema() map[string]*schema.Schema { Computed: true, Description: "A list of Azure web app deployment targets that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, } diff --git a/octopusdeploy/schema_certificate.go b/octopusdeploy/schema_certificate.go index 4252f9899..2d35164c9 100644 --- a/octopusdeploy/schema_certificate.go +++ b/octopusdeploy/schema_certificate.go @@ -170,7 +170,7 @@ func getCertificateDataSchema() map[string]*schema.Schema { Computed: true, Description: "A list of certificates that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, }, "first_result": getQueryFirstResult(), diff --git a/octopusdeploy/schema_channel.go b/octopusdeploy/schema_channel.go index 88aa0bda9..eed2eead6 100644 --- a/octopusdeploy/schema_channel.go +++ b/octopusdeploy/schema_channel.go @@ -73,7 +73,7 @@ func getChannelDataSchema() map[string]*schema.Schema { Computed: true, Description: "A channel that matches the specified filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, }, "ids": getQueryIDs(), diff --git a/octopusdeploy/schema_cloud_region_deployment_target.go b/octopusdeploy/schema_cloud_region_deployment_target.go index bce3dd18e..8e2375e07 100644 --- a/octopusdeploy/schema_cloud_region_deployment_target.go +++ b/octopusdeploy/schema_cloud_region_deployment_target.go @@ -40,7 +40,7 @@ func getCloudRegionDeploymentTargetDataSchema() map[string]*schema.Schema { Computed: true, Description: "A list of cloud region deployment targets that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, } diff --git a/octopusdeploy/schema_deployment_target.go b/octopusdeploy/schema_deployment_target.go index 456265859..9649a7bec 100644 --- a/octopusdeploy/schema_deployment_target.go +++ b/octopusdeploy/schema_deployment_target.go @@ -90,7 +90,7 @@ func getDeploymentTargetDataSchema() map[string]*schema.Schema { Computed: true, Description: "A list of deployment targets that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, }, "environments": getQueryEnvironments(), diff --git a/octopusdeploy/schema_environment.go b/octopusdeploy/schema_environment.go index babb495ab..e31754c4a 100644 --- a/octopusdeploy/schema_environment.go +++ b/octopusdeploy/schema_environment.go @@ -103,7 +103,7 @@ func getEnvironmentDataSchema() map[string]*schema.Schema { Computed: true, Description: "A list of environments that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, }, "id": getDataSchemaID(), diff --git a/octopusdeploy/schema_feed.go b/octopusdeploy/schema_feed.go index 6c5c77337..5f5a6c36c 100644 --- a/octopusdeploy/schema_feed.go +++ b/octopusdeploy/schema_feed.go @@ -39,7 +39,7 @@ func getFeedDataSchema() map[string]*schema.Schema { Computed: true, Description: "A list of feeds that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, }, "feed_type": getQueryFeedType(), diff --git a/octopusdeploy/schema_git_credential.go b/octopusdeploy/schema_git_credential.go index da17119b8..411d2cf37 100644 --- a/octopusdeploy/schema_git_credential.go +++ b/octopusdeploy/schema_git_credential.go @@ -52,7 +52,7 @@ func getGitCredentialDataSchema() map[string]*schema.Schema { Computed: true, Description: "A list of Git Credentials that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, }, "name": getQueryName(), diff --git a/octopusdeploy/schema_kubernetes_agent_deployment_target.go b/octopusdeploy/schema_kubernetes_agent_deployment_target.go index 822e7dce8..2323f311b 100644 --- a/octopusdeploy/schema_kubernetes_agent_deployment_target.go +++ b/octopusdeploy/schema_kubernetes_agent_deployment_target.go @@ -173,7 +173,7 @@ func getKubernetesAgentDeploymentTargetDataSchema() map[string]*schema.Schema { Computed: true, Description: "A list of kubernetes agent deployment targets that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, } diff --git a/octopusdeploy/schema_kubernetes_cluster_deployment_target.go b/octopusdeploy/schema_kubernetes_cluster_deployment_target.go index 6dcbd6a35..4704688ff 100644 --- a/octopusdeploy/schema_kubernetes_cluster_deployment_target.go +++ b/octopusdeploy/schema_kubernetes_cluster_deployment_target.go @@ -131,7 +131,7 @@ func getKubernetesClusterDeploymentTargetDataSchema() map[string]*schema.Schema Computed: true, Description: "A list of Kubernetes cluster deployment targets that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, } diff --git a/octopusdeploy/schema_library_variable_set.go b/octopusdeploy/schema_library_variable_set.go index 2e39ccae0..3e27b96ba 100644 --- a/octopusdeploy/schema_library_variable_set.go +++ b/octopusdeploy/schema_library_variable_set.go @@ -70,7 +70,7 @@ func getLibraryVariableSetDataSchema() map[string]*schema.Schema { Computed: true, Description: "A list of library variable sets that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, }, "partial_name": getQueryPartialName(), diff --git a/octopusdeploy/schema_lifecycle.go b/octopusdeploy/schema_lifecycle.go index 0b00aefc4..c9462868f 100644 --- a/octopusdeploy/schema_lifecycle.go +++ b/octopusdeploy/schema_lifecycle.go @@ -68,7 +68,7 @@ func getLifecycleDataSchema() map[string]*schema.Schema { Computed: true, Description: "A list of lifecycles that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, }, "partial_name": getQueryPartialName(), diff --git a/octopusdeploy/schema_listening_tentacle_deployment_target.go b/octopusdeploy/schema_listening_tentacle_deployment_target.go index 32d2b3481..a35cdb8af 100644 --- a/octopusdeploy/schema_listening_tentacle_deployment_target.go +++ b/octopusdeploy/schema_listening_tentacle_deployment_target.go @@ -57,7 +57,7 @@ func getListeningTentacleDeploymentTargetDataSchema() map[string]*schema.Schema Computed: true, Description: "A list of listening tentacle deployment targets that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, } diff --git a/octopusdeploy/schema_machine_policy.go b/octopusdeploy/schema_machine_policy.go index 537da34df..0d24b2f6c 100644 --- a/octopusdeploy/schema_machine_policy.go +++ b/octopusdeploy/schema_machine_policy.go @@ -112,7 +112,7 @@ func getMachinePolicyDataSchema() map[string]*schema.Schema { Computed: true, Description: "A list of machine policies that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, }, "partial_name": getQueryPartialName(), diff --git a/octopusdeploy/schema_offline_package_drop_deployment_target.go b/octopusdeploy/schema_offline_package_drop_deployment_target.go index f8b88f704..371a08b01 100644 --- a/octopusdeploy/schema_offline_package_drop_deployment_target.go +++ b/octopusdeploy/schema_offline_package_drop_deployment_target.go @@ -51,7 +51,7 @@ func getOfflinePackageDropDeploymentTargetDataSchema() map[string]*schema.Schema Computed: true, Description: "A list of offline package drop deployment targets that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, } diff --git a/octopusdeploy/schema_polling_tentacle_deployment_target.go b/octopusdeploy/schema_polling_tentacle_deployment_target.go index ab6472663..ee73b0cfb 100644 --- a/octopusdeploy/schema_polling_tentacle_deployment_target.go +++ b/octopusdeploy/schema_polling_tentacle_deployment_target.go @@ -51,7 +51,7 @@ func getPollingTentacleDeploymentTargetDataSchema() map[string]*schema.Schema { Computed: true, Description: "A list of polling tentacle deployment targets that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, } diff --git a/octopusdeploy/schema_project.go b/octopusdeploy/schema_project.go index bc7d2fb1c..258c2be40 100644 --- a/octopusdeploy/schema_project.go +++ b/octopusdeploy/schema_project.go @@ -211,7 +211,7 @@ func getProjectDataSchema() map[string]*schema.Schema { Computed: true, Description: "A list of projects that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, }, "skip": getQuerySkip(), diff --git a/octopusdeploy/schema_project_group.go b/octopusdeploy/schema_project_group.go index 52fbfe857..d80a7b726 100644 --- a/octopusdeploy/schema_project_group.go +++ b/octopusdeploy/schema_project_group.go @@ -55,7 +55,7 @@ func getProjectGroupDataSchema() map[string]*schema.Schema { Computed: true, Description: "A list of project groups that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, }, "skip": getQuerySkip(), diff --git a/octopusdeploy/schema_script_modules.go b/octopusdeploy/schema_script_modules.go index c4a24d1f8..906d2ea54 100644 --- a/octopusdeploy/schema_script_modules.go +++ b/octopusdeploy/schema_script_modules.go @@ -86,7 +86,7 @@ func getScriptModuleDataSchema() map[string]*schema.Schema { Computed: true, Description: "A list of script modules that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, }, "partial_name": getQueryPartialName(), diff --git a/octopusdeploy/schema_space.go b/octopusdeploy/schema_space.go index 6ab814ff2..d46c561a0 100644 --- a/octopusdeploy/schema_space.go +++ b/octopusdeploy/schema_space.go @@ -93,7 +93,7 @@ func getSpacesDataSourceSchema() map[string]*schema.Schema { Computed: true, Description: "A list of spaces that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, }, } diff --git a/octopusdeploy/schema_ssh_connection_deployment_target.go b/octopusdeploy/schema_ssh_connection_deployment_target.go index 90934132f..df977c19d 100644 --- a/octopusdeploy/schema_ssh_connection_deployment_target.go +++ b/octopusdeploy/schema_ssh_connection_deployment_target.go @@ -57,7 +57,7 @@ func getSSHConnectionDeploymentTargetDataSchema() map[string]*schema.Schema { Computed: true, Description: "A list of SSH connection deployment targets that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, } diff --git a/octopusdeploy/schema_tag_set.go b/octopusdeploy/schema_tag_set.go index db5c31a23..953b5c40c 100644 --- a/octopusdeploy/schema_tag_set.go +++ b/octopusdeploy/schema_tag_set.go @@ -54,7 +54,7 @@ func getTagSetDataSchema() map[string]*schema.Schema { Computed: true, Description: "A list of tag sets that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, }, "take": getQueryTake(), diff --git a/octopusdeploy/schema_team.go b/octopusdeploy/schema_team.go index 3f782a1c9..d0656662e 100644 --- a/octopusdeploy/schema_team.go +++ b/octopusdeploy/schema_team.go @@ -85,7 +85,7 @@ func getTeamDataSchema() map[string]*schema.Schema { Computed: true, Description: "A list of teams that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, }, } diff --git a/octopusdeploy/schema_tenant.go b/octopusdeploy/schema_tenant.go index 6045f5981..260ba93f8 100644 --- a/octopusdeploy/schema_tenant.go +++ b/octopusdeploy/schema_tenant.go @@ -67,7 +67,7 @@ func getTenantDataSchema() map[string]*schema.Schema { Computed: true, Description: "A list of tenants that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, }, "take": getQueryTake(), diff --git a/octopusdeploy/schema_user.go b/octopusdeploy/schema_user.go index 5ef089c67..620c3db37 100644 --- a/octopusdeploy/schema_user.go +++ b/octopusdeploy/schema_user.go @@ -74,7 +74,7 @@ func getUserDataSchema() map[string]*schema.Schema { Computed: true, Description: "A list of users that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, }, } diff --git a/octopusdeploy/schema_user_role.go b/octopusdeploy/schema_user_role.go index 9258402e5..4487a9170 100644 --- a/octopusdeploy/schema_user_role.go +++ b/octopusdeploy/schema_user_role.go @@ -84,7 +84,7 @@ func getUserRoleDataSchema() map[string]*schema.Schema { Computed: true, Description: "A list of user roles that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, }, } diff --git a/octopusdeploy/schema_worker_pool.go b/octopusdeploy/schema_worker_pool.go index 9207124c2..036e2a04a 100644 --- a/octopusdeploy/schema_worker_pool.go +++ b/octopusdeploy/schema_worker_pool.go @@ -39,7 +39,7 @@ func getWorkerPoolDataSchema() map[string]*schema.Schema { Computed: true, Description: "A list of worker pools that match the filter(s).", Elem: &schema.Resource{Schema: dataSchema}, - Optional: true, + Optional: false, Type: schema.TypeList, }, }