pluralsh / deployment-operator

thin kubernetes agent to execute deployments of plural services
1 stars 1 forks source link

fix(harness): retry CompleteStackRun with less data on entity too large #242

Closed floreks closed 1 month ago

floreks commented 2 months ago

My local test code

    err := plural.Stacks.WithClient(client).Complete("0190bad3-f81c-4629-a1a9-ea7d683c7187", &console.StackRunAttributes{
        Status: console.StackStatusSuccessful,
        State: &console.StackStateAttributes{
            Plan:  lo.ToPtr(generator.Strings.Random(30_000_000)),
            State: generator.Stacks.State(20_000),
        },
    })
    if err != nil {
        log.Fatal(err)
    }

Output

2024/07/19 14:44:59 got error, running modifier: {"networkErrors":{"code":413,"message":"Response body \"Request Entity Too Large\""},"graphqlErrors":null}
2024/07/19 14:44:59 dropping state
2024/07/19 14:45:01 got error, running modifier: {"networkErrors":{"code":413,"message":"Response body \"Request Entity Too Large\""},"graphqlErrors":null}
2024/07/19 14:45:01 dropping plan
Completed stack run
linear[bot] commented 2 months ago

PROD-2439 Retry w/ no terraform state if a 413 error code is returned by the server