8000 chk/controller: nil-check Get result in poll loop by SAY-5 · Pull Request #1977 · Altinity/clickhouse-operator · GitHub
[go: up one dir, main page]

Skip to content
8000
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pkg/controller/chk/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@ func (c *Controller) poll(ctx context.Context, cr api.ICustomResource, f func(c

for {
cur, err := c.kube.CR().Get(ctx, namespace, name)
if f(cur.(*apiChk.ClickHouseKeeperInstallation), err) {
var typed *apiChk.ClickHouseKeeperInstallation
if cur != nil {
typed, _ = cur.(*apiChk.ClickHouseKeeperInstallation)
}
if f(typed, err) {
// Continue polling
if util.IsContextDone(ctx) {
log.V(1).Info("Poll is aborted. Cr: %s ", cr.GetName())
Expand Down
0