Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Utilise the migrate template API when applying changes to the deployment template id #547

Merged
merged 4 commits into from
Nov 17, 2022

Conversation

tobio
Copy link
Member

@tobio tobio commented Oct 7, 2022

Description

Use the migrate template API to build the base update request when an existing deployment changes. deployment_template_id,

Related Issues

Fixes #487
Fixes #556

Motivation and Context

This API is purpose built to update deployment options to be compatible with a different template and simplifies the process for migrating deployments between hardware types.

How Has This Been Tested?

Manually, acceptance test, unit tests

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (improves code quality but has no user-facing effect)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation

Readiness Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

@tobio tobio requested review from webfella and dimuon October 7, 2022 10:32
@tobio tobio self-assigned this Oct 7, 2022
@tobio tobio requested a review from a team as a code owner October 7, 2022 10:32
Copy link

@webfella webfella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All LGTM mate, can't help out with any code suggestions but I def learned a bit while workin through this 👍

ec/ecresource/deploymentresource/expanders_test.go Outdated Show resolved Hide resolved
@tobio tobio force-pushed the template-migration-api branch 2 times, most recently from 6257053 to 4b324d7 Compare October 10, 2022 02:57
@@ -9,7 +9,16 @@ resource "ec_deployment" "defaults" {
version = data.ec_stack.latest.version
deployment_template_id = "%s"

elasticsearch {}
elasticsearch {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to modify test checks instead? It looks like the acceptance test (TestAccDeployment_basic_defaults_hw) checks updating configuration once the template is changed.

Also shall the acceptance test work as expected without these explicit changes to the sizes? The new template (aws-hot-warm-v2) has size 4g for both hot_content and warm tiers so I guess once the template attribute is set to aws-hot-warm-v2, the tier sizes should change accordingly even without these explicit settings in the configuration.

@tobio tobio force-pushed the template-migration-api branch from 4e3580d to e4282ca Compare November 16, 2022 23:18
@tobio tobio force-pushed the template-migration-api branch from e4282ca to a189ad6 Compare November 17, 2022 00:29
@tobio tobio merged commit e6a5f34 into elastic:master Nov 17, 2022
@tobio tobio deleted the template-migration-api branch November 17, 2022 19:27
dimuon pushed a commit to dimuon/terraform-provider-ec that referenced this pull request Feb 2, 2023
…ent template id (elastic#547)

* Utilise the migrate template API when applying changes to the deployment template id

* Add changelog

* Fix acceptance tests

* Reset the instance_configuration_id so changes from the migration API are picked up
tobio added a commit that referenced this pull request Feb 15, 2023
* upstream/master: (28 commits)
  Update CHANGELOG.md and NOTICE
  Fix incorrect private link data for Azure eastus (#583)
  Update CHANGELOG.md and NOTICE
  Fix typo in GCP PSC datasource documentation (#571)
  Update CHANGELOG.md and NOTICE
  fix(deps): update module github.com/go-openapi/runtime to v0.25.0 (#564)
  Update CHANGELOG.md and NOTICE
  Utilise the migrate template API when applying changes to the deployment template id  (#547)
  Update CHANGELOG.md and NOTICE
  fix(deps): update module github.com/hashicorp/terraform-plugin-sdk/v2 to v2.24.1 (#559)
  Update CHANGELOG.md and NOTICE
  docs: Add GCP PSC to Traffic Filter argument reference for type (#557)
  Update CHANGELOG.md and NOTICE
  chore(deps): update peterjgrainger/action-create-branch action to v2.3.0 (#560)
  Update CHANGELOG.md and NOTICE
  fix: remove strategy DiffSuppressFunc (#539)
  Update CHANGELOG.md and NOTICE
  fix(deps): update module github.com/stretchr/testify to v1.8.1 (#554)
  Update CHANGELOG.md and NOTICE
  Revert "Run acceptance tests in CI against 1.2.9 (#542)" (#553)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants