mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-05 07:45:27 -04:00
Add constellation UID retrieval to cloudprovider metadata APIs
Signed-off-by: Malte Poll <mp@edgeless.systems>
This commit is contained in:
parent
2f925b5955
commit
18a89d2881
7 changed files with 116 additions and 6 deletions
|
@ -11,6 +11,8 @@ import (
|
|||
|
||||
// ProviderMetadata implementers read/write cloud provider metadata.
|
||||
type ProviderMetadata interface {
|
||||
// UID returns the unique identifier for the constellation.
|
||||
UID(ctx context.Context) (string, error)
|
||||
// List retrieves all instances belonging to the current Constellation.
|
||||
List(ctx context.Context) ([]metadata.InstanceMetadata, error)
|
||||
// Self retrieves the current instance.
|
||||
|
@ -100,6 +102,9 @@ type stubProviderMetadata struct {
|
|||
|
||||
SupportedResp bool
|
||||
SupportsLoadBalancerResp bool
|
||||
|
||||
UIDErr error
|
||||
UIDResp string
|
||||
}
|
||||
|
||||
func (m *stubProviderMetadata) GetLoadBalancerIP(ctx context.Context) (string, error) {
|
||||
|
@ -130,6 +135,10 @@ func (m *stubProviderMetadata) SupportsLoadBalancer() bool {
|
|||
return m.SupportsLoadBalancerResp
|
||||
}
|
||||
|
||||
func (m *stubProviderMetadata) UID(ctx context.Context) (string, error) {
|
||||
return m.UIDResp, m.UIDErr
|
||||
}
|
||||
|
||||
type stubCloudControllerManager struct {
|
||||
SupportedResp bool
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue