You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Copy file name to clipboardExpand all lines: toc/rfc/rfc-0045-enhance-stack-handling.md
+3-5Lines changed: 3 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -127,20 +127,18 @@ The `state` of the stack will directly influence the behavior of the CF API:
127
127
- If the state is `RESTRICTED`, staging a *new* application will fail with an error.
128
128
- If the state is `DISABLED`, staging or restaging *any* application will fail with an error.
129
129
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.
131
131
132
132
For example, a deprecation warning could look like this:
133
133
134
134
```
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>."
137
136
```
138
137
139
138
And an error message for a disabled stack:
140
139
141
140
```
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>."
144
142
```
145
143
146
144
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