mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-02 06:16:08 -04:00
[node operator] ScalingGroupController env test
Signed-off-by: Malte Poll <mp@edgeless.systems>
This commit is contained in:
parent
8bc1db609f
commit
d62ae3add3
3 changed files with 158 additions and 0 deletions
|
@ -0,0 +1,30 @@
|
|||
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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue