feat: improve StatefulSet immutable field error messages#21209
feat: improve StatefulSet immutable field error messages#21209pasha-codefresh merged 5 commits intoargoproj:masterfrom
Conversation
❌ Preview Environment deleted from BunnyshellAvailable commands (reply to this comment):
|
|
How to test locally
this should change the above added
|
c282940 to
009e46b
Compare
| } | ||
|
|
||
| // Format immutable fields error message | ||
| if (cleanMessage.includes('attempting to change immutable fields:')) { |
There was a problem hiding this comment.
maybe it will be better to move this part to some formatter util that will cover such cases and use it here? i am sure we probably will want cover other formatting cases in future
009e46b to
e2d8e21
Compare
223a774 to
d79065f
Compare
493abda to
fcda7ab
Compare
3e13b40 to
9ce0f82
Compare
|
@pasha-codefresh any more concerns regarding the changes? |
|
PING @pasha-codefresh |
c0fc4a6 to
d2c3234
Compare
46abb0c to
642897c
Compare
|
Will review it one more time today |
642897c to
3273a8e
Compare
| return message; | ||
| } | ||
|
|
||
| const cleanMessage = message; |
There was a problem hiding this comment.
why you need this? you not doing any modification of message
| .filter(line => line.trim()) | ||
| .map(line => { | ||
| if (line.startsWith('-')) { | ||
| const [field, changes] = line.substring(2).split(':'); |
There was a problem hiding this comment.
can you please add some comment that explains why 2 and why split, i think you need move it to private function that will be named formatStatefulSet ( something like this ). And it will be covered at least with some comment to show what all these splits doing.
|
@aali309 few minor comments and we are good to go |
3273a8e to
c867313
Compare
Signed-off-by: Atif Ali <atali@redhat.com>
Signed-off-by: Atif Ali <atali@redhat.com>
Signed-off-by: Atif Ali <atali@redhat.com>
…on && add comments Signed-off-by: Atif Ali <atali@redhat.com>
74d8bd9 to
dbf0f84
Compare

Checklist:
Fixes: #20899
Depends on: 654
Before:

After:
