Commit Graph
218 Commits
Author SHA1 Message Date
Scott Rigby 069b525332 Merge pull request #13586 from jessesimpson36/cleaner-stacktraces
fix: add formatting for errors to make multiline stacktraces in helm templates
2025-06-03 21:37:54 -04:00
yetyear 03448d1d79 refactor: use maps.Copy for cleaner map handling
Signed-off-by: yetyear <flite@outlook.com>
2025-05-09 14:33:25 +08:00
George Jenkins a1f8802de9 Merge pull request #30553 from Zhanweelee/add_mustToYaml_support
feat: Add mustToYaml and mustToJson template functions
2025-05-06 20:56:40 -07:00
Jesse Simpson e0a67b1028 test: use more realistic unit-test scenario by not relying on Release.Name
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:20:27 -04:00
Jesse Simpson d10c5f6429 style: trim space from formatted error messages
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:20:27 -04:00
Jesse Simpson 0e0a8cc765 fix: address no-template-associated type of error
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:20:26 -04:00
Jesse Simpson 013f27c294 fix: use errors.New instead of fmt.Errorf
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 868cdc261f refactor: reduce flow-control operations
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 48922e21d1 refactor: use struct equality instead of comparing each composition
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson ac98e977c3 refactor: switch to while loop instead of for to reduce unnecessary variables
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 65084371c9 refactor: replace if MatchString with FindStringSubMatch
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 782f6c6409 refactor: shorten regex subexp syntax
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 4b9a9ecaf6 refactor: rename function and add doc-string
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 4f63c73353 refactor: remove impractical safety check
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 5202820f2f refactor: define regexs at package scope
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson cbdc22128e refactor: use strings.Builder instead of string concatenation
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson cdcf1bc601 style: remove unnecessary break
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 3cc4cb60ba refactor: prevent duplicates being inserted rather than post-filtering
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson deea4a0d0e refactor: remove more unnecessary format calls
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 13b232e061 refactor: make use of regexs for err parsing
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson daf4c34879 fix: use originalErr instead of formatting original error
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 98da3e28b6 fix: add some index checking and fixed a test that relied on type-checking
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 80d7a1b33f style: make format
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 487f72b822 fix: added protection against while-true condition in unbounded for loop
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 6bb836374b test: adjusted to make it more meaningful and to pass
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 383a758aec fix: add quality checks to ensure formatted error doesnt remove important info
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson d8bec4e30f fix: remove comparison from old error message to new
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson c481470985 style: renamed i variable for consistency
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 2e3f6dce28 fix: save to fileLocation rather than fileLocations[i] which gets overwritten
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson f09bbb8ab8 style: consolidate for loops
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 1357db4db1 style: removed variable only used once
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson a56daca82b style: use interface functions instead of inline logic
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 87f9e2dc45 style: create String function for TraceableError representing one chunk of a stacktrace
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 6cd0c0082a fix: split up the multiline errors to be more vertical
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson cc477e9f79 fix: adjust test to not require external chart
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:26 -04:00
Jesse Simpson 14f902c245 wip: draft at making cleaner stacktraces
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:16:09 -04:00
Justen Stall 280a9ddbdb Merge branch 'main' into stdlib-errors-2
Signed-off-by: Justen Stall <39888103+justenstall@users.noreply.github.com>
2025-04-21 12:13:10 -04:00
Scott Rigby eb6e240cfe Merge pull request #30734 from ipaqsa/feature/add-custom-template-funcs
feat(pkg/engine): add support for custom template funcs
2025-04-21 11:13:12 -04:00
Benoit Tigeot e2461de3c2 Fix test with toml bump
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-19 00:48:23 +02:00
Stepan Paksashvili b54349d9b2 fix(pkg/engine): allow to override all functions
Signed-off-by: Stepan Paksashvili <stepan.paksashvili@flant.com>
2025-04-18 10:29:56 +03:00
Stepan Paksashvili 8982b57e5e feat(pkg/engine): and custom funcs overriding test
Signed-off-by: Stepan Paksashvili <stepan.paksashvili@flant.com>
2025-04-18 10:29:56 +03:00
Stepan Paksashvili 9073bcf53e feat(pkg/engine): add support for custom template funcs
Enhances the template engine and action config to allow users to inject custom template functions via an action config when using Helm as a library.

Closes #30733

Signed-off-by: Stepan Paksashvili <stepan.paksashvili@flant.com>
2025-04-18 10:29:56 +03:00
Matt Farina 7a1eb77e77 Merge pull request #30708 from benoittgt/migrate-kube-pkg-to-slog
Migrate pkg to slog
2025-04-11 20:50:34 +01:00
Matt Farina ed005f5c32 Removing deprecation notice for this function.
While the constructor is not used by Helm itself, it is used by SDK
users and there is currently no alternative way to expose this.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-04-10 13:45:02 -04:00
Benoit Tigeot 0c85456788 Leverage slog.Any for errors
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-07 18:26:48 +02:00
Robert Sirchia c5991028e0 fixing matts changes
Signed-off-by: Robert Sirchia <rsirchia@outlook.com>
2025-03-21 16:12:53 -04:00
Robert Sirchia 3a19576377 making changes as requested by matt
Signed-off-by: Robert Sirchia <rsirchia@outlook.com>
2025-03-10 15:40:10 -04:00
Robert Sirchia 4422000330 fixing case issues with the logging of my errors
Signed-off-by: Robert Sirchia <rsirchia@outlook.com>
2025-03-05 17:21:29 +01:00
Robert Sirchia 848c134e0c fixing error messages
Signed-off-by: Robert Sirchia <rsirchia@outlook.com>
2025-02-28 16:14:48 -05:00
Robert Sirchia c2e6ed8ae5 fixing build error
Signed-off-by: Robert Sirchia <rsirchia@outlook.com>
2025-02-28 08:22:53 -05:00