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

Support for CLI and JSON-styled startup configs #37

Merged
merged 27 commits into from
Mar 29, 2023
Merged

Conversation

hellt
Copy link
Member

@hellt hellt commented Mar 28, 2023

This PR adds ability to provide startup configurations in both CLI and JSON formats.

Note, depends on openconfig/kne#343

Configs are still mounted to the srl pods, but instead of being copied to /opt/srlinux/config.json they are being loaded via CLI command.

In case of CLI-styled config:

source /tmp/startup-config/config.cli

In case of JSON:

load file /tmp/startup-config/config.json

with the following commit now.

On the KNE side we provide the startup config file name, which is either config.cli or config.json. KNE checks if the provided file has .json extension, if yes - the file name is config.json, else it is config.cli.

Additionally in this PR some chaotic changes are made to the way we update status and track if the update is needed. Very chaotic changes...

@codecov
Copy link

codecov bot commented Mar 29, 2023

Codecov Report

Merging #37 (4bf0fe6) into main (c42d638) will increase coverage by 50.79%.
The diff coverage is 14.12%.

❗ Current head 4bf0fe6 differs from pull request most recent head 5bf9dd5. Consider uploading reports for the commit 5bf9dd5 to get more accurate results

@@            Coverage Diff            @@
##           main      #37       +/-   ##
=========================================
+ Coverage      0   50.79%   +50.79%     
=========================================
  Files         0        8        +8     
  Lines         0      758      +758     
=========================================
+ Hits          0      385      +385     
- Misses        0      346      +346     
- Partials      0       27       +27     
Impacted Files Coverage Δ
api/v1/srlinux_types.go 100.00% <ø> (ø)
controllers/startup_config.go 0.00% <0.00%> (ø)
controllers/srlinux_controller.go 60.52% <54.54%> (ø)
controllers/pod.go 83.42% <81.25%> (ø)

... and 4 files with indirect coverage changes

@hellt
Copy link
Member Author

hellt commented Mar 29, 2023

send it, baby

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.

1 participant