func New()

in pkg/controller/state/state.go [70:84]


func New(ctx context.Context, configmap configmap.Interface) Interface {
	mapping := make(map[types.Id]Entry)

	config, err := configmap.Get(ctx, configMapNamespace, configMapName)
	if err != nil {
		klog.Warning(err)
	} else if len(config.Data) > 0 {
		mapping = unmarshal(config.Data)
	}

	return &impl{
		mapping:   mapping,
		configmap: configmap,
	}
}