Tekton Alpha to Beta Migration Codemod
Automatically migrates Tekton Pipeline YAML files from v1alpha1 to v1beta1 API version following the official Tekton migration guide.
Installation
bash
What This Codemod Does
This codemod performs the following transformations on your Tekton YAML files:
1. Parameter Structure Migration
Before (v1alpha1):
yaml
After (v1beta1):
yaml
The codemod moves spec.inputs.params directly to spec.params and removes the inputs wrapper.
2. Resources Structure Migration
Before (v1alpha1):
yaml
After (v1beta1):
yaml
The codemod restructures resource definitions by:
- Moving
spec.inputs.resources→spec.resources.inputs - Moving
spec.outputs.resources→spec.resources.outputs - Consolidating both input and output resources under a single
spec.resourcesblock
Files Processed
This codemod processes:
**/*.ymlfiles**/*.yamlfiles
Migration Details
The transformations align with Tekton's v1beta1 API changes:
-
Parameter Flattening: Parameters are moved from the nested
inputs.paramsstructure to a flatparamsarray at the spec level. -
Resource Consolidation: Input and output resources are consolidated under a single
resourcesobject with separateinputsandoutputsarrays. -
Structure Cleanup: Removes the now-obsolete
inputsandoutputstop-level sections when they only contained params or resources.
Development
bash
Important Notes
- This codemod handles the structural changes from v1alpha1 to v1beta1
- Always review the transformed files before committing changes
- Test your pipelines after migration to ensure they work as expected
License
MIT