2022-04-26 15:01:40 +00:00
|
|
|
package container
|
|
|
|
|
|
|
|
import (
|
2023-03-07 11:20:03 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap"
|
2022-04-26 15:01:40 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// ApplyNetworkConfig applies network configuration to the
|
|
|
|
// container. Changes the container if it does not satisfy
|
|
|
|
// network configuration.
|
|
|
|
func ApplyNetworkConfig(cnr *Container, cfg netmap.NetworkInfo) {
|
|
|
|
if cfg.HomomorphicHashingDisabled() {
|
|
|
|
DisableHomomorphicHashing(cnr)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// AssertNetworkConfig checks if a container matches passed
|
|
|
|
// network configuration.
|
|
|
|
func AssertNetworkConfig(cnr Container, cfg netmap.NetworkInfo) bool {
|
|
|
|
return IsHomomorphicHashingDisabled(cnr) == cfg.HomomorphicHashingDisabled()
|
|
|
|
}
|