-
Notifications
You must be signed in to change notification settings - Fork 23
fix(resource/pipeline): fix permit_restart_from_failed_steps = false
#160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
/test |
`permit_restart_from_failed_steps` property of pipeline spec behaves differently when omit vs set to `false`. This means we should not omit `false` value while sending requests to API. Fixes #CR-26963
9ac80ec
to
2adecb7
Compare
/test |
permit_restart_from_failed_steps
to JSONpermit_restart_from_failed_steps = false
/test |
/test |
codefresh/resource_pipeline.go
Outdated
}, | ||
} | ||
|
||
hasPermitRestartChanged := d.HasChange("spec.0.permit_restart_from_failed_steps") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@masontikhonov HasChange functions are normally used in custom diff functions. We should instead just check if permit_restart_from_failed_steps_use_account_settings
is set to true and in such case set the property to nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
/test |
What
This fixes
permit_restart_from_failed_steps
behavior inpipeline
resource.Before this fix, setting
permit_restart_from_failed_steps = false
or omitting this key resulted in “Permit restart from failed step: Use account settings” for both cases.New syntax/behavior is:
permit_restart_from_failed_steps = [true|false]
with the default valuetrue
(“Permit”).If
false
, the policy is set to “Forbid”.New flag is added:
permit_restart_from_failed_steps_use_account_settings = [false|true]
with the default valuefalse
(“do not use account settings”).If
true
,permit_restart_from_failed_steps
will be ignored and pipeline policy will be set to “Use account settings”.Warning
BREAKING CHANGES!
permit_restart_from_failed_steps = false
resulted in “Permit restart from failed step: Use account settings”.From now on, setting
permit_restart_from_failed_steps = false
will result in “Permit restart from failed step: Forbid”Fixes #CR-26963
Notes
Checklist
/test
comment will be ignored by the CI trigger unless it is made by a repo admin or collaborator.