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

EPM fixes #854

Merged
merged 9 commits into from
Oct 23, 2024
Merged

EPM fixes #854

merged 9 commits into from
Oct 23, 2024

Conversation

daemitus
Copy link
Contributor

So there's a number of problems that cropped up.

  • When an integration is uninstalled outside of terraform, the change is not picked up. A 404 is not returned. Instead, a 200 item.status="not_installed" is. Requiring a switch to ReadPackageWithResponse and updating getschema (again).
  • The schema was wrong (again). The entirety of allOf.1 needs to be under .item which is present in allOf.0. All the more reason to get the Pull newer fleet schema #834 to a satisfactory state.
  • Uninstall does not return a 404 like most other delete methods, but a 400 message="name is not installed". So switch to DeletePackageWithResponse.
  • Since there's only one non-WithResponse method left at this point in all of fleet, switch InstallPackage to it as well. Does all the body reading for us.
  • fleet_integration create and update pass respDiags by value instead of pointer, so if a diag is actually added, it doesn't end up back in the caller.
    Actual:
    resource_test.go:76: Step 1/2 error: Error running apply: exit status 1
        Error: Missing Resource State After Create

Expected (using ti_abusech on one of the older stack versions):

    resource_test.go:76: Step 1/2 error: Error running apply: exit status 1
        Error: Unexpected status code from server: got HTTP 500

@daemitus
Copy link
Contributor Author

Additionally, I need to check if the diags by value issue is also in all the utils/tfsdk.go helper methods.

type ListMeta struct {
	Index int
	Path  path.Path
	Diags diag.Diagnostics
}

type MapMeta struct {
	Key   string
	Path  path.Path
	Diags diag.Diagnostics
}

@daemitus daemitus marked this pull request as ready for review October 17, 2024 15:25
Copy link
Member

@tobio tobio left a comment

Choose a reason for hiding this comment

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

👍 couple of minor comments on the code.

internal/clients/fleet/fleet.go Outdated Show resolved Hide resolved
internal/fleet/integration/resource_test.go Outdated Show resolved Hide resolved
internal/fleet/integration/resource_test.go Outdated Show resolved Hide resolved
internal/fleet/integration/resource_test.go Outdated Show resolved Hide resolved
Copy link
Member

@tobio tobio left a comment

Choose a reason for hiding this comment

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

Love it, 🎉

@tobio tobio merged commit f2d5a9e into elastic:main Oct 23, 2024
20 checks passed
@daemitus daemitus deleted the epm branch October 24, 2024 15:34
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.

2 participants