-
Notifications
You must be signed in to change notification settings - Fork 3
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
List secrets with last updated, input bugfix, create/update instructions update #177
Changes from all commits
2cb24d1
8101f79
edfb4e1
fa6a63a
6b100cf
3130223
d2f31d3
f4ba610
ab5dfb7
995b921
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
kind: Bugfix | ||
body: fix bug not reading files when using -f | ||
time: 2023-09-25T13:07:03.642418-04:00 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
kind: Feature | ||
body: show last updated when listing secrets | ||
time: 2023-09-25T13:07:15.386994-04:00 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,14 +11,16 @@ import ( | |
var dataFile string | ||
|
||
func readInputConfig() { | ||
viper.SetConfigType("yaml") | ||
switch dataFile { | ||
case ".": | ||
// TODO: does this block ever actually ever run? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I could not find a way to get it to trigger though, at least on bash/zsh. IIRC I ran into this problem before, passing I don't think we should remove it immediately, but we should look into it because if this branch never gets called the |
||
viper.SetConfigFile("./data.yaml") | ||
case "-": | ||
if isStdInFromTerminal() { | ||
log.Info().Msg("Reading input directly from command line...") | ||
// TODO: this can take up to half a second to output which interrupts the user's experience | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤔 If this is working correctly users shouldn't see this unless they are manually typing in yaml formatted input. If that's not the case lmk and I can take a closer look There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To clarify, this happens to me only when manually typing in the command. (The check What happens is: I start typing, then a second later the message pops up, I lose track of what I've typed, then |
||
log.Info().Msg("Reading input directly from command line... Press CTRL+D to stop typing") | ||
This conversation was marked as resolved.
Show resolved
Hide resolved
|
||
} | ||
viper.SetConfigType("yaml") | ||
viper.ReadConfig(os.Stdin) | ||
default: | ||
viper.SetConfigFile(dataFile) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC
-f filename.yaml
wasn't working until I moved this up here from outside of thecase "-"
block.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't think of a reason for this to not be applied in certain conditions vs others, so it makes sense to move to the top.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is explicitly set to
yaml
below sinceviper
has no way to infer the filetype from the stdin input.viper.SetConfigFile() defines the path, name and extension of the config file. Then
viper.ReadInConfig()
will know how to read it later.If somebody is using a
.json
file I would assume viper would internally reset the configType below?In any case, @rocktavious has mentioned that we should look into a better solution for reading user input in place of viper
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ya we need to fix this reading from input problems globally