Skip to content

Commit 7a1e912

Browse files
committed
fix(lifecycle): invalid memory address or nil pointer dereference
1 parent d596542 commit 7a1e912

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.25
55
require (
66
github.com/chai2010/gettext-go v1.0.3
77
github.com/containerd/console v1.0.4
8-
github.com/drycc/controller-sdk-go v0.0.0-20251206164108-e9369b636dd8
8+
github.com/drycc/controller-sdk-go v0.0.0-20251211045545-b196e6964a1c
99
github.com/drycc/pkg v0.0.0-20250917064731-345368da3dbf
1010
github.com/minio/selfupdate v0.6.0
1111
github.com/olekukonko/tablewriter v0.0.5

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6N
99
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
1010
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
1111
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
12-
github.com/drycc/controller-sdk-go v0.0.0-20251206164108-e9369b636dd8 h1:EgzCbOPGeDmeClpCjPPwuCJ8viMWEMn7FiUyY1mJvoM=
13-
github.com/drycc/controller-sdk-go v0.0.0-20251206164108-e9369b636dd8/go.mod h1:eHcmYwg81ASlP55/U587xnBZnZoeZnPHXGeQ8nYWnsg=
12+
github.com/drycc/controller-sdk-go v0.0.0-20251211045545-b196e6964a1c h1:v7dQdercvt0o+/dOeCpQSEYedvo2lTY8eCwHBxx48hg=
13+
github.com/drycc/controller-sdk-go v0.0.0-20251211045545-b196e6964a1c/go.mod h1:eHcmYwg81ASlP55/U587xnBZnZoeZnPHXGeQ8nYWnsg=
1414
github.com/drycc/pkg v0.0.0-20250917064731-345368da3dbf h1:CYy3NoPhfFhkGAbEppTOQfY/HC2s0FJDcBgbtRKeweg=
1515
github.com/drycc/pkg v0.0.0-20250917064731-345368da3dbf/go.mod h1:BrrNrNskHKm+nJYhXfGuI114w8nupi0AMo8QZHID7CM=
1616
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=

internal/commands/lifecycles.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,15 @@ func (d *DryccCmd) LifecyclesList(appID, ptype string, version int) error {
6363
table.Append([]string{"Lifecycle:"})
6464
for _, ptype := range sortPtypes(ptypes) {
6565
if lifecycle, ok := config.Lifecycle[ptype]; ok {
66-
table.Append([]string{"", fmt.Sprintf("stopSignal=%s", lifecycle.StopSignal)})
67-
table.Append([]string{"", getLifecycleHandlerString(ptype, "postStart", lifecycle.StopSignal, *lifecycle.PostStart)})
68-
table.Append([]string{"", getLifecycleHandlerString(ptype, "preStop", lifecycle.StopSignal, *lifecycle.PreStop)})
66+
if lifecycle.StopSignal != "" {
67+
table.Append([]string{"", fmt.Sprintf("stopSignal=%s", lifecycle.StopSignal)})
68+
}
69+
if lifecycle.PostStart != nil {
70+
table.Append([]string{"", getLifecycleHandlerString(ptype, "postStart", lifecycle.StopSignal, *lifecycle.PostStart)})
71+
}
72+
if lifecycle.PreStop != nil {
73+
table.Append([]string{"", getLifecycleHandlerString(ptype, "preStop", lifecycle.StopSignal, *lifecycle.PreStop)})
74+
}
6975
}
7076
}
7177
table.Render()

0 commit comments

Comments
 (0)