From 62b33c5d84ec1b041fc9cdfa6d380673229761cd Mon Sep 17 00:00:00 2001 From: Fabian Fulga Date: Thu, 11 Apr 2024 22:09:06 +0300 Subject: [PATCH] Initialize default ExtraSpecs as an empty JSON object --- execution/execution.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/execution/execution.go b/execution/execution.go index 4d47a1f..948fe3a 100644 --- a/execution/execution.go +++ b/execution/execution.go @@ -77,6 +77,10 @@ func GetEnvironment() (Environment, error) { if err := json.Unmarshal(data.Bytes(), &bootstrapParams); err != nil { return Environment{}, fmt.Errorf("failed to decode instance params: %w", err) } + if bootstrapParams.ExtraSpecs == nil { + // Initialize ExtraSpecs as an empty JSON object + bootstrapParams.ExtraSpecs = json.RawMessage([]byte("{}")) + } env.BootstrapParams = bootstrapParams }