elastic/cloud-sdk-go

vacate tracking issue for apm instances, now integrations server on deployments >= 8.0.0

Closed this issue · 0 comments

Readiness Checklist

  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I am reporting the issue to the correct repository (for multi-repository projects)

Expected Behavior

It would appear that on deployments that are of version >= 8.0.0 the APM component is now represented as the "integration server". Where as prior versions are under the "apm" umbrella. There's no representation of this in the code that handles vacates: https://github.com/elastic/cloud-sdk-go/blob/master/pkg/api/platformapi/allocatorapi/vacate.go#L596-L630. There might be other gaps in the SDK; however, vacates are probably the most important to address. This results in the following errors when trying to perform a vacate with ecctl and the latest version of the cloud-sdk-go:

{
  "errors": [
    {
      "message": "plan track change: plan track change: couldn't find a deployment containing Kind apm with ID 5e74e4fb576548c3a4bfdab7cae183e9"
    },
    {
      "message": "plan track change: plan track change: couldn't find a deployment containing Kind apm with ID 890a50f1ac5542c69315e42c859543b4"
    },
    {
      "message": "plan track change: plan track change: couldn't find a deployment containing Kind apm with ID 9415cc233ba84b69bd4b714b713cbf2f"
    },
    {
      "message": "plan track change: plan track change: couldn't find a deployment containing Kind apm with ID b00486f33d9f47eaa5bbee1a1bcb84d4"
    },
    {
      "message": "plan track change: plan track change: couldn't find a deployment containing Kind apm with ID b418aef280014aba8313bbb476de8deb"
    },
    {
      "message": "plan track change: plan track change: couldn't find a deployment containing Kind apm with ID c5aa70a1a70e4461b3a39ac288f6fd78"
    }
  ]
}

See: https://github.com/elastic/cloud-sdk-go/blob/master/pkg/models/move_clusters_details.go#L35-L59.

In the cloud-sdk-go for the vacate flow - we use the move API with the validation query param to get the contents of what needs to be moved off the allocator - this determines the kind, it's a bit peculiar to me that the integrations server pieces are manifesting as apm, but there might be a reason for that behind the scenes. Anyways, here's the rough flow of things:

https://github.com/elastic/cloud-sdk-go/blob/master/pkg/api/platformapi/allocatorapi/vacate.go#L125-L150 -> https://github.com/elastic/cloud-sdk-go/blob/master/pkg/api/platformapi/allocatorapi/vacate.go#L203-L268

https://github.com/elastic/cloud-sdk-go/blob/master/pkg/api/platformapi/allocatorapi/vacate.go#L148 maps to the move clusters details type I linked at the start, which in turn was called by: https://github.com/elastic/cloud-sdk-go/blob/master/pkg/client/platform_infrastructure/platform_infrastructure_client.go#L2114-L2148

Current Behavior

Cannot properly track integration server instances during a vacate on deployments >= 8.0.0.

Possible Solution

See above.

Steps to Reproduce

See above.