Skip to content

Add script functions for reporting Kubernetes manifests from scripts #1474

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

Merged
merged 15 commits into from
May 7, 2025

Conversation

APErebus
Copy link
Contributor

@APErebus APErebus commented Apr 16, 2025

Adds new functions to both the PowerShell and Bash bootstrap scripts to allow for reporting of kubernetes manifests.

There are two functions

  1. Report-KubernetesManifest/report_kubernetes_manifest which takes two parameters, the manifest content and optionally, the namespace.

This function splits the manifest on --- (with/without trailing spaces) and registers each document separately using the service message.

If a manifest contains multiple documents and a namespace is provided, all reported manifests get the same namespace

  1. Report-KubernetesManifestFile/report_kubernetes_manifest_file which takes two parameters, the full path to the manifest file and optionally, the namespace.

This function reads the contents of the file and then calls the function above.

Copy link
Contributor

@eddymoulton eddymoulton left a comment

Choose a reason for hiding this comment

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

Changes look good to me, just a few nits for your consideration.

Love to see the testing - it's got me wondering if we should add tests for some of the poorly crafted yaml scenarios you identified in the PR description (eg. extra spaces before document separators, excess newlines, double document separators without content between, etc.).
I'd be content knowing you've tested these manually if you think adding them as test cases is overkill.

@APErebus APErebus enabled auto-merge (squash) May 7, 2025 02:43
@APErebus APErebus merged commit 57d943a into main May 7, 2025
41 checks passed
@APErebus APErebus deleted the ap/manifest-report-script branch May 7, 2025 03:11
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