if meta.Nullable && value == "null" {
// Nullable types may be explicitly set to null
upsert[key] = nil
} else if meta.Type != "string" && (value == "") {
// Non-string types that receive an empty string
// are reset to default
remove = append(remove, key)
} else if meta.Type == "array" {
var a anySlice
err = yaml.Unmarshal([]byte(value), &a)
out.MaybeDie(err, "invalid list syntax")
upsert[key] = a
} else {
upsert[key] = value
}
This mean that if any property of type string which has different default value then "" (empty string) can not be unset.
The
rpk cluster config setat the moment of writing has the following logic:https://github.com/redpanda-data/redpanda/blob/c3cca097b01c250715fd4012bac175f09c26778e/src/go/rpk/pkg/cli/cmd/cluster/config/set.go#L85-L99
This mean that if any property of type string which has different default value then
""(empty string) can not be unset.I didn't test it, but it might be worth checking the
rpk cluster config importhttps://github.com/redpanda-data/redpanda/blob/c3cca097b01c250715fd4012bac175f09c26778e/src/go/rpk/pkg/cli/cmd/cluster/config/import.go#L98-L223
Related issue redpanda-data/helm-charts#395