Skip to content

Conversation

@kjwardy
Copy link
Owner

@kjwardy kjwardy commented Sep 30, 2024

This PR adds support for the urlTemplate and labelTemplate attributes when specifying a field in a Data View as type URL, as well as adding functionality to account for when some field_formats.params.attributes don't exist.

In its current state, the first time terraform apply is ran, the panic listed at the bottom of this description occurs - but the resource in the configuration is applied as desired. On subsequent applies, the resource is deemed tainted and is re-applied, resulting in the same panic. Unfortunately, I have not been able to identify why this panic occurs.

I believe the additions in this PR to be extensible in allowing the remaining field format attributes - i.e. for the other custom field format types (colour, key/value, etc.) to be added much easier.

As an aside, I'm not sure that (#619 has fixed the bug as it was intended to. When the id attribute of any field specified in field_formats is set (in this case, url), the provider panic still as it did pre (#619. I noticed this when applying a resource that contains urltemplate and labeltemplate but not pattern, the following panic still happened.

│ Error: Provider produced inconsistent result after apply │ │ When applying changes to elasticstack_kibana_data_view.ops-metrics-and-logs, provider │ "provider[\"registry.terraform.io/elastic/elasticstack\"]" produced an unexpected new value: │ .data_view.field_formats["user.id"].params: was │ cty.ObjectVal(map[string]cty.Value{"labeltemplate":cty.StringVal("{{value}}"), │ "pattern":cty.NullVal(cty.String), "urltemplate":cty.StringVal("https://somesite.com/user/{{value}}")}), but │ now null. │ │ This is a bug in the provider, which should be reported in the provider's own issue tracker.

kjwardy and others added 30 commits September 28, 2024 10:47
* impl fw resource.agent_policy

* impl fw resource/data_source integration

* impl fw resource.fleet_server_host

* update changelog

* pull in sysMonitoring update

* requested changes

* fix *[] usage
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.7 to 4.2.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@692973e...d632683)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…stic#806)

Bumps [github.com/oapi-codegen/oapi-codegen/v2](https://github.com/oapi-codegen/oapi-codegen) from 2.4.0 to 2.4.1.
- [Release notes](https://github.com/oapi-codegen/oapi-codegen/releases)
- [Commits](oapi-codegen/oapi-codegen@v2.4.0...v2.4.1)

---
updated-dependencies:
- dependency-name: github.com/oapi-codegen/oapi-codegen/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/oapi-codegen/oapi-codegen/v2](https://github.com/oapi-codegen/oapi-codegen) from 2.4.0 to 2.4.1.
- [Release notes](https://github.com/oapi-codegen/oapi-codegen/releases)
- [Commits](oapi-codegen/oapi-codegen@v2.4.0...v2.4.1)

---
updated-dependencies:
- dependency-name: github.com/oapi-codegen/oapi-codegen/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…15.2 (elastic#799)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
…ker tag to v8.15.2 (elastic#798)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
biscout42 and others added 5 commits September 30, 2024 12:34
…astic#801)

* fix: synthetics http monitor creations produced inconsistent result after apply

 for elastic#800
 fix for the fileds: http.locations, http.proxy_url, http.ssl_supported_protocols, http.ssl_verification_mode, tcp.proxy_url, tcp.ssl_supported_protocols, tcp.ssl_verification_mode

* make lint happy

* update change log

* cr comments - reuse utls
…stic#781)

* fix(deps): update module github.com/go-resty/resty/v2 to v2.15.3

* go mod tidy

---------

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Toby Brain <[email protected]>
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
@kjwardy kjwardy self-assigned this Sep 30, 2024
@kjwardy kjwardy marked this pull request as draft September 30, 2024 15:31
@kjwardy kjwardy marked this pull request as ready for review September 30, 2024 15:52
@kjwardy kjwardy merged commit 99b17c4 into main Sep 30, 2024
kjwardy added a commit that referenced this pull request Oct 4, 2024
* Add URL support to data_view field_formats (#1)

- Adds support for `urlTemplate` and `labelTemplate` to data_views.field_formats
- Amends API request build process to account for when some/any data_views.field_formats.attributes aren't passed in

* Update internal/kibana/data_view/schema.go

Co-authored-by: Toby Brain <[email protected]>

* Update internal/kibana/data_view/schema.go

Co-authored-by: Toby Brain <[email protected]>

* PR changes

---------

Co-authored-by: Toby Brain <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants