virtcontainers: clh: Upgrade to openapi-generator v5.3.0

The latest release of openapi-generator v5.3.0 contains the fix for
`dropping err` bug [1]. This patch also re-generated the client code of
Cloud Hypervisor to have the bug fixed.

[1] https://github.com/OpenAPITools/openapi-generator/pull/10275

Fixes: #3201

Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
Bo Chen 2021-12-03 08:42:39 -08:00
parent d02a0932d6
commit 995300260e
5 changed files with 9 additions and 7 deletions

View File

@ -13,7 +13,7 @@ YQ := $(shell command -v yq 2> /dev/null)
generate-client-code: clean-generated-code
docker run --rm \
--user $$(id -u):$$(id -g) \
-v $${PWD}:/local openapitools/openapi-generator-cli:v5.2.1 generate \
-v $${PWD}:/local openapitools/openapi-generator-cli:v5.3.0 generate \
-i /local/cloud-hypervisor.yaml \
-g go \
-o /local/client

View File

@ -58,7 +58,7 @@ Note, enum values are always validated and all unused variables are silently ign
### URLs Configuration per Operation
Each operation can use different server URL defined using `OperationServers` map in the `Configuration`.
An operation is uniquely identifield by `"{classname}Service.{nickname}"` string.
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps.
```

View File

@ -366,6 +366,9 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err
return
}
_, err = (*f).Write(b)
if err != nil {
return
}
_, err = (*f).Seek(0, io.SeekStart)
return
}

View File

@ -1,7 +1,7 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
git_user_id=$1
git_repo_id=$2
@ -38,14 +38,14 @@ git add .
git commit -m "$release_note"
# Sets the new remote
git_remote=`git remote`
git_remote=$(git remote)
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
fi
fi
@ -55,4 +55,3 @@ git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'