-
Notifications
You must be signed in to change notification settings - Fork 220
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
Add support for configuration files #851
Merged
debarshiray
merged 4 commits into
containers:main
from
debarshiray:wip/rishi/cmd-add-config-file-support
Jul 23, 2021
Merged
Add support for configuration files #851
debarshiray
merged 4 commits into
containers:main
from
debarshiray:wip/rishi/cmd-add-config-file-support
Jul 23, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
debarshiray
added a commit
to debarshiray/toolbox
that referenced
this pull request
Jul 23, 2021
Figuring out the default toolbox image for a given distribution only needs to happen as part of resolving the final toolbox image name from the given command line options. Fallout from c990fb4 containers#828 containers#851
debarshiray
added a commit
to debarshiray/toolbox
that referenced
this pull request
Jul 23, 2021
A subsequent commit will add support for configuration files, which can override the default toolbox image. Since this override affects all commands, it effectively ends up adding a fourth option to the 'enter' command, other than the existing options to change the distribution, release and container. This makes it a lot more difficult to reason when only 'toolbox enter --release N' is enough to enter the created container. containers#828 containers#851
debarshiray
pushed a commit
to debarshiray/toolbox
that referenced
this pull request
Jul 23, 2021
The file format is TOML[0] but the file extension is .conf to follow the convention set by Podman. containers#828 containers#851
debarshiray
pushed a commit
to debarshiray/toolbox
that referenced
this pull request
Jul 23, 2021
It looks like there are some oddities with Viper [1]. The errors can't be examined with errors.As [2] and Viper doesn't actually throw ConfigFileNotFoundError if a configuration file is not found. Secondly, there's no way to find out if a key was actually specified in a configuration file. The InConfig API doesn't return 'true' even if a key was mentioned in a configuration file, and the IsSet API returns 'true' even if the key was only set via SetDefault in the code. [1] https://pkg.go.dev/github.com/spf13/viper [2] https://blog.golang.org/go1.13-errors containers#828 containers#851
debarshiray
force-pushed
the
wip/rishi/cmd-add-config-file-support
branch
from
July 23, 2021 01:02
bf823c4
to
c2e6074
Compare
Build failed.
|
debarshiray
added a commit
to debarshiray/toolbox
that referenced
this pull request
Jul 23, 2021
A subsequent commit will add support for configuration files, which can override the default toolbox image. Since this override affects all commands, it effectively ends up adding a fourth option to the 'enter' command, other than the existing options to change the distribution, release and container. This makes it a lot more difficult to reason when only 'toolbox enter --release N' is enough to enter the created container. containers#828 containers#851
debarshiray
pushed a commit
to debarshiray/toolbox
that referenced
this pull request
Jul 23, 2021
The file format is TOML[0] but the file extension is .conf to follow the convention set by Podman. containers#828 containers#851
debarshiray
pushed a commit
to debarshiray/toolbox
that referenced
this pull request
Jul 23, 2021
It looks like there are some oddities with Viper [1]. The errors can't be examined with errors.As [2] and Viper doesn't actually throw ConfigFileNotFoundError if a configuration file is not found. Secondly, there's no way to find out if a key was actually specified in a configuration file. The InConfig API doesn't return 'true' even if a key was mentioned in a configuration file, and the IsSet API returns 'true' even if the key was only set via SetDefault in the code. Some changes by Debarshi Ray. [1] https://pkg.go.dev/github.com/spf13/viper [2] https://blog.golang.org/go1.13-errors containers#828 containers#851
debarshiray
force-pushed
the
wip/rishi/cmd-add-config-file-support
branch
from
July 23, 2021 01:22
c2e6074
to
c07e1f5
Compare
Build failed.
|
Figuring out the default toolbox image for a given distribution only needs to happen as part of resolving the final toolbox image name from the given command line options. Fallout from c990fb4 containers#828 containers#851
A subsequent commit will add support for configuration files, which can override the default toolbox image. Since this override affects all commands, it effectively ends up adding a fourth option to the 'enter' command, other than the existing options to change the distribution, release and container. This makes it a lot more difficult to reason when only 'toolbox enter --release N' is enough to enter the created container. containers#828 containers#851
debarshiray
pushed a commit
to debarshiray/toolbox
that referenced
this pull request
Jul 23, 2021
The file format is TOML[0] but the file extension is .conf to follow the convention set by Podman. containers#828 containers#851
debarshiray
pushed a commit
to debarshiray/toolbox
that referenced
this pull request
Jul 23, 2021
It looks like there are some oddities with Viper [1]. The errors can't be examined with errors.As [2] and Viper doesn't actually throw ConfigFileNotFoundError if a configuration file is not found. Secondly, there's no way to find out if a key was actually specified in a configuration file. The InConfig API doesn't return 'true' even if a key was mentioned in a configuration file, and the IsSet API returns 'true' even if the key was only set via SetDefault in the code. Some changes by Debarshi Ray. [1] https://pkg.go.dev/github.com/spf13/viper [2] https://blog.golang.org/go1.13-errors containers#828 containers#851
debarshiray
force-pushed
the
wip/rishi/cmd-add-config-file-support
branch
from
July 23, 2021 01:49
c07e1f5
to
f893f6a
Compare
The file format is TOML[0] but the file extension is .conf to follow the convention set by Podman. containers#828 containers#851
It looks like there are some oddities with Viper [1]. The errors can't be examined with errors.As [2] and Viper doesn't actually throw ConfigFileNotFoundError if a configuration file is not found. Secondly, there's no way to find out if a key was actually specified in a configuration file. The InConfig API doesn't return 'true' even if a key was mentioned in a configuration file, and the IsSet API returns 'true' even if the key was only set via SetDefault in the code. Some changes by Debarshi Ray. [1] https://pkg.go.dev/github.com/spf13/viper [2] https://blog.golang.org/go1.13-errors containers#828 containers#851
debarshiray
force-pushed
the
wip/rishi/cmd-add-config-file-support
branch
from
July 23, 2021 01:59
f893f6a
to
20f4f68
Compare
HarryMichal
added
2. CLI
Issue is related to the command line interface
2. Under The Hood
Multiple areas of the app are influenced by this ticket
3. New Feature
New feature
6. Major Change
May cause breakage
7. Needs tests
The work needs new test cases added
labels
Jul 23, 2021
HarryMichal
added a commit
to HarryMichal/toolbox
that referenced
this pull request
Jul 29, 2021
HarryMichal
added a commit
to HarryMichal/toolbox
that referenced
this pull request
Jul 29, 2021
HarryMichal
added a commit
to HarryMichal/toolbox
that referenced
this pull request
Jul 29, 2021
HarryMichal
added a commit
to HarryMichal/toolbox
that referenced
this pull request
Jul 29, 2021
HarryMichal
added a commit
to HarryMichal/toolbox
that referenced
this pull request
Jul 29, 2021
HarryMichal
added a commit
to HarryMichal/toolbox
that referenced
this pull request
Jul 29, 2021
HarryMichal
added a commit
to HarryMichal/toolbox
that referenced
this pull request
Jul 29, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
2. CLI
Issue is related to the command line interface
2. Under The Hood
Multiple areas of the app are influenced by this ticket
3. New Feature
New feature
6. Major Change
May cause breakage
7. Needs tests
The work needs new test cases added
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes up #828 , and leaves out the tests because they look incomplete.