Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: upgrade go-swagger to 0.17.1 #2350

Merged
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
16 changes: 0 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ RUN apt-get update \
gcc \
vim \
tree \
rubygems \
&& apt-get clean

# set go version this image use
Expand All @@ -30,21 +29,6 @@ ENV GOPATH=/go
# go binary path is /usr/local/go/bin
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH

# install golint. currently golint has no released version.
RUN go get -u golang.org/x/lint/golint

# install swagger 0.12.0
RUN wget --quiet -O /bin/swagger https://github.com/go-swagger/go-swagger/releases/download/0.12.0/swagger_linux_amd64 \
&& chmod +x /bin/swagger

# install markdownlint tool
RUN gem install rake \
&& gem install bundler \
&& git clone https://github.com/markdownlint/markdownlint.git \
&& cd markdownlint \
&& git checkout v0.4.0 \
&& rake install

COPY . /go/src/github.com/alibaba/pouch

WORKDIR /go/src/github.com/alibaba/pouch
Expand Down
64 changes: 38 additions & 26 deletions apis/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ paths:
200:
description: "no error"
schema:
$ref: '#definitions/EventsMessage'
$ref: '#/definitions/EventsMessage'
400:
description: "bad parameter"
schema:
Expand Down Expand Up @@ -895,18 +895,10 @@ paths:
operationId: "ContainerCheckpointCreate"
parameters:
- $ref: "#/parameters/id"
- name: "checkpointdir"
in: "query"
description: "checkpoint directory"
type: "string"
- name: "checkpointid"
in: "query"
description: "checkpoint id"
type: "string"
- name: "exit"
in: "query"
description: "exit after checkpoint"
type: "bool"
- name: "body"
in: "body"
schema:
$ref: "#/definitions/CheckpointCreateOptions"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you do this kind of change in another pull request? Since then swagger.yml refactoring has nothing to do with the swagger upgrade. WDYT? @zhuangqh

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you do this kind of change in another pull request? Since then swagger.yml refactoring has nothing to do with the swagger upgrade. WDYT? @zhuangqh

Actually, this part of code is wrong, which failed to pass the stricter validation. Futhermore, it makes this PR fail to pass the CI. So this part of change should be included in this PR although it looks confused...

Copy link
Collaborator

Choose a reason for hiding this comment

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

Roger that.

responses:
201:
description: "created"
Expand All @@ -917,8 +909,6 @@ paths:
404:
$ref: "#/responses/404ErrorResponse"
tags: ["Container"]

/containers/{id}/checkpoints:
get:
summary: "list checkpoints of a container"
operationId: "ContainerCheckpointList"
Expand All @@ -939,19 +929,20 @@ paths:
$ref: "#/responses/404ErrorResponse"
tags: ["Container"]

/containers/{id}/checkpoints/{id}:
/containers/{id}/checkpoints/{checkpointId}:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

error: duplicated parameter id

delete:
summary: "delete a checkpoint of a container"
operationId: "ContainerCheckpointDelete"
parameters:
- $ref: "#/parameters/id"
- name: "checkpointdir"
in: "query"
description: "checkpoint directory"
- name: "checkpointId"
in: "path"
description: "checkpoint id"
type: "string"
- name: "checkpointid"
required: true
- name: "dir"
in: "query"
description: "checkpoint id"
description: "checkpoint directory"
type: "string"
responses:
204:
Expand Down Expand Up @@ -2534,24 +2525,21 @@ definitions:
Resources:
description: "A container's resources (cgroups config, ulimits, etc)"
type: "object"
required: [CpuShares, Memory, CgroupParent, BlkioWeight, CpuPeriod, CpuQuota, CpuRealtimePeriod,
CpuRealtimeRuntime, CpusetCpus, CpusetMems, DeviceCgroupRules, KernelMemory, MemoryReservation,
MemorySwap, MemorySwappiness, NanoCpus, OomKillDisable, PidsLimit, CpuCount, CpuPercent,
IOMaximumIOps, IOMaximumBandwidth, IntelRdtL3Cbm, ScheLatSwitch, MemoryWmarkRatio, MemoryExtra,
MemoryForceEmptyCtl]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These fields should be included in encoded json string. However, they are not required. x-omitempty extension provide the ability to solve this situation.

properties:
# Applicable to UNIX platforms
CgroupParent:
description: "Path to `cgroups` under which the container's `cgroup` is created. If the path is not absolute, the path is considered to be relative to the `cgroups` path of the init process. Cgroups are created if they do not already exist."
type: "string"
x-nullable: false
x-omitempty: false
BlkioWeight:
description: "Block IO weight (relative weight), need CFQ IO Scheduler enable."
type: "integer"
format: "uint16"
x-nullable: false
minimum: 0
maximum: 1000
x-omitempty: false
BlkioWeightDevice:
description: |
Block IO weight (relative device weight) in the form `[{"Path": "device_path", "Weight": weight}]`.
Expand Down Expand Up @@ -2586,6 +2574,7 @@ definitions:
description: "An integer value representing this container's relative CPU weight versus other containers."
type: "integer"
x-nullable: false
x-omitempty: false
CpuPeriod:
description: |
CPU CFS (Completely Fair Scheduler) period.
Expand All @@ -2595,6 +2584,7 @@ definitions:
minimum: 1000
maximum: 1000000
x-nullable: false
x-omitempty: false
CpuQuota:
description: |
CPU CFS (Completely Fair Scheduler) quota.
Expand All @@ -2603,25 +2593,30 @@ definitions:
format: "int64"
minimum: 1000
x-nullable: false
x-omitempty: false
CpuRealtimePeriod:
description: "The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks."
type: "integer"
format: "int64"
x-nullable: false
x-omitempty: false
CpuRealtimeRuntime:
description: "The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks."
type: "integer"
format: "int64"
x-nullable: false
x-omitempty: false
CpusetCpus:
description: "CPUs in which to allow execution (e.g., `0-3`, `0,1`)"
type: "string"
example: "0-3"
x-nullable: false
x-omitempty: false
CpusetMems:
description: "Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems."
type: "string"
x-nullable: false
x-omitempty: false
Devices:
description: "A list of devices to add to the container."
type: "array"
Expand All @@ -2638,42 +2633,50 @@ definitions:
type: "integer"
format: "int64"
x-nullable: false
x-omitempty: false
Memory:
description: "Memory limit in bytes."
type: "integer"
default: 0
x-nullable: false
x-omitempty: false
MemoryReservation:
description: "Memory soft limit in bytes."
type: "integer"
format: "int64"
x-nullable: false
x-omitempty: false
MemorySwap:
description: "Total memory limit (memory + swap). Set as `-1` to enable unlimited swap."
type: "integer"
format: "int64"
x-nullable: false
x-omitempty: false
MemorySwappiness:
description: "Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100."
type: "integer"
format: "int64"
minimum: 0
maximum: 100
x-omitempty: false
NanoCpus:
description: "CPU quota in units of 10<sup>-9</sup> CPUs."
type: "integer"
format: "int64"
x-nullable: false
x-omitempty: false
OomKillDisable:
description: "Disable OOM Killer for the container."
type: "boolean"
x-nullable: true
x-omitempty: false
PidsLimit:
description: |
Tune a container's pids limit. Set -1 for unlimited. Only on Linux 4.4 does this parameter support.
type: "integer"
format: "int64"
x-nullable: false
x-omitempty: false
Ulimits:
description: |
A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`"
Expand All @@ -2688,27 +2691,32 @@ definitions:
type: "integer"
format: "int64"
x-nullable: false
x-omitempty: false
CpuPercent:
description: |
The usable percentage of the available CPUs (Windows only).
On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last.
type: "integer"
format: "int64"
x-nullable: false
x-omitempty: false
IOMaximumIOps:
description: "Maximum IOps for the container system drive (Windows only)"
type: "integer"
format: "uint64"
x-nullable: false
x-omitempty: false
IOMaximumBandwidth:
description: "Maximum IO in bytes per second for the container system drive (Windows only)"
type: "integer"
format: "uint64"
x-nullable: false
x-omitempty: false
IntelRdtL3Cbm:
description: "IntelRdtL3Cbm specifies settings for Intel RDT/CAT group that the container is placed into to limit the resources (e.g., L3 cache) the container has available."
type: "string"
x-nullable: false
x-omitempty: false

# applicable to AliKenerl 4.9
ScheLatSwitch:
Expand All @@ -2718,6 +2726,7 @@ definitions:
minimum: 0
maximum: 1
x-nullable: false
x-omitempty: false
MemoryWmarkRatio:
description: |
MemoryWmarkRatio is an integer value representing this container's memory low water mark percentage.
Expand All @@ -2727,6 +2736,7 @@ definitions:
x-nullable: true
minimum: 0
maximum: 100
x-omitempty: false
MemoryExtra:
description: |
MemoryExtra is an integer value representing this container's memory high water mark percentage.
Expand All @@ -2736,13 +2746,15 @@ definitions:
x-nullable: true
minimum: 0
maximum: 100
x-omitempty: false
MemoryForceEmptyCtl:
description: "MemoryForceEmptyCtl represents whether to reclaim the page cache when deleting cgroup."
type: "integer"
format: "int64"
x-nullable: false
minimum: 0
maximum: 1
x-omitempty: false
NvidiaConfig:
$ref: "#/definitions/NvidiaConfig"

Expand Down
20 changes: 0 additions & 20 deletions apis/types/auth_config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 1 addition & 8 deletions apis/types/auth_response.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading