Skip to content

Conversation

APErebus
Copy link
Contributor

@APErebus APErebus commented Sep 2, 2025

Background

Allows the script pods and containers to have certain fields controlled via a new custom resource, the scriptpodtemplate.agent.octopus.com

Results

When creating the script pod, we now try and read the old custom resource. If this exists, we then use its pod spec, script container and/or the watchdog container spec's to build the base specs/containers.

We then modify these with any additional changes we require for the pods to execute correctly

How to review this PR

Quality ✔️

Pre-requisites

  • I have read How we use GitHub Issues for help deciding when and where it's appropriate to make an issue.
  • I have considered informing or consulting the right people, according to the ownership map.
  • I have considered appropriate testing for my change.

"DefaultLogDirectory": "<telepresence-root>/octopus/logs",
"BOOTSTRAPRUNNEREXECUTABLEPATH": "/tmp/k8s-agent-debug-vol/bootstrapRunner",
"TELEPRESENCE_ROOT": "<telepresence-root>",
"OCTOPUS_HOME": "<telepresence-root>",
Copy link
Contributor

Choose a reason for hiding this comment

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

Small fix from me!

@APErebus APErebus marked this pull request as ready for review September 2, 2025 22:52
@APErebus APErebus requested review from a team as code owners September 2, 2025 22:52
@eddymoulton eddymoulton requested a review from Copilot September 2, 2025 23:00
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements support for customizing Kubernetes script pod creation through a new custom resource called scriptpodtemplate.agent.octopus.com. The implementation allows users to define custom pod specifications, script container specs, and watchdog container specs that serve as base templates for script execution pods.

Key changes:

  • Introduces ScriptPodTemplateCustomResource to define custom pod templates
  • Adds KubernetesCustomResourceService to retrieve and manage custom resources
  • Updates pod creation logic to merge custom resource specifications with default configurations

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
ScriptPodTemplateCustomResource.cs Defines the custom resource structure for script pod templates
KubernetesCustomResourceService.cs Service for retrieving script pod template custom resources
KubernetesScriptPodCreator.cs Updated pod creation logic to integrate custom resource templates
KubernetesRawScriptPodCreator.cs Updated raw script pod creator to support custom resource templates
KubernetesContainerExtensionMethods.cs Utility extension method for deep cloning Kubernetes containers
KubernetesModule.cs Dependency injection registration for the new service
launchSettings.template.json Configuration update for telepresence debugging

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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.

LGTM

@APErebus APErebus merged commit 0c6b6f5 into main Sep 2, 2025
51 checks passed
@APErebus APErebus deleted the ap/script-pod-crd branch September 2, 2025 23:15
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.

3 participants