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

Let API subcommand accept the runtime config via stdin #5422

Merged
merged 2 commits into from
Jan 16, 2025

Conversation

twz123
Copy link
Member

@twz123 twz123 commented Jan 8, 2025

Description

The API subcommand is not designed to run as a standalone process. Rather, it's intended to be executed under the supervision of a k0s controller. Therefore, the usual way of loading the configuration is inappropriate. Instead, have this subcommand accept the runtime configuration via stdin. This will prevent a false fallback to a generated default configuration, as well as loading the configuration from a possibly existing default configuration file that has nothing to do with the one used by the supervising process.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  • Manual test
  • Auto test added

Checklist:

  • My code follows the style guidelines of this project
  • My commit messages are signed-off
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

@twz123 twz123 force-pushed the api-runtime-config-stdin branch 2 times, most recently from 1c7d54b to 98be923 Compare January 9, 2025 07:34
@twz123 twz123 marked this pull request as ready for review January 9, 2025 09:31
@twz123 twz123 requested review from a team as code owners January 9, 2025 09:31
@twz123 twz123 requested review from ncopa and jnummelin January 9, 2025 09:31
Copy link
Contributor

github-actions bot commented Jan 9, 2025

This pull request has merge conflicts that need to be resolved.

@twz123 twz123 force-pushed the api-runtime-config-stdin branch from 98be923 to 54337cf Compare January 9, 2025 11:40
@twz123 twz123 force-pushed the api-runtime-config-stdin branch from 54337cf to a4e9e5a Compare January 10, 2025 15:56
ncopa
ncopa previously approved these changes Jan 14, 2025
Copy link
Contributor

This pull request has merge conflicts that need to be resolved.

Copy link
Contributor

This pull request has merge conflicts that need to be resolved.

Copy link
Contributor

This pull request has merge conflicts that need to be resolved.

Have a more functional apporach of assembling the HTTP handlers.

Signed-off-by: Tom Wieczorek <twieczorek@mirantis.com>
The API subcommand is not designed to run as a standalone process.
Rather, it's intended to be executed under the supervision of a k0s
controller. Therefore, the usual way of loading the configuration
is inappropriate. Instead, have this subcommand accept the runtime
configuration via stdin. This will prevent a false fallback to a
generated default configuration, as well as loading the configuration
from a possibly existing default configuration file that has nothing to
do with the one used by the supervising process.

Signed-off-by: Tom Wieczorek <twieczorek@mirantis.com>
@twz123 twz123 force-pushed the api-runtime-config-stdin branch from 1f9ad6d to b17f100 Compare January 15, 2025 15:01
@ncopa ncopa self-requested a review January 16, 2025 15:06
@twz123 twz123 merged commit 1dc87fa into k0sproject:main Jan 16, 2025
92 checks passed
@twz123 twz123 deleted the api-runtime-config-stdin branch January 16, 2025 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants