Skip to content

Commit

Permalink
addressing the comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Pushpalatha555 committed Jun 6, 2022
1 parent 01d68fd commit 6ad9705
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion pkg/client/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ func (a *api) do(ctx context.Context, request interface{}, queryParams map[strin
panic("api not properly configured")
}
a.path = fmt.Sprintf("%s/%s/%s", a.client.getHost(), consts.VmaasCmpAPIBasePath, a.path)
// a.path = fmt.Sprintf("%s/%s", a.client.getHost(), a.path)

for _, validations := range a.validations {
err := validations()
Expand Down
6 changes: 3 additions & 3 deletions pkg/client/instances_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func TestInstancesAPIService_CloneAnInstance(t *testing.T) {
Name: "Instance_Clone",
}
// pBody := []byte(`{"zoneId":"1","CloneName":"Instance_Clone"}`)
m.EXPECT().getVersion().Return(999999).AnyTimes()
m.EXPECT().getVersion().Return(999999).MaxTimes(3)
m.EXPECT().prepareRequest(gomock.Any(), path, method, pBody, headers, url.Values{},
url.Values{}, "", nil).Return(req, nil)

Expand Down Expand Up @@ -99,7 +99,7 @@ func TestInstancesAPIService_CloneAnInstance(t *testing.T) {
Name: "Instance_Clone",
}
// pBody := []byte(`{"ZoneID":"1","CloneName":"Instance_Clone"}`)
m.EXPECT().getVersion().Return(999999).AnyTimes()
m.EXPECT().getVersion().Return(999999).MaxTimes(3)
m.EXPECT().prepareRequest(gomock.Any(), path, method, pBody, headers, url.Values{},
url.Values{}, "", nil).Return(nil, errors.New("prepare request error"))
},
Expand Down Expand Up @@ -144,7 +144,7 @@ func TestInstancesAPIService_CloneAnInstance(t *testing.T) {
},
Name: "Instance_Clone",
}
m.EXPECT().getVersion().Return(999999).AnyTimes()
m.EXPECT().getVersion().Return(999999).MaxTimes(3)
m.EXPECT().prepareRequest(gomock.Any(), path, method, pBody, headers, url.Values{},
url.Values{}, "", nil).Return(req, nil)

Expand Down
4 changes: 2 additions & 2 deletions pkg/client/power_schedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (a *PowerSchedulesAPIService) GetAllPowerSchedules(ctx context.Context,

allPowerScheduleAPI := &api{
method: "GET",
path: consts.PowerSchedulPath,
path: consts.PowerSchedulePath,
client: a.Client,

jsonParser: func(body []byte) error {
Expand All @@ -51,7 +51,7 @@ func (a *PowerSchedulesAPIService) GetSpecificPowerSchedule(

allPowerScheduleAPI := &api{
method: "GET",
path: fmt.Sprintf("%s/%d", consts.PowerSchedulPath, powerID),
path: fmt.Sprintf("%s/%d", consts.PowerSchedulePath, powerID),
client: a.Client,

jsonParser: func(body []byte) error {
Expand Down
4 changes: 2 additions & 2 deletions pkg/common/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ const (
VirtualImagePath = "virtual-images"
FolderPath = "folders"
ConfigOptionPath = "config-options"
PowerSchedulPath = "power-schedules"
PowerSchedulePath = "power-schedules"
EnvironmentPath = "environments"
OptionsPath = "options"
ZoneNetworkOptionsPath = "zoneNetworkOptions"
ProvisionTypesPath = "provision-types"
RouterRoutePath = "routes"
RouterBgpNeighborPath = "bgp-neighbors"
NetworkEdgeClusterPath = "edge-clusters"

// Whoami Path
WhoamiPath = "whoami"

// headers
Expand Down

0 comments on commit 6ad9705

Please sign in to comment.