Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

Commit

Permalink
Package legacy helm chart (#287)
Browse files Browse the repository at this point in the history
* Package legacy helm chart

packaged legacy helm chart for Kubernetes 1.14/1.15
and publish it with the ci

Co-authored-by: Jianbo Sun <[email protected]>
Signed-off-by: zzxwill <[email protected]>

* address Nic's advice to build submodule helm chart

Signed-off-by: zzxwill <[email protected]>

* Fix unit-test build by extending wait seconds

Signed-off-by: zzxwill <[email protected]>

Co-authored-by: Jianbo Sun <[email protected]>
  • Loading branch information
zzxwill and wonderflow authored Nov 10, 2020
1 parent 11fab2b commit 11e1894
Show file tree
Hide file tree
Showing 19 changed files with 89 additions and 6 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ jobs:
- name: Vendor Dependencies
run: make vendor vendor.check


- name: Build Legacy Helm Chart
run: make prepare-legacy-chart


- name: Check Diff
run: make check-diff

Expand Down Expand Up @@ -156,13 +161,18 @@ jobs:
- name: Vendor Dependencies
run: make vendor vendor.check

- name: Build Legacy Helm Chart
run: make prepare-legacy-chart


- name: Build Helm Chart
run: make -j2 build
env:
# We're using docker buildx, which doesn't actually load the images it
# builds by default. Specifying --load does so.
BUILD_ARGS: "--load"


- name: Install ginkgo
run: |
sudo apt-get update
Expand Down Expand Up @@ -214,6 +224,11 @@ jobs:
- name: Vendor Dependencies
run: make vendor vendor.check


- name: Build Legacy Helm Chart
run: make prepare-legacy-chart


- name: Build Artifacts
run: make -j2 build.all
env:
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,7 @@ tmp/
csr.conf
oam-kubernetes-runtime-webhook.csr
oam-kubernetes-runtime-webhook.key
oam-kubernetes-runtime-webhook.pem
oam-kubernetes-runtime-webhook.pem

# legacy chart
charts/oam-kubernetes-runtime-legacy
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@ S3_BUCKET ?= crossplane.releases/oam
HELM_BASE_URL = https://charts.crossplane.io
HELM_S3_BUCKET = crossplane.charts
HELM_CHARTS_DIR=$(ROOT_DIR)/charts
HELM_CHARTS = oam-kubernetes-runtime
HELM_CHART = oam-kubernetes-runtime
LEGACY_HELM_CHART = oam-kubernetes-runtime-legacy
HELM_CHARTS = $(HELM_CHART) $(LEGACY_HELM_CHART)
LEGACY_HELM_CHART_DIR=$(ROOT_DIR)/legacy/charts
HELM_CHART_LINT_ARGS_oam-kubernetes-runtime = --set serviceAccount.name=''
HELM_CHART_LINT_ARGS_oam-kubernetes-runtime-legacy = --set serviceAccount.name='' --set image.tag='master'

-include build/makelib/helm.mk

# ====================================================================================
Expand Down Expand Up @@ -157,4 +162,8 @@ e2e-cleanup:
helm uninstall e2e -n oam-system
kubectl delete namespace oam-system --wait

e2e: e2e-setup e2e-test go-integration
e2e: e2e-setup e2e-test go-integration

prepare-legacy-chart:
rsync -r $(LEGACY_HELM_CHART_DIR)/$(LEGACY_HELM_CHART) $(HELM_CHARTS_DIR)
rsync -r $(HELM_CHARTS_DIR)/$(HELM_CHART)/* $(HELM_CHARTS_DIR)/$(LEGACY_HELM_CHART) --exclude=Chart.yaml --exclude=crds
2 changes: 1 addition & 1 deletion apis/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ limitations under the License.

// Generate legacy_support for K8s 1.12~1.15 versions CRD manifests
//go:generate go run -tags generate sigs.k8s.io/controller-tools/cmd/controller-gen object:headerFile=../hack/boilerplate.go.txt paths=./... crd:trivialVersions=true output:artifacts:config=../legacy/crds
//go:generate go run ../legacy/convert/main.go ../legacy/crds
//go:generate go run ../legacy/convert/main.go ../legacy/charts/oam-kubernetes-runtime-legacy/crds

package apis

Expand Down
2 changes: 1 addition & 1 deletion charts/oam-kubernetes-runtime/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
values.yaml
values.yaml-e
values.yaml-e
8 changes: 8 additions & 0 deletions legacy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,11 @@ Currently, the main block is OAM runtime use CRD v1, while these old K8s version
So we generate v1beta1 CRD here for convenience. But we have no guarantee that oam-runtime will support the
legacy k8s versions.

`IMAGE-TAG` marks the image tag of OAM Kubernetes Runtime, like `v0.3.0`. If omitted, the latest image will
be used in the chart.

```
$ kubectl create namespace oam-system
$ helm repo add crossplane-master https://charts.crossplane.io/master/
$ helm install oam --namespace oam-system crossplane-master/oam-kubernetes-runtime-legacy --set image.tag=$IMAGE-TAG --devel
```
2 changes: 2 additions & 0 deletions legacy/charts/oam-kubernetes-runtime-legacy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
values.yaml
values.yaml-e
22 changes: 22 additions & 0 deletions legacy/charts/oam-kubernetes-runtime-legacy/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
21 changes: 21 additions & 0 deletions legacy/charts/oam-kubernetes-runtime-legacy/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v1
name: oam-kubernetes-runtime-legacy
description: A Helm chart for OAM Kubernetes Resources Controller, targeted on Kubernetes v1.14 and v1.15

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
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: 0.0.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: 0.1
2 changes: 1 addition & 1 deletion pkg/oam/discoverymapper/suit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ var _ = Describe("Mapper discovery resources", func() {
Eventually(func() error {
kinds, err = dism.KindsFor(schema.GroupVersionResource{Group: "example.com", Version: "", Resource: "foos"})
return err
}, time.Second*2, time.Millisecond*300).Should(BeNil())
}, time.Second*10, time.Millisecond*300).Should(BeNil())
Expect(kinds).Should(Equal([]schema.GroupVersionKind{
{Group: "example.com", Version: "v1", Kind: "Foo"},
{Group: "example.com", Version: "v1beta1", Kind: "Foo"},
Expand Down
3 changes: 3 additions & 0 deletions test/e2e-test/component_version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,9 @@ var _ = Describe("Versioning mechanism of components", func() {
if err != nil {
return ""
}
if len(appconfig.Status.Workloads) == 0 {
return ""
}
return appconfig.Status.Workloads[0].ComponentRevisionName
},
time.Second*60, time.Millisecond*500).Should(BeEquivalentTo(revisionNameV2))
Expand Down

0 comments on commit 11e1894

Please sign in to comment.