Refactor update logic in pkg/lib/kptops (cleanup + structure improvements) (#4379)#4441
Open
NETIZEN-11 wants to merge 7 commits intokptdev:mainfrom
Open
Refactor update logic in pkg/lib/kptops (cleanup + structure improvements) (#4379)#4441NETIZEN-11 wants to merge 7 commits intokptdev:mainfrom
NETIZEN-11 wants to merge 7 commits intokptdev:mainfrom
Conversation
added 7 commits
March 18, 2026 00:44
…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.
…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>
- 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.
- 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.
- Remove 50+ lines of commented dead code - Resolve TODO comment with proper printer implementation - Replace hardcoded strings with constants (KptfileName, EmptyTempDirPrefix, RootPackagePath) - Split monolithic function into 7 focused functions - Add comprehensive input validation and error handling - Improve resource cleanup with proper defer statements - Update copyright to 2022-2026 for modifications Fixes kptdev#4379 Signed-off-by: NETIZEN-11 <nitesh@example.com>
✅ Deploy Preview for kptdocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4379
Refactors the update-related code in pkg/lib/kptops to improve readability, structure, and maintainability.
The changes include removing unused code, simplifying existing logic, and making the implementation more consistent.
No functional changes are introduced; this PR focuses only on code cleanup and organization.
Build and basic checks pass successfully.
Further adjustments may be required after the Porch transfer is completed.