* Fix kyaml/yaml field access deref nil value for methods that look "nil-safe"
This change is addressing observed panics within kustomize that obscure the
actual failure. The primary observed problem case involves RNode.Content.
* Fix test case
* Fixes from review
* update go 1.24.6
* fix non-constant format string error
* update golang.org/x/tools@v0.36.0 and github.com/golangci/golangci-lint@v1.64.8 to pass execute golangci-lint
* add a verpose diff output to prow test
* remove pluginator binary version from generated files
This includes the go-difflib and go-spew reverts, which means the
corresponding exclusions can be removed. cmd/gorepomod/go.mod loses a
number of indirect dependencies thanks to the spf13/viper cleanup, but
hack/go.mod gains a few.
Signed-off-by: Stephen Kitt <skitt@redhat.com>
* feat: add exec-plugin argument and environment support
Previously, the documentation lead to think that this is working, but
it's not been implemented.
This PR is fixing this
Signed-off-by: Matthias Riegler <matthias.riegler@ankorstore.com>
* chore: disable linting for env var split
Signed-off-by: Matthias Riegler <matthias.riegler@ankorstore.com>
---------
Signed-off-by: Matthias Riegler <matthias.riegler@ankorstore.com>
* workspace sync
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* downgrade go-difflib and go-spew to tagged releases
commit d35edbf80d updated these dependencies
to untagged versions. The diff in both dependencies show that there's no
code changes, and it's unlikely for those modules to do new releases.
Unfortunate, because of that change all projects depending on kubernetes
or any of it's modules now had to upgrade to unreleased versions of
these.
This patch reverts those updates (but it may take some time before
all other projects can be reverted).
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
---------
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* Pin tool versions with hack/go.mod
This change centralizes the tracking of versions for tools used for
development and testing. This way, the tools and all their
dependencies have their checksums stored in hack/go.sum, which
improves supply chain security.
* Workspace Sync & Tidy
Assert keeps going after failure, but require immediately fails
the tests, making it easier to find the output related to the test
failure, rather than having to comb through a bunch of subsequent
assertion failures. For equality tests, we may or may not want to
continue, but for error checks we almost always want to immediately
fail the test. Exceptions can be changed as-needed.
- go mod tidy (all modules)
- go work sync
- Fixed plugin generation for Go 1.21
- Updated linting for Go 1.21
- Fixed minecraft example for Helm v3 pull download path
- Update dev docs to mention Go 1.21
- Regenerate plugins with Go 1.21
Related issues:
* https://github.com/kubernetes-sigs/kustomize/issues/5031
* https://github.com/kubernetes-sigs/kustomize/issues/5171
After noting this behaviour was not present in
d89b448c74 a `git bisect` pointed to the
change 1b7db20504. The issue with that
change is that upon seeing a `null` node it would replace it with a node
whose value was equivalent but without a `!!null` tag. This meant that
one application of a patch would have the desired approach: the result
would be `null` in the output, but on a second application of a similar
patch the field would be rendered as `"null"`.
To avoid this, define a new attribute on `RNode`s that is checked before
clearing any node we should keep. The added
`TestApplySmPatch_Idempotency` test verifies this behaviour.
See also https://github.com/kubernetes-sigs/kustomize/pull/5365 for an
alternative approach
```shell
go work sync
for i in $(find . -name go.mod); do (cd $(dirname $i); go mod tidy); done
```
Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
* test: add openapi.IsNamespaceScoped benchmark
Add a benchmark test for IsNamespaceScoped performance when the default
schema is in use.
* perf: limit initSchema calls from openapi.IsNamespaceScoped
Avoid calling initSchema from openapi.IsNamespaceScoped when possible.
Work done in #4152 introduced a precomputed namespace scope map based on
the default built-in schema. This commit extends that work by avoiding
calls to initSchema when a resource is not found in the precomputed map
and the default built-in schema is in use. In those cases, there is no
benefit to calling initSchema since the precomputed map is exactly what
will be calculated by parsing the default built-in schema.
* fix: delay parsing of default built-in schema
When namespace scope can be determined by the precomputed map but the
type is not present in the precomputed map, delay the parsing of the
default built-in schema.
If the schema to be initialized is the default built-in schema and the
type is not in the precomputed map, then the type will not be found in
the default built-in schema. There is no need to parse the default
built-in schema for that answer; its parsing may be delayed until it
is needed for some other purpose.
In cases where the schema is used solely for namespace scope checks, the
schema might not ever be parsed. Skipping the parsing reduces both
execution time and memory use.
* fix: correct openapi.go's schemaNotParsed value
openapiData initializes with defaultBuiltInSchemaParseStatus set to 0,
so schemaNotParsed should have 0 as its value.