Skip to content

Commit

Permalink
avoid nil pointer (#4704)
Browse files Browse the repository at this point in the history
  • Loading branch information
nnnkkk7 authored Dec 5, 2023
1 parent 8b87192 commit 45eee6b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pkg/app/piped/platformprovider/lambda/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ func (c *client) CreateFunction(ctx context.Context, fm FunctionManifest) error
input.Architectures = architectures
}
if fm.Spec.EphemeralStorage != nil {
input.EphemeralStorage.Size = aws.Int32(fm.Spec.EphemeralStorage.Size)
input.EphemeralStorage = &types.EphemeralStorage{
Size: aws.Int32(fm.Spec.EphemeralStorage.Size),
}
}
if fm.Spec.VPCConfig != nil {
input.VpcConfig = &types.VpcConfig{
Expand Down Expand Up @@ -183,7 +185,9 @@ func (c *client) CreateFunctionFromSource(ctx context.Context, fm FunctionManife
},
}
if fm.Spec.EphemeralStorage != nil {
input.EphemeralStorage.Size = aws.Int32(fm.Spec.EphemeralStorage.Size)
input.EphemeralStorage = &types.EphemeralStorage{
Size: aws.Int32(fm.Spec.EphemeralStorage.Size),
}
}
_, err = c.client.CreateFunction(ctx, input)
if err != nil {
Expand Down Expand Up @@ -284,7 +288,9 @@ func (c *client) updateFunctionConfiguration(ctx context.Context, fm FunctionMan
configInput.Handler = aws.String(fm.Spec.Handler)
}
if fm.Spec.EphemeralStorage != nil {
configInput.EphemeralStorage.Size = aws.Int32(fm.Spec.EphemeralStorage.Size)
configInput.EphemeralStorage = &types.EphemeralStorage{
Size: aws.Int32(fm.Spec.EphemeralStorage.Size),
}
}
if fm.Spec.VPCConfig != nil {
configInput.VpcConfig = &types.VpcConfig{
Expand Down

0 comments on commit 45eee6b

Please sign in to comment.