mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-12-26 16:09:45 -05:00
d62ae3add3
Signed-off-by: Malte Poll <mp@edgeless.systems>
31 lines
697 B
Go
31 lines
697 B
Go
package controllers
|
|
|
|
import (
|
|
"context"
|
|
"sync"
|
|
)
|
|
|
|
type fakeScalingGroupUpdater struct {
|
|
sync.RWMutex
|
|
scalingGroupImage map[string]string
|
|
}
|
|
|
|
func newFakeScalingGroupUpdater() *fakeScalingGroupUpdater {
|
|
return &fakeScalingGroupUpdater{
|
|
scalingGroupImage: make(map[string]string),
|
|
}
|
|
}
|
|
|
|
func (u *fakeScalingGroupUpdater) GetScalingGroupImage(ctx context.Context, scalingGroupID string) (string, error) {
|
|
u.RLock()
|
|
defer u.RUnlock()
|
|
return u.scalingGroupImage[scalingGroupID], nil
|
|
}
|
|
|
|
func (u *fakeScalingGroupUpdater) SetScalingGroupImage(ctx context.Context, scalingGroupID, imageURI string) error {
|
|
u.Lock()
|
|
defer u.Unlock()
|
|
u.scalingGroupImage[scalingGroupID] = imageURI
|
|
return nil
|
|
}
|