diff --git a/src/go/rpk/pkg/cli/cmd/redpanda/admin/brokers/brokers.go b/src/go/rpk/pkg/cli/cmd/redpanda/admin/brokers/brokers.go index a5a3bd62a501..78e74b555d98 100644 --- a/src/go/rpk/pkg/cli/cmd/redpanda/admin/brokers/brokers.go +++ b/src/go/rpk/pkg/cli/cmd/redpanda/admin/brokers/brokers.go @@ -108,7 +108,9 @@ leader handles the request. b, err := cl.Broker(cmd.Context(), broker) out.MaybeDie(err, "unable to initialize admin client: %v", err) - if b.Maintenance.Draining { + // Old brokers (< v22.1) don't have maintenance mode, so we must + // check if b.Maintenance is not nil. + if b.Maintenance != nil && b.Maintenance.Draining { out.Die(`Node cannot be decommissioned while it is in maintenance mode. Take the node out of maintenance mode first by running: rpk cluster maintenance disable %v`, broker)