netmap: Allow empty values for unknown parameters in network config #235

Merged
fyrchik merged 1 commit from achuprov/frostfs-sdk-go:feat/unknown_network_info_parameters into master 2024-07-10 06:10:58 +00:00

View file

@ -49,11 +49,6 @@ func (x *NetworkInfo) readFromV2(m netmap.NetworkInfo, checkFieldPresence bool)
mNames[name] = struct{}{}
switch name {
default:
if len(prm.GetValue()) == 0 {
aarifullin marked this conversation as resolved
Review

We are fixing the issue with MaxECDataCount but allows to other params be empty when they must be non-empty

Didn't you consider the solution that @dkirillov suggested?

and explicitly check which must not contain nil value.

We are fixing the issue with `MaxECDataCount` but allows to other params be empty when they must be non-empty Didn't you consider the solution that @dkirillov suggested? > and explicitly check which must not contain nil value.
Review

I assume that unknown parameters can be anything, known ones must not be nil. @dkirillov @aarifullin, did you mean a configuration of non-nil params from the application?

I assume that unknown parameters can be anything, known ones must not be nil. @dkirillov @aarifullin, did you mean a configuration of non-nil params from the application?
Review

If now there are not parameters (which isn't mentioned here) that must not be nil then solution is ok.
Currently devenv sets SystemDNS config parameter. Is this parameter one that must not be empty? Is so then we need handle this param. Maybe there are some other parameters that require special treatment.

The #232 is more about allow clients don't update SDK when we add new nil parameter. The solution that I suggested just one of many.

If now there are not parameters (which isn't mentioned here) that must not be nil then solution is ok. Currently devenv sets `SystemDNS` config parameter. Is this parameter one that **must** not be empty? Is so then we need handle this param. Maybe there are some other parameters that require special treatment. The #232 is more about allow clients don't update SDK when we add new nil parameter. The solution that I suggested just one of many.
Review

Is this parameter one that must not be empty?

Good question. To be honest - I don't know.
For now, I suppose, to keep backward compatibility it's simpler and more correct to ignore values (like in this PR) than to emplace a new parameter name to one of this switch's cases adding some handler.
OK. I am going to resolve this conv

> Is this parameter one that must not be empty? Good question. To be honest - I don't know. For now, I suppose, to keep backward compatibility it's simpler and more correct to ignore values (like in this PR) than to emplace a new parameter name to one of this switch's cases adding some handler. OK. I am going to resolve this conv
err = fmt.Errorf("empty attribute value %s", name)
return true
}
case
configAuditFee,
configStoragePrice,