Skip to content

Commit

Permalink
[core] support customer kubeconfig
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Yuan <[email protected]>
  • Loading branch information
SamYuan1990 committed Nov 8, 2024
1 parent f8ee8d8 commit 6d30732
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
prometheus_operator_version: v0.12.0
grafana_enable: ${{matrix.GRAFANA_ENABLE}}
tekton_enable: ${{matrix.TEKTON_ENABLE}}
kubeconfig_root_dir: /tmp/kubeconfig
- name: verify
run: |
./verify.sh cluster
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/testEdge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,28 @@ jobs:
- name: verify
run: |
./verify.sh cluster
test_cutsomer_cluster_with_cutsomer_config_file:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# set up k8s cluster
- uses: ./
name: dummy cluster for test
with:
cluster_provider: kind
config_cluster: false
# customer config file
- name: verify
run: |
cp -r /tmp/kubeconfig /tmp
# config cluster
- uses: ./
name: config cluster
with:
cluster_provider: existing
prometheus_enable: true
tekton_enable: true
kubeconfig_root_dir: /tmp
- name: verify
run: |
./verify.sh cluster
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ You can now consume the action by referencing the main branch
prometheus_enable: true
tekton_enable: true
grafana_enable: true
kubeconfig_root_dir: /tmp/kubeconfig

- name: error handle
if: ${{ failure() }}
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ inputs:
tekton_enable:
description: enable tekton for kepler CI
required: false
kubeconfig_root_dir:
description: kubeconfig_root_dir for k8s cluster
required: false
kind_version:
description: kind version for kepler CI
required: false
Expand Down
3 changes: 2 additions & 1 deletion dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ async function configcluster() {
const prometheus_operator_version = getInputOrDefault('prometheus_operator_version', '');
const grafana_enable = getInputOrDefault('grafana_enable', '');
const tekton_enable = getInputOrDefault('tekton_enable', '');
let parameterExport = "export KUBECONFIG_ROOT_DIR=/tmp/kubeconfig"
const kubeconfig_root_dir = getInputOrDefault('kubeconfig_root_dir', '/tmp/kubeconfig');
let parameterExport = "export KUBECONFIG_ROOT_DIR="+kubeconfig_root_dir;
if (prometheus_enable.length !== 0) {
core.info(`use prometheus enable `+prometheus_enable);
parameterExport = parameterExport + " && export PROMETHEUS_ENABLE="+prometheus_enable;
Expand Down

0 comments on commit 6d30732

Please sign in to comment.