-
Notifications
You must be signed in to change notification settings - Fork 484
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 sprig functions #5593
Add sprig functions #5593
Conversation
"deepCopy", | ||
"mustDeepCopy", | ||
"typeOf", | ||
"typeIs", | ||
"typeIsLike", | ||
"kindOf", | ||
"kindIs", | ||
"deepEqual", |
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'd probably leave out the reflection funcs for now?
sprigMap := sprig.TxtFuncMap() | ||
ourMap := make(template.FuncMap) | ||
for _, f := range funcList { | ||
ourMap[f] = sprigMap[f] |
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.
We should fail if the expected function does not exist in sprigMap (e.g. we had a typo or a function was removed)
sprigMap := sprig.TxtFuncMap() | ||
ourMap := make(template.FuncMap) | ||
for _, f := range funcList { |
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'd probably construct ourMap
once at package initialization time?
) | ||
|
||
var funcList = [...]string{ |
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.
var funcList = [...]string{ | |
var funcList = []string{ |
"randAscii", | ||
"randNumeric", | ||
"swapcase", | ||
"shuffle", |
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'd probably leave this one out?
"toJson", | ||
"toPrettyJson", | ||
"toRawJson", |
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 imagine wanting to convert something to JSON inside of a path template...
"mustToJson", | ||
"mustToPrettyJson", | ||
"mustToRawJson", |
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 imagine wanting to convert something to JSON inside of a path template...
Hmm, looking at the failing windows integration test, I think we're falling victim to package init order.... |
Fixes: spiffe#5575 Signed-off-by: Kevin Fox <[email protected]>
The string its failing on (sha512sum) isn't in the codebase anywhere anymore.... It was in an earlier version of the pr. Could the vm be persisting a bad pr somehow? |
Fixes: #5575