feat(api): Added AppKey to ShowAppInstances
This commit is contained in:
parent
a51e2ae454
commit
ece2955a2a
10 changed files with 19 additions and 15 deletions
|
|
@ -14,7 +14,7 @@ import (
|
|||
// EdgeConnectClientInterface defines the methods needed for deletion planning
|
||||
type EdgeConnectClientInterface interface {
|
||||
ShowApp(ctx context.Context, appKey edgeconnect.AppKey, region string) (edgeconnect.App, error)
|
||||
ShowAppInstances(ctx context.Context, instanceKey edgeconnect.AppInstanceKey, region string) ([]edgeconnect.AppInstance, error)
|
||||
ShowAppInstances(ctx context.Context, instanceKey edgeconnect.AppInstanceKey, appKey edgeconnect.AppKey, region string) ([]edgeconnect.AppInstance, error)
|
||||
DeleteApp(ctx context.Context, appKey edgeconnect.AppKey, region string) error
|
||||
DeleteAppInstance(ctx context.Context, instanceKey edgeconnect.AppInstanceKey, region string) error
|
||||
}
|
||||
|
|
@ -154,8 +154,9 @@ func (p *EdgeConnectPlanner) findInstancesToDelete(ctx context.Context, config *
|
|||
Name: infra.CloudletName,
|
||||
},
|
||||
}
|
||||
appKey := edgeconnect.AppKey{Name: config.Metadata.Name}
|
||||
|
||||
instances, err := p.client.ShowAppInstances(ctx, instanceKey, infra.Region)
|
||||
instances, err := p.client.ShowAppInstances(ctx, instanceKey, appKey, infra.Region)
|
||||
if err != nil {
|
||||
// If it's a not found error, just continue
|
||||
if isNotFoundError(err) {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ func (m *MockResourceClient) ShowApp(ctx context.Context, appKey v2.AppKey, regi
|
|||
return args.Get(0).(v2.App), args.Error(1)
|
||||
}
|
||||
|
||||
func (m *MockResourceClient) ShowAppInstances(ctx context.Context, instanceKey v2.AppInstanceKey, region string) ([]v2.AppInstance, error) {
|
||||
func (m *MockResourceClient) ShowAppInstances(ctx context.Context, instanceKey v2.AppInstanceKey, appKey v2.AppKey, region string) ([]v2.AppInstance, error) {
|
||||
args := m.Called(ctx, instanceKey, region)
|
||||
if args.Get(0) == nil {
|
||||
return nil, args.Error(1)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import (
|
|||
// EdgeConnectClientInterface defines the methods needed for deletion planning
|
||||
type EdgeConnectClientInterface interface {
|
||||
ShowApp(ctx context.Context, appKey v2.AppKey, region string) (v2.App, error)
|
||||
ShowAppInstances(ctx context.Context, instanceKey v2.AppInstanceKey, region string) ([]v2.AppInstance, error)
|
||||
ShowAppInstances(ctx context.Context, instanceKey v2.AppInstanceKey, appKey v2.AppKey, region string) ([]v2.AppInstance, error)
|
||||
DeleteApp(ctx context.Context, appKey v2.AppKey, region string) error
|
||||
DeleteAppInstance(ctx context.Context, instanceKey v2.AppInstanceKey, region string) error
|
||||
}
|
||||
|
|
@ -154,8 +154,9 @@ func (p *EdgeConnectPlanner) findInstancesToDelete(ctx context.Context, config *
|
|||
Name: infra.CloudletName,
|
||||
},
|
||||
}
|
||||
appKey := v2.AppKey{Name: config.Metadata.Name}
|
||||
|
||||
instances, err := p.client.ShowAppInstances(ctx, instanceKey, infra.Region)
|
||||
instances, err := p.client.ShowAppInstances(ctx, instanceKey, appKey, infra.Region)
|
||||
if err != nil {
|
||||
// If it's a not found error, just continue
|
||||
if isNotFoundError(err) {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ func (m *MockEdgeConnectClient) ShowApp(ctx context.Context, appKey v2.AppKey, r
|
|||
return args.Get(0).(v2.App), args.Error(1)
|
||||
}
|
||||
|
||||
func (m *MockEdgeConnectClient) ShowAppInstances(ctx context.Context, instanceKey v2.AppInstanceKey, region string) ([]v2.AppInstance, error) {
|
||||
func (m *MockEdgeConnectClient) ShowAppInstances(ctx context.Context, instanceKey v2.AppInstanceKey, appKey v2.AppKey, region string) ([]v2.AppInstance, error) {
|
||||
args := m.Called(ctx, instanceKey, region)
|
||||
if args.Get(0) == nil {
|
||||
return nil, args.Error(1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue