-
Notifications
You must be signed in to change notification settings - Fork 117
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
Embed static files using embed package #502
Conversation
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪 |
Tests failing because of golang/go#44354, opening PR to change linter (#503). |
@jsoriano there was an issue to do exactly the opposite as long as we had a fleet-managed agent manifest in upstream beats repo. The point was not to maintain both at the same time. |
Downloading the manifest from the beats/elastic-agent repository adds a dependency into
A middle-ground solution for this could be to download an specific version from the beats repository (instead of one of a branch as is being done now) and continue doing the transformations here. But then we would miss the advantages of #328, and then I would prefer to directly have the manifest here. We can explore additional ways of customizing this If we want to test if the latest manifest in the beats repo works well with the latest kubernetes integration, I think that we should do this in an e2e-testing suite. |
|
||
// newPackageRegistryConfig returns a Managed Config | ||
func newPackageRegistryConfig(_ string, profilePath string) (*simpleFile, error) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: empty line
//go:embed _static/docker-compose-stack.yml | ||
var snapshotYml string | ||
|
||
// newSnapshotFile returns a Managed Config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this comment is a bit misleading (not a Managed Config)
@@ -157,75 +153,25 @@ func installElasticAgentInCluster() error { | |||
return nil | |||
} | |||
|
|||
// downloadElasticAgentManagedYAML will download a url from a path and return the response body. | |||
func downloadElasticAgentManagedYAML(url string) ([]byte, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest I'm on the fence with this change as it isn't inlined with idea we had before - have a single place where we store k8s definitions, so that the correct manifest is picked up without any updates in elastic-package's codebase.
Maybe we should discuss possible options here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed and agreed offline to keep a customized copy of Kubernetes manifest here. Ship it!
Several files were included as strings in Go source files. Leverage the
embed
package to move them to single files.Also, include a manifest for elastic-agent in the kubernetes test runner, so it doesn't depend on Beats repository for that.