Skip to content

Commit 02ae694

Browse files
authored
Enhance stack handling with state_reason field (#1420)
Leverage an additional 'state_reason' field for better communication in warning and error messages related to stack states. Found out its needed in implementation see cloudfoundry/cloud_controller_ng#4712
1 parent c0f5565 commit 02ae694

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

toc/rfc/rfc-0045-enhance-stack-handling.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,20 +127,18 @@ The `state` of the stack will directly influence the behavior of the CF API:
127127
- If the state is `RESTRICTED`, staging a *new* application will fail with an error.
128128
- If the state is `DISABLED`, staging or restaging *any* application will fail with an error.
129129

130-
To improve communication with developers, the existing `description` field of a stack will be leveraged. The content of the `description` field should be included in any warning or error message related to the stack's state. This allows operators to provide context, migration guides, or links to further documentation.
130+
To improve communication with developers, an additional field e.g `state_reason` of a stack object should be leveraged. The content of the `state_reason` field should be included in any warning or error message related to the stack's state. This allows operators to provide context, migration guides, or links to further documentation.
131131

132132
For example, a deprecation warning could look like this:
133133

134134
```
135-
WARNING: The stack 'cflinuxfs3' is DEPRECATED and will be removed in the future.
136-
Description: This stack is based on Ubuntu 18.04, which is no longer supported. Please migrate your applications to 'cflinuxfs4'. For more information, see: <link-to-docs>.
135+
WARNING: The stack 'cflinuxfs3' is DEPRECATED and will be removed in the future: "This stack is based on Ubuntu 18.04, which is no longer supported. Please migrate your applications to 'cflinuxfs4'. For more information, see: <link-to-docs>."
137136
```
138137

139138
And an error message for a disabled stack:
140139

141140
```
142-
ERROR: Staging failed. The stack 'cflinuxfs3' is DISABLED and can no longer be used for staging.
143-
Description: This stack is based on Ubuntu 18.04, which is no longer supported. Please migrate your applications to 'cflinuxfs4'. For more information, see: <link-to-docs>.
141+
ERROR: Staging failed. The stack 'cflinuxfs3' is DISABLED and can no longer be used for staging:"This stack is based on Ubuntu 18.04, which is no longer supported. Please migrate your applications to 'cflinuxfs4'. For more information, see: <link-to-docs>."
144142
```
145143

146144
This approach provides a clear and explicit way for operators to manage the lifecycle of stacks and communicate changes to users effectively.

0 commit comments

Comments
 (0)