Skip to content

Commit

Permalink
Merge pull request #20468 from p-fruck/fix/api-compat-network-docs
Browse files Browse the repository at this point in the history
[CI:DOCS] (API): Fix compat network (dis-)connect
  • Loading branch information
openshift-ci[bot] authored Oct 25, 2023
2 parents 5a47b1e + 0a2aae1 commit 84efd2b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions pkg/api/handlers/swagger/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ type networkNotFound struct {
Body errorhandling.ErrorModel
}

// Network is already connected and container is running or transitioning to the running state ('initialized')
// swagger:response
type networkConnectedError struct {
// in:body
Body errorhandling.ErrorModel
}

// No such exec instance
// swagger:response
type execSessionNotFound struct {
Expand Down
6 changes: 4 additions & 2 deletions pkg/api/server/register_networks.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (s *APIServer) registerNetworkHandlers(r *mux.Router) error {
// tags:
// - networks (compat)
// summary: Connect container to network
// description: Connect a container to a network. This endpoint is current a no-op
// description: Connect a container to a network
// produces:
// - application/json
// parameters:
Expand All @@ -144,6 +144,8 @@ func (s *APIServer) registerNetworkHandlers(r *mux.Router) error {
// description: OK
// 400:
// $ref: "#/responses/badParamError"
// 403:
// $ref: "#/responses/networkConnectedError"
// 500:
// $ref: "#/responses/internalError"
r.HandleFunc(VersionedPath("/networks/{name}/connect"), s.APIHandler(compat.Connect)).Methods(http.MethodPost)
Expand All @@ -153,7 +155,7 @@ func (s *APIServer) registerNetworkHandlers(r *mux.Router) error {
// tags:
// - networks (compat)
// summary: Disconnect container from network
// description: Disconnect a container from a network. This endpoint is current a no-op
// description: Disconnect a container from a network
// produces:
// - application/json
// parameters:
Expand Down

1 comment on commit 84efd2b

@packit-as-a-service
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

podman-next COPR build failed. @containers/packit-build please check.

Please sign in to comment.