Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions plugins/clusters/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ func init() {
// Nested resource: cluster statuses
clusterStatusHandler := handlers.NewClusterStatusHandler(adapterStatus.Service(envServices), Service(envServices))
clustersRouter.HandleFunc("/{id}/statuses", clusterStatusHandler.List).Methods(http.MethodGet)
clustersRouter.HandleFunc("/{id}/statuses", clusterStatusHandler.Create).Methods(http.MethodPost)
clustersRouter.HandleFunc("/{id}/statuses", clusterStatusHandler.Create).Methods(http.MethodPut)

// Nested resource: cluster nodepools
Expand All @@ -84,7 +83,6 @@ func init() {
// Nested resource: nodepool statuses
nodepoolStatusHandler := handlers.NewNodePoolStatusHandler(adapterStatus.Service(envServices), nodePools.Service(envServices))
clustersRouter.HandleFunc("/{id}/nodepools/{nodepool_id}/statuses", nodepoolStatusHandler.List).Methods(http.MethodGet)
clustersRouter.HandleFunc("/{id}/nodepools/{nodepool_id}/statuses", nodepoolStatusHandler.Create).Methods(http.MethodPost)
clustersRouter.HandleFunc("/{id}/nodepools/{nodepool_id}/statuses", nodepoolStatusHandler.Create).Methods(http.MethodPut)

clustersRouter.Use(authMiddleware.AuthenticateAccountJWT)
Expand Down
20 changes: 10 additions & 10 deletions test/integration/clusters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1163,9 +1163,9 @@ func TestClusterHardDelete(t *testing.T) {
},
nil,
)
statusResp, loopErr := client.PostClusterStatusesWithResponse(
statusResp, loopErr := client.PutClusterStatusesWithResponse(
ctx, cluster.ID,
openapi.PostClusterStatusesJSONRequestBody(statusInput), test.WithAuthToken(ctx),
openapi.PutClusterStatusesJSONRequestBody(statusInput), test.WithAuthToken(ctx),
)
Expect(loopErr).NotTo(HaveOccurred())
Expect(statusResp.StatusCode()).To(Equal(http.StatusCreated))
Expand Down Expand Up @@ -1224,9 +1224,9 @@ func TestClusterHardDelete(t *testing.T) {
},
nil,
)
statusResp, err := client.PostClusterStatusesWithResponse(
statusResp, err := client.PutClusterStatusesWithResponse(
ctx, cluster.ID,
openapi.PostClusterStatusesJSONRequestBody(statusInput), test.WithAuthToken(ctx),
openapi.PutClusterStatusesJSONRequestBody(statusInput), test.WithAuthToken(ctx),
)
Expect(err).NotTo(HaveOccurred())
Expect(statusResp.StatusCode()).To(Equal(http.StatusCreated))
Expand Down Expand Up @@ -1295,9 +1295,9 @@ func TestClusterHardDelete(t *testing.T) {
},
nil,
)
statusResp, loopErr := client.PostClusterStatusesWithResponse(
statusResp, loopErr := client.PutClusterStatusesWithResponse(
ctx, cluster.ID,
openapi.PostClusterStatusesJSONRequestBody(statusInput), test.WithAuthToken(ctx),
openapi.PutClusterStatusesJSONRequestBody(statusInput), test.WithAuthToken(ctx),
)
Expect(loopErr).NotTo(HaveOccurred())
Expect(statusResp.StatusCode()).To(Equal(http.StatusCreated))
Expand Down Expand Up @@ -1334,9 +1334,9 @@ func TestClusterHardDelete(t *testing.T) {
},
nil,
)
_, loopErr := client.PostNodePoolStatusesWithResponse(
_, loopErr := client.PutNodePoolStatusesWithResponse(
ctx, cluster.ID, nodePool.ID,
openapi.PostNodePoolStatusesJSONRequestBody(statusInput), test.WithAuthToken(ctx),
openapi.PutNodePoolStatusesJSONRequestBody(statusInput), test.WithAuthToken(ctx),
)
Expect(loopErr).NotTo(HaveOccurred())
}
Expand Down Expand Up @@ -1371,9 +1371,9 @@ func TestClusterHardDelete(t *testing.T) {
},
nil,
)
finalResp, err := client.PostClusterStatusesWithResponse(
finalResp, err := client.PutClusterStatusesWithResponse(
ctx, cluster.ID,
openapi.PostClusterStatusesJSONRequestBody(statusInput), test.WithAuthToken(ctx),
openapi.PutClusterStatusesJSONRequestBody(statusInput), test.WithAuthToken(ctx),
)
Expect(err).NotTo(HaveOccurred())
Expect(finalResp.StatusCode()).To(Equal(http.StatusCreated))
Expand Down
16 changes: 8 additions & 8 deletions test/integration/node_pools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -754,9 +754,9 @@ func TestNodePoolHardDelete(t *testing.T) {
},
nil,
)
statusResp, loopErr := client.PostNodePoolStatusesWithResponse(
statusResp, loopErr := client.PutNodePoolStatusesWithResponse(
ctx, cluster.ID, nodePool.ID,
openapi.PostNodePoolStatusesJSONRequestBody(statusInput), test.WithAuthToken(ctx),
openapi.PutNodePoolStatusesJSONRequestBody(statusInput), test.WithAuthToken(ctx),
)
Expect(loopErr).NotTo(HaveOccurred())
Expect(statusResp.StatusCode()).To(Equal(http.StatusCreated))
Expand Down Expand Up @@ -815,9 +815,9 @@ func TestNodePoolHardDelete(t *testing.T) {
},
nil,
)
statusResp, err := client.PostNodePoolStatusesWithResponse(
statusResp, err := client.PutNodePoolStatusesWithResponse(
ctx, cluster.ID, nodePool.ID,
openapi.PostNodePoolStatusesJSONRequestBody(statusInput), test.WithAuthToken(ctx),
openapi.PutNodePoolStatusesJSONRequestBody(statusInput), test.WithAuthToken(ctx),
)
Expect(err).NotTo(HaveOccurred())
Expect(statusResp.StatusCode()).To(Equal(http.StatusCreated))
Expand Down Expand Up @@ -870,9 +870,9 @@ func TestNodePoolHardDelete(t *testing.T) {
},
nil,
)
statusResp, err := client.PostNodePoolStatusesWithResponse(
statusResp, err := client.PutNodePoolStatusesWithResponse(
ctx, cluster.ID, nodePool.ID,
openapi.PostNodePoolStatusesJSONRequestBody(statusInput), test.WithAuthToken(ctx),
openapi.PutNodePoolStatusesJSONRequestBody(statusInput), test.WithAuthToken(ctx),
)
Expect(err).NotTo(HaveOccurred())
Expect(statusResp.StatusCode()).To(Equal(http.StatusCreated))
Expand Down Expand Up @@ -923,9 +923,9 @@ func TestNodePoolHardDelete(t *testing.T) {
},
nil,
)
statusResp, loopErr := client.PostNodePoolStatusesWithResponse(
statusResp, loopErr := client.PutNodePoolStatusesWithResponse(
ctx, cluster.ID, nodePool.ID,
openapi.PostNodePoolStatusesJSONRequestBody(statusInput), test.WithAuthToken(ctx),
openapi.PutNodePoolStatusesJSONRequestBody(statusInput), test.WithAuthToken(ctx),
)
Expect(loopErr).NotTo(HaveOccurred())
Expect(statusResp.StatusCode()).To(Equal(http.StatusCreated))
Expand Down