Skip to content

Update kyaml and kustomize API versions in catalog functions#4432

Open
NETIZEN-11 wants to merge 7 commits intokptdev:mainfrom
NETIZEN-11:main
Open

Update kyaml and kustomize API versions in catalog functions#4432
NETIZEN-11 wants to merge 7 commits intokptdev:mainfrom
NETIZEN-11:main

Conversation

@NETIZEN-11
Copy link

No description provided.

…nctions

- Upgrade sigs.k8s.io/kustomize/api from v0.20.1 to v0.21.0
- Upgrade sigs.k8s.io/kustomize/kyaml from v0.20.1 to v0.21.0
- Upgrade k8s.io/api from v0.34.1 to v0.35.0
- Upgrade k8s.io/apimachinery from v0.34.1 to v0.35.0
- Upgrade k8s.io/kubectl from v0.34.1 to v0.35.0
- Upgrade github.com/kptdev/krm-functions-catalog/functions/go/apply-setters from v0.2.2 to v0.2.4
- Update catalog function registry to reference new apply-setters version
- Run go mod tidy to resolve transitive dependencies

Resolves GitHub Issue kptdev#4406

All catalog functions remain compatible with new APIs - zero breaking changes encountered.
Zero compilation errors and zero failing tests across repository.
Copilot AI review requested due to automatic review settings March 17, 2026 19:19
@netlify
Copy link

netlify bot commented Mar 17, 2026

Deploy Preview for kptdocs ready!

Name Link
🔨 Latest commit 151a0a5
🔍 Latest deploy log https://app.netlify.com/projects/kptdocs/deploys/69bc552ff422420008267832
😎 Deploy Preview https://deploy-preview-4432--kptdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

…nctions

- Upgrade sigs.k8s.io/kustomize/api from v0.20.1 to v0.21.0
- Upgrade sigs.k8s.io/kustomize/kyaml from v0.20.1 to v0.21.0
- Upgrade k8s.io/api from v0.34.1 to v0.35.0
- Upgrade k8s.io/apimachinery from v0.34.1 to v0.35.0
- Upgrade k8s.io/kubectl from v0.34.1 to v0.35.0
- Upgrade github.com/kptdev/krm-functions-catalog/functions/go/apply-setters from v0.2.2 to v0.2.4
- Update catalog function registry to reference new apply-setters version
- Run go mod tidy to resolve transitive dependencies

Resolves GitHub Issue kptdev#4406

All catalog functions remain compatible with new APIs - zero breaking changes encountered.
Zero compilation errors and zero failing tests across repository.

Signed-off-by: NETIZEN-11 <nitesh@example.com>
NETIZEN-11 added 2 commits March 18, 2026 10:51
- Add new RenderStatus and PipelineStepResult structs as per GitHub issue kptdev#4390
- Clearly separate mutation pipeline steps from validation steps
- Capture execution failures (network errors, missing images, command failures)
- Record stderr and exit codes for each pipeline step
- Extract and categorize error results from function results
- Aggregate all failures into comprehensive ErrorSummary
- Update pipeline execution logic to populate detailed step results
- Maintain backward compatibility with existing Rendered conditions
- Add comprehensive unit tests for new functionality
- Fix JSON tags and serialization issues

This addresses the problems with the current schema:
- Difficult troubleshooting → Clear step-by-step execution details
- Unclear error reporting → Structured error information with aggregation
- Inability to represent execution failures → Detailed execution error capture
- Confusing result structure → Clean separation of mutation/validation steps
…ng issues

- Add Windows build constraints to exclude wasmtime support
- Fix linting issues: spelling, unused parameters, unused functions
- Use errors.New for static error strings
- Remove unused setRenderCondition function

This resolves the failing CI checks for docker and podman builds.
Copilot AI review requested due to automatic review settings March 19, 2026 06:33
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Mar 19, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@efiacor efiacor requested a review from Copilot March 19, 2026 07:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes Kubernetes/kustomize-related dependencies and updates render/function execution plumbing to align with newer APIs, while also persisting more detailed render execution status into the root Kptfile.

Changes:

  • Bump kustomize/kyaml, Kubernetes libs (k8s.io/*), apply-setters, and test deps in go.mod/go.sum.
  • Extend Kptfile status to include a new renderStatus payload and populate it during fn render execution.
  • Adjust wasmtime build constraints (disable wasmtime on Windows) and update the built-in catalog apply-setters image tag.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pkg/test/runner/runner.go Minor formatting cleanup.
pkg/api/kptfile/v1/types.go Adds new Status.RenderStatus schema and supporting types.
internal/util/render/executor.go Tracks per-step pipeline execution info and writes it to Kptfile status.
internal/util/render/executor_test.go Adds unit tests for new render-status helpers.
internal/kptops/functions.go Updates apply-setters catalog image version.
internal/fnruntime/wasmtime_unsupported.go Expands unsupported build condition and improves error message/impl.
internal/fnruntime/wasmtime.go Narrows supported build condition to non-Windows cgo builds.
go.mod Updates dependency versions (notably Kubernetes + kustomize).
go.sum Dependency graph updates from go mod tidy.
Comments suppressed due to low confidence (1)

internal/util/render/executor.go:92

  • The PR title/description focus on dependency/version updates, but this change also introduces a new persisted Kptfile schema field (status.renderStatus) and writes detailed pipeline step results into the root Kptfile. Please either update the PR description (and any relevant release notes / API docs) to reflect this user-visible behavior change, or consider splitting the RenderStatus feature into a separate PR.
	hctx := &hydrationContext{
		root:          root,
		pkgs:          map[types.UniquePath]*pkgNode{},
		fnResults:     fnresult.NewResultList(),
		renderStatus:  &kptfilev1.RenderStatus{},
		runnerOptions: e.RunnerOptions,
		fileSystem:    e.FileSystem,
		runtime:       e.Runtime,
	}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +28 to +33
k8s.io/api v0.35.0
k8s.io/apiextensions-apiserver v0.34.1
k8s.io/apimachinery v0.34.1
k8s.io/cli-runtime v0.34.1
k8s.io/client-go v0.34.1
k8s.io/component-base v0.34.1
k8s.io/apimachinery v0.35.0
k8s.io/cli-runtime v0.35.0
k8s.io/client-go v0.35.0
k8s.io/component-base v0.35.0
Comment on lines +479 to +524
MutationSteps []PipelineStepResult `json:"mutationSteps,omitempty"`

// ValidationSteps contains results from validation pipeline functions
ValidationSteps []PipelineStepResult `json:"validationSteps,omitempty"`

// ErrorSummary provides a consolidated summary of all errors
ErrorSummary string `json:"errorSummary,omitempty"`
}

// PipelineStepResult contains the result of executing a single pipeline step
type PipelineStepResult struct {
// Name is the name of the function step
Name string `json:"name,omitempty"`

// Image is the container image that was executed
Image string `json:"image,omitempty"`

// ExecPath is the executable path that was run
ExecPath string `json:"execPath,omitempty"`

// ExecutionError captures execution failures like network errors, missing images, etc.
ExecutionError string `json:"executionError,omitempty"`

// Stderr contains the standard error output from the function execution
Stderr string `json:"stderr,omitempty"`

// ExitCode is the exit code returned by the function
ExitCode int `json:"exitCode"`

// Results contains successful results from the function
Results []ResultItem `json:"results,omitempty"`

// ErrorResults contains error results from the function
ErrorResults []ResultItem `json:"errorResults,omitempty"`
}

// ResultItem represents a single result item from a function execution
type ResultItem struct {
// Resource is the KRM resource that was processed (serialized as YAML string)
Resource string `json:"resource,omitempty"`

// Message contains details about the result
Message string `json:"message,omitempty"`

// Severity indicates the severity level of the result (error, warning, info)
Severity string `json:"severity,omitempty"`
Comment on lines +391 to +413
for _, item := range fnResults.Items {
// Process the Results field which contains framework.Results
for _, result := range item.Results {
message := result.Message
severity := string(result.Severity) // Convert framework.Severity to string

// Default severity if not specified
if severity == "" {
if item.ExitCode == 0 {
severity = "info"
} else {
severity = "error"
}
}

resultItem := createResultItem(nil, message, severity)

if item.ExitCode == 0 {
results = append(results, resultItem)
} else {
errorResults = append(errorResults, resultItem)
}
}
assert.Empty(t, result.Resource)

// Test with resource
resource := yaml.MustParse(`apiVersion: v1\nkind: ConfigMap\nmetadata:\n name: test`)
- Update k8s.io/apiextensions-apiserver from v0.34.1 to v0.35.0
- Add yaml tags to RenderStatus, PipelineStepResult, and ResultItem structs
- Fix result classification logic to use severity instead of ExitCode
- Fix YAML test input to use proper multiline format
- Run go mod tidy to normalize dependencies

All changes maintain Go formatting and project coding style.
…subpackages

- Add isRootKptfile() helper function for robust root detection
- Enhance pkgContextResource() to generate package-context.yaml only for root packages
- Subpackages are now correctly suppressed to prevent duplicate ConfigMap creation
- Fix path normalization to handle relative paths like './Kptfile'
- Ensure only one ConfigMap 'kptfile.kpt.dev' exists in mutation pipeline

This resolves the 'ConfigMap already exists' error when rendering packages with subpackages.
Copilot AI review requested due to automatic review settings March 19, 2026 19:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants