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

Feat: Add the CI step to check the addon config #703

Merged
merged 3 commits into from
Mar 16, 2023
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
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: '16'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/server-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ jobs:
make e2e-setup-core
make start-addon-mock-server
make load-image
make enable-addon

- name: Run server e2e test
run: |
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ start-addon-mock-server:
load-image:
k3d image import oamdev/velaux:latest || { echo >&2 "kind not installed or error loading image: $(VELA_CORE_TEST_IMAGE)"; exit 1; }

enable-addon:
vela addon enable ./addon

.PHONY: e2e-server-test
e2e-server-test:
go test -v -coverpkg=./... -coverprofile=/tmp/e2e_apiserver_test.out ./e2e-test
Expand Down
2 changes: 0 additions & 2 deletions addon/NOTES.cue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ info: """

vela port-forward -n vela-system addon-velaux 9082:80

Select \"local | velaux | velaux\" from the prompt.

Please refer to https://kubevela.io/docs/reference/addons/velaux for more VelaUX addon installation and visiting method.
"""
notes: (info)
7 changes: 4 additions & 3 deletions addon/metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
name: velaux
version: v1.7.4
description: KubeVela User Experience (UX). An extensible, application-oriented delivery and management Dashboard.
version: latest
description: KubeVela User Experience (UX). An extensible, application-oriented delivery and management Platform.
icon: https://static.kubevela.net/images/logos/KubeVela%20-03.png
url: https://kubevela.io

tags:
- Official
- Dashboard

deployTo:
controlPlane: true
runtimeCluster: false

system:
vela: ">=v1.6.0-alpha.6"
vela: ">=v1.6.0"
2 changes: 0 additions & 2 deletions addon/parameter.cue
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ parameter: {
serviceType: *"ClusterIP" | "NodePort" | "LoadBalancer"
// +usage=Specify the names of imagePullSecret for private image registry, eg. "{a,b,c}"
imagePullSecrets?: [...string]
// +usage=Specify whether to enable the dex
dex: *false | bool
// +usage=Specify the replicas.
replicas: *1 | int
// +usage=Specify nodeport. This will be ignored if serviceType is not NodePort.
Expand Down
48 changes: 46 additions & 2 deletions addon/resources/apiserver.cue → addon/resources/server.cue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,44 @@ enableImpersonation: *[ if parameter["enableImpersonation"] {
"--feature-gates=EnableImpersonation=true"
}] | []

apiserver: {
_nginxTrait: *[
if parameter["domain"] != _|_ && parameter["gatewayDriver"] == "nginx" {
{
type: "gateway"
properties: {
domain: parameter["domain"]
http: {
"/": 8000
}
class: "nginx"
}
}
},
] | []

_traefikTrait: *[
if parameter["domain"] != _|_ && parameter["gatewayDriver"] == "traefik" {
{
type: "http-route"
properties: {
domains: [ parameter["domain"]]
rules: [{port: 8000}]
}
}
},
] | []

_httpsTrait: *[ if parameter["secretName"] != _|_ && parameter["domain"] != _|_ && parameter["gatewayDriver"] == "traefik" {
type: "https-route"
properties: {
domains: [ parameter["domain"]]
rules: [{port: 80}]
secrets: [{
name: parameter["secretName"]
}]
}}] | []

server: {
name: "apiserver"
type: "webservice"
properties: {
Expand All @@ -30,12 +67,19 @@ apiserver: {
imagePullSecrets: parameter["imagePullSecrets"]
}

if parameter["serviceType"] != _|_ {
exposeType: parameter["serviceType"]
}

cmd: ["apiserver", "--datastore-type=" + parameter["dbType"]] + database + dbURL + enableImpersonation
ports: [
{
port: 8000
protocol: "TCP"
expose: true
if parameter["serviceType"] == "NodePort" {
nodePort: parameter["nodePort"]
}
},
]
}
Expand All @@ -46,5 +90,5 @@ apiserver: {
properties: name: parameter["serviceAccountName"]
},
{type: "scaler", properties: replicas: parameter["replicas"]},
]
] + _nginxTrait + _traefikTrait + _httpsTrait
}
94 changes: 0 additions & 94 deletions addon/resources/velaux.cue

This file was deleted.

2 changes: 1 addition & 1 deletion addon/template.cue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ output: {
apiVersion: "core.oam.dev/v1beta1"
kind: "Application"
spec: {
components: [additionalPrivileges, apiserver, velaux]
components: [additionalPrivileges, server]
}
}