This PR adds an additional confirmation step to hibernation and unhibernation operations to prevent accidental actions on applications and environments. Users are now required to type the application name or environment name to confirm the hibernation operation.
Changes Made
API Model Updates
- Added optional
confirmationName field toHibernateRequest model for single application operations - Added optional
confirmationName field toBulkApplicationForEnvironmentPayload model for bulk operations - Both fields include proper JSON marshaling/unmarshaling support
Single Application Validation
Enhanced hibernation handlers to validate confirmation names against actual application names:
- Helm Applications: Validates against the release name (
appIdentifier.ReleaseName) - Argo Applications: Validates against the application name (
appIdentifier.AppName) - Flux Applications: Validates against the application name (
appIdentifier.AppName)
Bulk Operation Validation
Added environment name validation for bulk hibernation operations:
- Validates
confirmationName against the environment name - Resolves environment name from
envName field or fetches it usingenvId - Applied to both
BulkHibernate andBulkUnHibernate operations
API Behavior
// Single app hibernation with confirmationPOST /orchestrator/api/v1/applications/hibernate?appType=1{"appId":"1|default|nginx-app","confirmationName":"nginx-app"}// Bulk hibernation with confirmationPOST /orchestrator/bulk/v1beta1/hibernate{"envId":1,"envName":"production","confirmationName":"production"}Response Codes:
200 OK: Operation successful (with or without confirmation)400 Bad Request: Confirmation name mismatch with clear error message
Backward Compatibility
TheconfirmationName field is optional, ensuring existing clients continue to work without any changes. This allows for gradual migration where frontend teams can implement confirmation dialogs at their own pace.
Error Handling
When confirmation validation fails, the API returns descriptive error messages:
- Single apps:
"confirmation name does not match application name" - Bulk operations:
"confirmation name does not match environment name"
This feature addresses user confusion between environments and provides an additional safety layer for critical hibernation operations while maintaining full backward compatibility.
Fixes#6632.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Clickhere to start the survey.
Uh oh!
There was an error while loading.Please reload this page.
This PR adds an additional confirmation step to hibernation and unhibernation operations to prevent accidental actions on applications and environments. Users are now required to type the application name or environment name to confirm the hibernation operation.
Changes Made
API Model Updates
confirmationNamefield toHibernateRequestmodel for single application operationsconfirmationNamefield toBulkApplicationForEnvironmentPayloadmodel for bulk operationsSingle Application Validation
Enhanced hibernation handlers to validate confirmation names against actual application names:
appIdentifier.ReleaseName)appIdentifier.AppName)appIdentifier.AppName)Bulk Operation Validation
Added environment name validation for bulk hibernation operations:
confirmationNameagainst the environment nameenvNamefield or fetches it usingenvIdBulkHibernateandBulkUnHibernateoperationsAPI Behavior
Response Codes:
200 OK: Operation successful (with or without confirmation)400 Bad Request: Confirmation name mismatch with clear error messageBackward Compatibility
The
confirmationNamefield is optional, ensuring existing clients continue to work without any changes. This allows for gradual migration where frontend teams can implement confirmation dialogs at their own pace.Error Handling
When confirmation validation fails, the API returns descriptive error messages:
"confirmation name does not match application name""confirmation name does not match environment name"This feature addresses user confusion between environments and provides an additional safety layer for critical hibernation operations while maintaining full backward compatibility.
Fixes#6632.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Clickhere to start the survey.