Skip to content

feat: parameterize configuration#7

Merged
ianlewis merged 1 commit intomainfrom
2-parameterize-timeouts
Dec 17, 2025
Merged

feat: parameterize configuration#7
ianlewis merged 1 commit intomainfrom
2-parameterize-timeouts

Conversation

@ianlewis
Copy link
Copy Markdown
Contributor

Allow setting the namespace selector, target environment variable, termination grace period, and debounce period via environment variables or flags.

Fixes #2

@ianlewis ianlewis linked an issue Dec 16, 2025 that may be closed by this pull request
@ianlewis ianlewis force-pushed the 2-parameterize-timeouts branch 5 times, most recently from 3ee3ad6 to d238940 Compare December 16, 2025 08:14
@ianlewis ianlewis marked this pull request as ready for review December 16, 2025 08:29
@ianlewis ianlewis requested review from Ladicle and Copilot December 16, 2025 08:29
Copy link
Copy Markdown

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 parameterizes the reloader configuration by allowing the namespace selector, target environment variable, termination grace period, and debounce period to be set via environment variables or command-line flags. Previously, these settings were hardcoded or only available through environment variables.

Key changes:

  • Introduced a ProcessManagerConfig struct to hold all configuration parameters
  • Replaced hardcoded constants with configurable flags and environment variables with defaults
  • Refactored the run function to accept a configuration object instead of individual parameters

Reviewed changes

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

File Description
main.go Added flag parsing for configuration parameters, helper functions for reading environment variables with defaults, and copyright header
reloader.go Introduced ProcessManagerConfig struct, refactored ProcessManager to use configuration, updated UpdateNamespaces to accept a slice instead of a string, and added copyright header
reloader_test.go Updated test to use new ProcessManagerConfig struct instead of environment variables and added copyright header

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread main.go
Comment thread reloader.go Outdated
Comment thread reloader.go Outdated
Copy link
Copy Markdown
Contributor

@Ladicle Ladicle left a comment

Choose a reason for hiding this comment

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

Could you please update README.md as well?

Comment thread main.go
@ianlewis ianlewis force-pushed the 2-parameterize-timeouts branch from d238940 to 5da7d5a Compare December 17, 2025 06:41
@ianlewis
Copy link
Copy Markdown
Contributor Author

Could you please update README.md as well?

Done. I left the note about the -- separator because the Go flag package will handle this. Flags after the -- are returned in flagset.Args()

Allow setting the namespace selector, target environment variable,
termination grace period, and debounce period via environment variables
or flags.

A new `--kubeconfig` flag is added to specify the path to the
`kubeconfig` file.

Signed-off-by: Ian Lewis <ianlewis@preferred.jp>
@ianlewis ianlewis force-pushed the 2-parameterize-timeouts branch from 5da7d5a to 25d5c85 Compare December 17, 2025 07:47
Copy link
Copy Markdown
Contributor

@Ladicle Ladicle left a comment

Choose a reason for hiding this comment

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

LG!

@ianlewis ianlewis merged commit a0de303 into main Dec 17, 2025
@ianlewis ianlewis deleted the 2-parameterize-timeouts branch December 17, 2025 08:53
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.

Parameterize timeouts

3 participants