Skip to content

feat: add parameter cleanup-state to Tekton tasks#677

Merged
ppitonak merged 1 commit into
redhat-developer:mainfrom
ppitonak:cleanup_state_tkn
Dec 4, 2025
Merged

feat: add parameter cleanup-state to Tekton tasks#677
ppitonak merged 1 commit into
redhat-developer:mainfrom
ppitonak:cleanup_state_tkn

Conversation

@ppitonak
Copy link
Copy Markdown
Collaborator

@ppitonak ppitonak commented Dec 3, 2025

  • add parameter to tasks
  • fix parsing or argument (--cleanup-state=false was ignored)

@ppitonak ppitonak requested a review from adrianriobo December 3, 2025 16:32
@ppitonak
Copy link
Copy Markdown
Collaborator Author

ppitonak commented Dec 3, 2025

Additionally, even default value is ignored when no parameter is provided in shell :( All issues should be solved by this PR.

Comment thread cmd/mapt/cmd/aws/hosts/fedora.go Outdated
Serverless: viper.IsSet(params.Serverless),
ForceDestroy: viper.IsSet(params.ForceDestroy),
CleanupState: viper.IsSet(params.CleanupState),
CleanupState: viper.GetBool(params.CleanupState),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

WHy did you change from IsSet to GetBool?

Copy link
Copy Markdown
Collaborator Author

@ppitonak ppitonak Dec 4, 2025

Choose a reason for hiding this comment

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

For reasons explained in description of this PR. IsSet works fine when default value is false (which is all cases in mapt except of cleanup-state). However, when the default value is true:

  • if you don't set the param, users expect state to be cleaned up because default value is true, in fact IsSet returns false (correctly) so nothing happens
  • if you set parameter --cleanup-state=false, IsSet returns true which is correct but not expected
  • if you set paramter --cleanup-state or --cleanup-state=true, it works as expected

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ohh...I did not realize that... I mean...this should not be controlled like that...but changing the description of the flag....

I mean instead of --clean-state (default true...) so there is no way to say false only setting not setting it...we should rename to --keep-state ??

WDYT? so --keep-state default is false...so it will delete it...and if anyone wanna keep it...should add the param??

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Sure, that would be even easier to use. I'll revert the logic.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

thanks!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Updated but not tested yet

* parameter cleanup-state refactored into keep-state
* added to Tekton tasks

Signed-off-by: Pavol Pitonak <ppitonak@redhat.com>
Copy link
Copy Markdown
Collaborator

@adrianriobo adrianriobo left a comment

Choose a reason for hiding this comment

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

LGTM leave up to you for rebase and merge once you test it / decide

@ppitonak ppitonak merged commit 3728222 into redhat-developer:main Dec 4, 2025
7 checks passed
@ppitonak ppitonak deleted the cleanup_state_tkn branch December 4, 2025 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants