Skip to content

Commit

Permalink
Bump vela to v1.6.1, more automation (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
chivalryq authored Nov 10, 2022
1 parent c50085c commit 993e7c8
Show file tree
Hide file tree
Showing 15 changed files with 56 additions and 35 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ include makefiles/dependency.mk

K3S_VERSION ?= v1.21.10+k3s1
STATIC_DIR := pkg/resources/static
VELA_VERSION ?= v1.6.0
VELAUX_VERSION ?= v1.6.0
VELA_VERSION ?= v1.6.1
VELAUX_VERSION ?= v1.6.1
VELAUX_IMAGE_VERSION ?= ${VELAUX_VERSION}
LDFLAGS= "-X github.com/oam-dev/velad/version.VelaUXVersion=${VELAUX_VERSION} -X github.com/oam-dev/velad/version.VelaVersion=${VELA_VERSION}"
OS ?= linux
Expand Down
25 changes: 5 additions & 20 deletions contribute/upgrade-vela.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,41 +20,26 @@ Output like:
version: v1.4.2
```

Then use upgrade script, for example if you want to upgrade vela to v1.4.3, use `v1.4.2` and `v1.4.3`
as the first and the second argument:
Then use upgrade script, for example if you want to upgrade vela to v1.4.3, then use v1.4.3 as the version parameter.

```shell
./hack/upgrade_vela.sh v1.4.2 v1.4.3
./hack/upgrade_vela.sh v1.4.3
```

This script will clone the KubeVela repo and make diff between tag v1.4.2 and v1.4.3. Then try to patch the diff in VelaD's
This script will clone the KubeVela repo and make diff between version now and v1.4.3. Then try to patch the diff in VelaD's
embedded vela-core chart in `pkg/resources/static/vela/charts/vela-core`

If there are conflict, you have to resolve them manually.

### Upgrade go.mod

In go.mod file, find this item:

```text
github.com/oam-dev/kubevela v1.x.y
```

Then change the `v1.x.y` to version you want to upgrade to, then run:

```shell
go mod tidy
```

### Upgrade vela version in makefile

In `Makefile`, find this two variables, upgrade them to right version.

> VelaUX sometimes don't release new version together with KubeVela, make sure VelaUX version is right.
```makefile
VELA_VERSION ?= v1.4.2
VELAUX_VERSION ?= v1.4.2
VELAUX_VERSION ?= v1.6.0
VELAUX_IMAGE_VERSION ?= ${VELAUX_VERSION}
```

### After upgrade
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/fatih/color v1.13.0
github.com/k3d-io/k3d/v5 v5.4.1
github.com/kyokomi/emoji/v2 v2.2.9
github.com/oam-dev/kubevela v1.6.0
github.com/oam-dev/kubevela v1.6.1
github.com/pkg/errors v0.9.1
github.com/spf13/cobra v1.4.0
github.com/stretchr/testify v1.7.1
Expand Down Expand Up @@ -147,6 +147,7 @@ require (
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-retryablehttp v0.7.0 // indirect
github.com/hashicorp/go-version v1.3.0 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/hcl/v2 v2.9.1 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
Expand All @@ -162,7 +163,7 @@ require (
github.com/klauspost/compress v1.15.11 // indirect
github.com/kubevela/pkg v0.0.0-20221024115939-a103acee6db2 // indirect
github.com/kubevela/prism v1.5.1-0.20220915071949-6bf3ad33f84f // indirect
github.com/kubevela/workflow v0.3.1 // indirect
github.com/kubevela/workflow v0.3.2 // indirect
github.com/kyokomi/emoji v2.2.4+incompatible // indirect
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
Expand Down
9 changes: 5 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1126,6 +1126,7 @@ github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
Expand Down Expand Up @@ -1281,8 +1282,8 @@ github.com/kubevela/pkg v0.0.0-20221024115939-a103acee6db2 h1:C3cAfrxst1+dIWgLLh
github.com/kubevela/pkg v0.0.0-20221024115939-a103acee6db2/go.mod h1:TgIGEB/r0NOy63Jzem7WsL3AIr34l+ClH9dmPqcZ4d4=
github.com/kubevela/prism v1.5.1-0.20220915071949-6bf3ad33f84f h1:1lUtU1alPThdcsn4MI6XjPb7eJLuZPpmlEdgjtnUMKw=
github.com/kubevela/prism v1.5.1-0.20220915071949-6bf3ad33f84f/go.mod h1:m724/7ANnB/iukyHW20+DicpeJMEC/JA0ZhgsHY10MA=
github.com/kubevela/workflow v0.3.1 h1:R2h6bZbcBSF1OswF0LtLIGn+X+fS0xPOoYgWgOPn1Ig=
github.com/kubevela/workflow v0.3.1/go.mod h1:5jfZ8T1m/En44wDGRf2YqCSlODfEnAV+9PnzoLoDlFs=
github.com/kubevela/workflow v0.3.2 h1:r9jznJN5Tzwkg002qiHduhSD/iDwX+F+lG72yj2B5Eo=
github.com/kubevela/workflow v0.3.2/go.mod h1:5jfZ8T1m/En44wDGRf2YqCSlODfEnAV+9PnzoLoDlFs=
github.com/kulti/thelper v0.4.0/go.mod h1:vMu2Cizjy/grP+jmsvOFDx1kYP6+PD1lqg4Yu5exl2U=
github.com/kunwardeep/paralleltest v1.0.3/go.mod h1:vLydzomDFpk7yu5UX02RmP0H8QfRPOV/oFhWN85Mjb4=
github.com/kylelemons/godebug v0.0.0-20160406211939-eadb3ce320cb/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
Expand Down Expand Up @@ -1518,8 +1519,8 @@ github.com/oam-dev/cluster-gateway v1.4.0 h1:ZZcNRYsUDRWM5JnNX28/zdSPRKERGstcAY+
github.com/oam-dev/cluster-gateway v1.4.0/go.mod h1:qnCczkXtTY7h0SqxjZqAAyKQPwrJjLIFy+IdeoaYKCU=
github.com/oam-dev/cluster-register v1.0.4-0.20220928064144-5f76a9d7ca8c h1:RE/33gzs9hoyegcTaUXDG/hayffJ197ljMUGNP6I/5A=
github.com/oam-dev/cluster-register v1.0.4-0.20220928064144-5f76a9d7ca8c/go.mod h1:nKEUMfuEB8pHKsaSah9IA+UQzezrPYebBdRozyNtlZc=
github.com/oam-dev/kubevela v1.6.0 h1:FFpiDsZ+OXvT4nURdDCjkoPXaIVUdOCBjRJsHyBqyoI=
github.com/oam-dev/kubevela v1.6.0/go.mod h1:zpXSe8C0n4jfYVe9OBXYxcbcszdnety2662WddXJA50=
github.com/oam-dev/kubevela v1.6.1 h1:IDrmDUnh9HWnTvw6IhJnEvGSg4VzdEvdIHfXU5b5+pE=
github.com/oam-dev/kubevela v1.6.1/go.mod h1:EVfun0A8lVFe9wbu+4PiUmTLkaAFmZSdO9/izFywcBM=
github.com/oam-dev/stern v1.13.2 h1:jlGgtJbKmIVhzkH44ft5plkgs8XEfvxbFrQdX60CQR4=
github.com/oam-dev/stern v1.13.2/go.mod h1:0pLjZt0amXE/ErF16Rdrgd98H2owN8Hmn3/7CX5+AeA=
github.com/oam-dev/terraform-config-inspect v0.0.0-20210418082552-fc72d929aa28 h1:tD8HiFKnt0jnwdTWjeqUnfnUYLD/+Nsmj8ZGIxqDWiU=
Expand Down
17 changes: 14 additions & 3 deletions hack/upgrade_vela.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,28 @@

set -e

[ $# = 2 ] || { echo "Usage: "$0" version_now version_to" >&2; exit 1; }
[ $# = 1 ] || { echo "Usage: "$0" version_to" >&2; exit 1; }

VERSION_NOW=$1
VERSION_TO=$2
VERSION_NOW=$(cat Makefile |grep "VELA_VERSION ?=" |grep -o "v.*")
VERSION_TO=$1
PATCH_FILE_NAME=$VERSION_NOW-$VERSION_TO.patch
WORKDIR=pkg/resources/static/vela

echo "Upgrading KubeVela version From: "$VERSION_NOW" --> TO: "$VERSION_TO
echo "Upgrading chart version..."

./hack/upgrade_chart_version.sh $VERSION_TO

echo "Upgrading go.mod version..."

sed -i "" -e "s/github.com\/oam-dev\/kubevela v.*/github.com\/oam-dev\/kubevela $VERSION_TO/g" go.mod
go mod tidy

echo "Upgrading version variable in Makefile"

sed -i "" -e "s/VELA_VERSION ?= v.*/VELA_VERSION ?= $VERSION_TO/g" Makefile
echo "Upgrading vela-templates..."

git clone https://github.com/kubevela/kubevela.git

pushd kubevela
Expand Down
4 changes: 2 additions & 2 deletions pkg/resources/static/vela/charts/vela-core/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: v1.6.0
version: v1.6.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: v1.6.0
appVersion: v1.6.1

home: https://kubevela.io
icon: https://kubevela.io/img/logo.svg
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
definition.oam.dev/description: Apply components of an application in parallel for your workflow steps
labels:
custom.definition.oam.dev/deprecated: "true"
custom.definition.oam.dev/scope: Application
custom.definition.oam.dev/ui-hidden: "true"
name: apply-application-in-parallel
namespace: {{ include "systemDefinitionNamespace" . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
definition.oam.dev/description: Apply application for your workflow steps, it has no arguments, should be used for custom steps before or after application applied.
labels:
custom.definition.oam.dev/deprecated: "true"
custom.definition.oam.dev/scope: Application
custom.definition.oam.dev/ui-hidden: "true"
name: apply-application
namespace: {{ include "systemDefinitionNamespace" . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
definition.oam.dev/description: Apply remaining components and traits
labels:
custom.definition.oam.dev/deprecated: "true"
custom.definition.oam.dev/scope: Application
custom.definition.oam.dev/ui-hidden: "true"
name: apply-remaining
namespace: {{ include "systemDefinitionNamespace" . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Deploy cloud resource and deliver secret to multi clusters.
labels:
custom.definition.oam.dev/scope: Application
name: deploy-cloud-resource
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: A powerful and unified deploy step for components multi-cluster delivery with policies.
labels:
custom.definition.oam.dev/scope: Application
name: deploy
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
definition.oam.dev/description: Deploy env binding component to target env
labels:
custom.definition.oam.dev/deprecated: "true"
custom.definition.oam.dev/scope: Application
custom.definition.oam.dev/ui-hidden: "true"
name: deploy2env
namespace: {{ include "systemDefinitionNamespace" . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
definition.oam.dev/description: Deploy application to runtime clusters
labels:
custom.definition.oam.dev/deprecated: "true"
custom.definition.oam.dev/scope: Application
custom.definition.oam.dev/ui-hidden: "true"
name: deploy2runtime
namespace: {{ include "systemDefinitionNamespace" . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ kind: WorkflowStepDefinition
metadata:
annotations:
definition.oam.dev/description: Sync secrets created by terraform component to runtime clusters so that runtime clusters can share the created cloud resource.
labels:
custom.definition.oam.dev/scope: Application
name: share-cloud-resource
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ spec:
template: |
import (
"strconv"
"strings"
)
mountsArray: [
Expand Down Expand Up @@ -167,7 +168,11 @@ spec:
name: v.name
}
if v.name == _|_ {
name: "port-" + strconv.FormatInt(v.port, 10)
_name: "port-" + strconv.FormatInt(v.port, 10)
name: *_name | string
if v.protocol != "TCP" {
name: _name + "-" + strings.ToLower(v.protocol)
}
}
}}]
}
Expand Down Expand Up @@ -283,11 +288,18 @@ spec:
name: v.name
}
if v.name == _|_ {
name: "port-" + strconv.FormatInt(v.port, 10)
_name: "port-" + strconv.FormatInt(v.port, 10)
name: *_name | string
if v.protocol != "TCP" {
name: _name + "-" + strings.ToLower(v.protocol)
}
}
if v.nodePort != _|_ && parameter.exposeType == "NodePort" {
nodePort: v.nodePort
}
if v.protocol != _|_ {
protocol: v.protocol
}
},
]
outputs: {
Expand Down

0 comments on commit 993e7c8

Please sign in to comment.