Bbrunocroh

tekton-alpha-to-beta

Migrating From Tekton v1alpha1 to Tekton v1beta1

transformationmigration
Public
0 downloads
2 stars
How to Use
Run this codemod on your codebase using one of the following commands

The easiest way to run this codemod without installing anything globally:

Documentation

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.resourcesspec.resources.inputs
  • Moving spec.outputs.resourcesspec.resources.outputs
  • Consolidating both input and output resources under a single spec.resources block

Files Processed

This codemod processes:

  • **/*.yml files
  • **/*.yaml files

Migration Details

The transformations align with Tekton's v1beta1 API changes:

  1. Parameter Flattening: Parameters are moved from the nested inputs.params structure to a flat params array at the spec level.

  2. Resource Consolidation: Input and output resources are consolidated under a single resources object with separate inputs and outputs arrays.

  3. Structure Cleanup: Removes the now-obsolete inputs and outputs top-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

Ready to contribute?

Build your own codemod and share it with the community.