Skip to content

kinder: add native workflow groups and an extended test suite - #3334

Open
HirazawaUi wants to merge 1 commit into
kubernetes:mainfrom
HirazawaUi:kinder-native-workflow-groups
Open

HirazawaUi wants to merge 1 commit into
kubernetes:mainfrom
HirazawaUi:kinder-native-workflow-groups

Conversation

@HirazawaUi

@HirazawaUi HirazawaUi commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Related to #3331.

Add native workflow groups so a shared Kinder entry point can run independent scenarios while preserving their individual execution state and results.

Child workflows execute sequentially in the same process, with isolated variables, artifacts, and JUnit reports. Failed or timed-out scenarios allow subsequent scenarios to run; cancellation stops new scenarios while preserving forced cleanup and reporting. Existing task workflows and imports remain supported.

This change also adds recursive configuration validation, cycle detection, scenario deadlines, and an extended-latest suite combining an etcd rollback regression scenario with the existing missing addon ConfigMap scenario.

AI Usage Disclosure: I came up with the idea, and gpt-6 completed the code implementation.

@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: HirazawaUi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow
kubernetes-prow Bot requested review from SataQiu and carlory October 26, 2026 15:29
@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. area/kinder Issues to track work in the kinder tool approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Oct 26, 2026
@HirazawaUi

Copy link
Copy Markdown
Contributor Author

/assign @neolit123

@neolit123 neolit123 left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i did a first pass. we should have likely had more discussion on the ticket before the PR. main point is about these nested / extended workflows. do we really want these?

i am all about adding an etcd recovery test, but we have to keep in mind that if we add a new FG that stops doing the auto recovery this test must change. i.e. the same way the user would have to manually recover etcd from an original etcd snapshot.

i did not spent a lot of time on the context/cancelation/timeout improvements. i don't understand them quite well, but generally adding such improvements and unit tests around workflows are fine, as long as we understand the logic properly as humans...

Comment on lines +7 to +13
workflows:
- name: upgrade-etcd-rollback
workflow: upgrade-etcd-rollback-{{ .KubernetesVersion }}.yaml
timeout: 70m
- name: upgrade-no-addon-config-maps
workflow: upgrade-no-addon-config-maps-{{ .KubernetesVersion }}.yaml
timeout: 70m

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

do we really want to nest workflows within workflows? the mapping of one prow job -> one kinder workflow has been flexible enough for us. sure it can be annoying to have to update these in 2 repositories, but we have a generator for that purpose.

TBH, i am not so sure about this. additionally it introduces running upgrade-no-addon-config-maps in a second location, which duplicates testing the same aspect.

could we simply introduce the dedicated upgrade-etcd-rollback workflow + its tasks?

Comment on lines +72 to +76
# Kubeadm installs this patch after backup. Kubelet terminates the original
# static Pod before starting its replacement, so the init container owns the
# data directory exclusively. Preserve all DB/WAL bytes rather than truncating
# a database file; the regular file at "member" makes old etcd require restore.
cat > "${state}/patches/etcd+strategic.yaml" <<'PATCH'

@neolit123 neolit123 Oct 26, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

could we avoid an init container and static pod patches?
i was wondering if we could just corrupt the member date before uptrade from a task (not from an init container) and just execute kubeadm upgrade from the built-in kinder subcommand?

i am trying to avoid complicated bash in kinder, although we do have a few tasks with complicated bash already...

if we have to do some complicated state, maybe we could do it from kinder's go code...

Comment on lines +213 to +234
- name: collect-rollback-diagnostics
cmd: docker
args:
- exec
- '{{ .vars.clusterName }}-control-plane-1'
- bash
- -ceu
- |
mkdir -p /kinder/rollback
find /var/lib/etcd -maxdepth 6 -type f -printf '%p %s bytes\n' > /kinder/rollback/data-files.txt
find /var/lib/etcd -maxdepth 1 -printf '%f %y\n' > /kinder/rollback/data-entries.txt
crictl ps -a > /kinder/rollback/containers.txt
force: true
ignoreError: true
- name: export-rollback-diagnostics
cmd: docker
args:
- cp
- '{{ .vars.clusterName }}-control-plane-1:/kinder/rollback'
- '{{ .env.ARTIFACTS }}/etcd-rollback'
force: true
ignoreError: true

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i am not so sure why these are two separate tasks. also do we really care about diagonostics?
if the rollback passed maybe we can just end the workflow.

@@ -0,0 +1,551 @@
/*

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

there is a lot in this file.
let's discuss first if we want to support these nested workflows.

i am generally +1 to have more unit tests related to workflows, but i would prefer if they are in workflow_test.go.

Comment on lines +32 to +34
// Run executes a workflow or scenario group. One cancellation context covers the
// entire tree, including the intervals between commands and child workflows.
func (w *Workflow) Run(out io.Writer, dryRun, verbose, exitOnError bool, artifacts string) error {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i think all this can go in workflow.go. the file is not that big and all methods should ideally live where the struct definition is (unless the file is huge, which it isn't).

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kinder Issues to track work in the kinder tool cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants