Skip to content

Commit

Permalink
log version to result output
Browse files Browse the repository at this point in the history
`kustomize fn run` does not format stderr the same as `kpt fn render`
  • Loading branch information
jashandeep-sohi committed Aug 20, 2024
1 parent 6ef8329 commit 2f0a4ef
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
10 changes: 7 additions & 3 deletions cmd/seal/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ import (
)

func main() {
fn.Logf(fmt.Sprintf("krm-fn-sealedsecets-seal (version=%s, url=%s)", version.Name, version.URL))

if err := fn.AsMain(fn.ResourceListProcessorFunc(seal.Process)); err != nil {
if err := fn.AsMain(fn.ResourceListProcessorFunc(process)); err != nil {
os.Exit(1)
}
}

func process(rl *fn.ResourceList) (bool, error) {
rl.Results.Infof(fmt.Sprintf("krm-fn-sealedsecets-seal (version=%s, url=%s)", version.Name, version.URL))

return seal.Process(rl)
}
10 changes: 7 additions & 3 deletions cmd/unseal/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ import (
)

func main() {
fn.Logf(fmt.Sprintf("krm-fn-sealedsecets-unseal (version=%s, url=%s)", version.Name, version.URL))

if err := fn.AsMain(fn.ResourceListProcessorFunc(unseal.Process)); err != nil {
if err := fn.AsMain(fn.ResourceListProcessorFunc(process)); err != nil {
os.Exit(1)
}
}

func process(rl *fn.ResourceList) (bool, error) {
rl.Results.Infof(fmt.Sprintf("krm-fn-sealedsecets-unseal (version=%s, url=%s)", version.Name, version.URL))

return unseal.Process(rl)
}

0 comments on commit 2f0a4ef

Please sign in to comment.