ktsstudio / mirrors

Kubernetes Secret Mirroring Controller
Apache License 2.0
83 stars 6 forks source link

Fix nil dereference in case when any labels added to previously unlabeled secret #4

Closed inish777 closed 1 year ago

inish777 commented 1 year ago
panic: assignment to entry in nil map

goroutine 342 [running]:
github.com/ktsstudio/mirrors/pkg/backend.copySecret(...)
    /workspace/pkg/backend/helpers.go:45
github.com/ktsstudio/mirrors/pkg/backend.(*NamespacesDest).syncOneToNamespace(0xc0005f86c0, {0x1898328, 0xc000478fc0}, 0xc002fbe8c0, {{0xc000122cc0?, 0xc00005df38?}, {0xc00049acc0?, 0xc000584be8?}})
    /workspace/pkg/backend/dest_namespaces.go:129 +0x465
github.com/ktsstudio/mirrors/pkg/backend.(*NamespacesDest).Sync.func1.1()
    /workspace/pkg/backend/dest_namespaces.go:50 +0x88
golang.org/x/sync/errgroup.(*Group).Go.func1()
    /go/pkg/mod/golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57 +0x67
created by golang.org/x/sync/errgroup.(*Group).Go
    /go/pkg/mod/golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:54 +0x8d