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

[8.16](backport #5831) Use a PodTemplate resource in the Helm Chart #5930

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Nov 4, 2024

What does this PR do?

Instead of an untyped .tpl Helm template, use a PodTemplate resource. This resource is loaded from a file, templated via the tpl function, converted to a dict to get a specific key, and then converted back to YAML.

This is a bit convoluted, but it gives us intellisense for the pod template.

Why is it important?

.tpl files aren't very readable. On the other hand, Kubernetes resources get pretty good support from IDEs and tools. So this is a maintainability improvement.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas

This is an automatic backport of pull request #5831 done by [Mergify](https://mergify.com).

@mergify mergify bot requested a review from a team as a code owner November 4, 2024 19:21
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Nov 4, 2024
@mergify mergify bot requested review from pkoutsovasilis and michel-laterman and removed request for a team November 4, 2024 19:21
Copy link
Contributor Author

mergify bot commented Nov 4, 2024

Cherry-pick of f891fb0 has failed:

On branch mergify/bp/8.16/pr-5831
Your branch is up to date with 'origin/8.16'.

You are currently cherry-picking commit f891fb0250.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	deleted:    deploy/helm/elastic-agent/templates/agent/eck/_pod_template.tpl
	new file:   deploy/helm/elastic-agent/templates/agent/eck/_pod_template.yaml
	modified:   deploy/helm/elastic-agent/templates/agent/eck/daemonset.yaml
	modified:   deploy/helm/elastic-agent/templates/agent/eck/deployment.yaml
	modified:   deploy/helm/elastic-agent/templates/agent/eck/statefulset.yaml
	deleted:    deploy/helm/elastic-agent/templates/agent/k8s/_pod_template.tpl
	new file:   deploy/helm/elastic-agent/templates/agent/k8s/_pod_template.yaml
	modified:   deploy/helm/elastic-agent/templates/agent/k8s/daemonset.yaml
	modified:   deploy/helm/elastic-agent/templates/agent/k8s/deployment.yaml
	modified:   deploy/helm/elastic-agent/templates/agent/k8s/statefulset.yaml

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   deploy/helm/elastic-agent/examples/eck/rendered/manifest.yaml
	both modified:   deploy/helm/elastic-agent/examples/kubernetes-default/rendered/manifest.yaml
	both modified:   deploy/helm/elastic-agent/examples/kubernetes-hints-autodiscover/rendered/manifest.yaml
	both modified:   deploy/helm/elastic-agent/examples/kubernetes-only-logs/rendered/manifest.yaml
	both modified:   deploy/helm/elastic-agent/examples/multiple-integrations/rendered/manifest.yaml
	both modified:   deploy/helm/elastic-agent/examples/nginx-custom-integration/rendered/manifest.yaml
	both modified:   deploy/helm/elastic-agent/examples/system-custom-auth-paths/rendered/manifest.yaml

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

* Use PodTemplate resource in the Helm Chart

* Remove unnecessary named template

* Use PodTemplate resource in the Helm Chart for ECK

(cherry picked from commit f891fb0)

# Conflicts:
#	deploy/helm/elastic-agent/examples/eck/rendered/manifest.yaml
#	deploy/helm/elastic-agent/examples/kubernetes-default/rendered/manifest.yaml
#	deploy/helm/elastic-agent/examples/kubernetes-hints-autodiscover/rendered/manifest.yaml
#	deploy/helm/elastic-agent/examples/kubernetes-only-logs/rendered/manifest.yaml
#	deploy/helm/elastic-agent/examples/multiple-integrations/rendered/manifest.yaml
#	deploy/helm/elastic-agent/examples/nginx-custom-integration/rendered/manifest.yaml
#	deploy/helm/elastic-agent/examples/system-custom-auth-paths/rendered/manifest.yaml
@swiatekm swiatekm force-pushed the mergify/bp/8.16/pr-5831 branch from 66672bb to dde8dc5 Compare November 5, 2024 10:34
@swiatekm swiatekm enabled auto-merge (squash) November 5, 2024 10:37
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@pierrehilbert pierrehilbert added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label Nov 5, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@swiatekm swiatekm merged commit b86b72d into 8.16 Nov 5, 2024
10 checks passed
@swiatekm swiatekm deleted the mergify/bp/8.16/pr-5831 branch November 5, 2024 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport conflicts There is a conflict in the backported pull request Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants