Repository: spidernet-io/spiderpool
Pull request #598 (2022-08-21 04:31:47)

add global.imageRegistry to chart values
Signed-off-by: weizhou.lan@daocloud.io <weizhou.lan@daocloud.io>


sonarcloud[bot]: Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=spidernet-io_spiderpool&pullRequest=598)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=598) No Coverage information  
[![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=598&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=598&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=spidernet-io_spiderpool&pullRequest=598)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=598) No Coverage information  
[![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=598&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=598&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=spidernet-io_spiderpool&pullRequest=598)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=598) No Coverage information  
[![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=598&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=598&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=spidernet-io_spiderpool&pullRequest=598)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=598&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=598) No Coverage information  
[![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=598&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=598&metric=new_duplicated_lines_density&view=list)



Patch:
diff --git a/.github/workflows/update-chart-readme.yml b/.github/workflows/update-chart-readme.yml
new file mode 100644
index 000000000..9e17c3e17
--- /dev/null
+++ b/.github/workflows/update-chart-readme.yml
@@ -0,0 +1,72 @@
+name: 'Update Chart Readme'
+
+on:
+  pull_request_target:
+    branches:
+      - main
+    paths:
+      - 'charts/*/values.yaml'
+
+jobs:
+  update-readme-metadata:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout bitnami-labs/readme-generator-for-helm
+        uses: actions/checkout@v2
+        with:
+          repository: 'bitnami-labs/readme-generator-for-helm'
+          ref: '1af12881436b1f58f0643d733fd5196b4a11caa8'
+          path: readme-generator-for-helm
+
+      - name: Cache node modules
+        uses: actions/cache@v2
+        env:
+          cache-name: cache-node-modules
+        with:
+          # npm cache files are stored in `~/.npm` on Linux/macOS
+          path: ~/.npm
+          key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('readme-generator-for-helm/package-lock.json') }}
+          restore-keys: |
+            ${{ runner.os }}-build-${{ env.cache-name }}-
+
+      - name: Install readme-generator-for-helm dependencies
+        run: |
+          cd readme-generator-for-helm
+          npm install
+
+      - name: Checkout Code
+        uses: actions/checkout@v2
+        with:
+          ref: ${{github.event.pull_request.head.ref}}
+          path: thisPorject
+
+      - name: Execute readme-generator-for-helm
+        id: execute
+        run: |
+          # Using the Github API to detect the files changed as git merge-base stops working when the branch is behind
+          # and jitterbit/get-changed-files does not support pull_request_target
+          URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files"
+          files_changed_data=$(curl -s --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' -X GET -G "$URL")
+          echo "files_changed_data: $files_changed_data"
+          files_changed="$(echo $files_changed_data | jq -r '.[] | .filename')"
+          echo "files_changed: $files_changed"
+          # Adding || true to avoid "Process exited with code 1" errors
+          charts_changed="$(echo "$files_changed" | grep -E -o "([^/]*)/values.yaml" | xargs dirname | sort | uniq | awk -F'/' '{print $1}' | tr '\n' ' ' || true)"
+          #--------------------
+          for ITEM in $charts_changed ; do
+            if [ -f "charts/${ITEM}/values.yaml" ] && grep "charts/${ITEM}/values.yaml" <<< "$files_changed" &>/dev/null ; then
+                echo "------ Updating README.md for ${ITEM}"
+                readme-generator-for-helm/bin/index.js --values "thisPorject/charts/${ITEM}/values.yaml" --readme "thisPorject/charts/${ITEM}/README.md" --schema "/tmp/schema.json"
+                cat thisPorject/charts/${ITEM}/README.md
+            fi
+          done
+
+      - name: Push changes
+        run: |
+          # Push all the changes
+          cd thisPorject
+          if git status -s | grep README.md; then
+            git config user.name  "weizhoublue"
+            git config user.email "weizhoublue@daocloud.io"
+            git add . && git commit -am "Update README.md with readme-generator-for-helm" --signoff && git push
+          fi
diff --git a/CODEOWNERS b/CODEOWNERS
index 483be6143..57d7d0ef8 100644
--- a/CODEOWNERS
+++ b/CODEOWNERS
@@ -1,4 +1,4 @@
-*  @weizhouBlue @lou-lan
+*  @weizhoublue
 /.github/ @weizhoublue
 /api/ @weizhoublue @Icarus9913 @iiiceoo
 /charts/ @weizhoublue
diff --git a/charts/spiderpool/templates/_helpers.tpl b/charts/spiderpool/templates/_helpers.tpl
index 34bde7989..eda8391e6 100644
--- a/charts/spiderpool/templates/_helpers.tpl
+++ b/charts/spiderpool/templates/_helpers.tpl
@@ -124,3 +124,44 @@ Return the appropriate apiVersion for RBAC resources.
 {{- end -}}
 {{- end -}}
 
+{{/*
+return the spiderpoolAgent image
+*/}}
+{{- define "spiderpool.spiderpoolAgent.image" -}}
+{{- $registryName := .Values.spiderpoolAgent.image.registry -}}
+{{- $repositoryName := .Values.spiderpoolAgent.image.repository -}}
+{{- if .Values.global.imageRegistry }}
+    {{- printf "%s/%s" .Values.global.imageRegistry $repositoryName -}}
+{{ else if $registryName }}
+    {{- printf "%s/%s" $registryName $repositoryName -}}
+{{- else -}}
+    {{- printf "%s" $repositoryName -}}
+{{- end -}}
+{{- if .Values.spiderpoolAgent.image.digest }}
+    {{- print "@" .Values.spiderpoolAgent.image.digest -}}
+{{- else -}}
+    {{- $tag := default .Chart.AppVersion .Values.spiderpoolAgent.image.tag -}}
+    {{- printf ":%s" $tag -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+return the spiderpoolController image
+*/}}
+{{- define "spiderpool.spiderpoolController.image" -}}
+{{- $registryName := .Values.spiderpoolController.image.registry -}}
+{{- $repositoryName := .Values.spiderpoolController.image.repository -}}
+{{- if .Values.global.imageRegistry }}
+    {{- printf "%s/%s" .Values.global.imageRegistry $repositoryName -}}
+{{ else if $registryName }}
+    {{- printf "%s/%s" $registryName $repositoryName -}}
+{{- else -}}
+    {{- printf "%s" $repositoryName -}}
+{{- end -}}
+{{- if .Values.spiderpoolController.image.digest }}
+    {{- print "@" .Values.spiderpoolController.image.digest -}}
+{{- else -}}
+    {{- $tag := default .Chart.AppVersion .Values.spiderpoolController.image.tag -}}
+    {{- printf ":%s" $tag -}}
+{{- end -}}
+{{- end -}}
\ No newline at end of file
diff --git a/charts/spiderpool/templates/daemonset.yaml b/charts/spiderpool/templates/daemonset.yaml
index 8267f5ad5..28cf993d9 100644
--- a/charts/spiderpool/templates/daemonset.yaml
+++ b/charts/spiderpool/templates/daemonset.yaml
@@ -78,11 +78,7 @@ spec:
       {{- end }}
       containers:
       - name: {{ .Values.spiderpoolAgent.name | trunc 63 | trimSuffix "-" }}
-        {{- if .Values.spiderpoolAgent.image.digest }}
-        image: "{{ .Values.spiderpoolAgent.image.repository }}@{{ .Values.spiderpoolAgent.image.digest }}"
-        {{- else }}
-        image: "{{ .Values.spiderpoolAgent.image.repository }}:{{ default .Chart.AppVersion .Values.spiderpoolAgent.image.tag }}"
-        {{- end }}
+        image: {{ include "spiderpool.spiderpoolAgent.image" . | quote }}
         imagePullPolicy: {{ .Values.spiderpoolAgent.image.pullPolicy }}
         command:
         - {{ .Values.spiderpoolAgent.binName }}
diff --git a/charts/spiderpool/templates/deployment.yaml b/charts/spiderpool/templates/deployment.yaml
index fac4e10f9..ac3bb8976 100644
--- a/charts/spiderpool/templates/deployment.yaml
+++ b/charts/spiderpool/templates/deployment.yaml
@@ -74,11 +74,7 @@ spec:
       {{- end }}
       containers:
       - name: {{ .Values.spiderpoolController.name | trunc 63 | trimSuffix "-" }}
-        {{- if .Values.spiderpoolController.image.digest }}
-        image: "{{ .Values.spiderpoolController.image.repository }}@{{ .Values.spiderpoolController.image.digest }}"
-        {{- else }}
-        image: "{{ .Values.spiderpoolController.image.repository }}:{{ default .Chart.AppVersion .Values.spiderpoolController.image.tag }}"
-        {{- end }}
+        image: {{ include "spiderpool.spiderpoolController.image" . | quote }}
         imagePullPolicy: {{ .Values.spiderpoolController.image.pullPolicy }}
         command:
         - {{ .Values.spiderpoolController.binName }}
diff --git a/charts/spiderpool/values.yaml b/charts/spiderpool/values.yaml
index 9a455d38f..838cf8ca2 100644
--- a/charts/spiderpool/values.yaml
+++ b/charts/spiderpool/values.yaml
@@ -2,8 +2,17 @@
 # This is a YAML-formatted file.
 # Declare variables to be passed into your templates.
 
+## @section Global parameters
+##
+global:
+  ## @param global.imageRegistry Global Docker image registry
+  imageRegistry: ""
+
+## @section ipFamily parameters
 ipFamily:
+  ## @param ipFamily.enableIPv4 enable ipv4
   enableIPv4: true
+  ## @param ipFamily.enableIPv4 enable ipv6
   enableIPv6: true
 
 rbac:
@@ -64,7 +73,8 @@ spiderpoolAgent:
   binName: "spiderpool-agent"
 
   image:
-    repository: ghcr.io/spidernet-io/spiderpool/spiderpool-agent
+    registry: ghcr.io
+    repository: spidernet-io/spiderpool/spiderpool-agent
     pullPolicy: IfNotPresent
     # take preference over tag
     digest: ""
@@ -234,7 +244,8 @@ spiderpoolController:
   nameOverride: ""
 
   image:
-    repository: ghcr.io/spidernet-io/spiderpool/spiderpool-controller
+    registry: ghcr.io
+    repository: spidernet-io/spiderpool/spiderpool-controller
     pullPolicy: IfNotPresent
     # take preference over tag
     digest: ""
diff --git a/cmd/spiderpool/cmd/cni_types.go b/cmd/spiderpool/cmd/cni_types.go
index f2a1427e3..25e1bd8ab 100644
--- a/cmd/spiderpool/cmd/cni_types.go
+++ b/cmd/spiderpool/cmd/cni_types.go
@@ -1,5 +1,5 @@
-// Copyright 2022 Authors of spidernet-io
 // SPDX-License-Identifier: Apache-2.0
+// Copyright Authors of Cilium
 
 package cmd
 
diff --git a/cmd/spiderpool/cmd/command_add.go b/cmd/spiderpool/cmd/command_add.go
index 047abdfc7..b13e34446 100644
--- a/cmd/spiderpool/cmd/command_add.go
+++ b/cmd/spiderpool/cmd/command_add.go
@@ -21,6 +21,7 @@ import (
 	"github.com/spidernet-io/spiderpool/cmd/spiderpool-agent/cmd"
 	"github.com/spidernet-io/spiderpool/pkg/constant"
 	spiderpoolip "github.com/spidernet-io/spiderpool/pkg/ip"
+	"github.com/spidernet-io/spiderpool/pkg/logutils"
 )
 
 var (
@@ -56,13 +57,13 @@ func CmdAdd(args *skel.CmdArgs) (err error) {
 		return fmt.Errorf("Load network config failed: %v", err)
 	}
 
-	logger, err = setupFileLogging(conf)
+	err = setupFileLogging(conf)
 	if nil != err {
 		return fmt.Errorf("Unable to setup logging: %w", err)
 	}
 
 	// new cmdAdd logger
-	logger = logger.Named(BinNamePlugin)
+	logger = logutils.LoggerFile.Named(BinNamePlugin)
 	logger.Sugar().Debugf("Processing CNI ADD request %#v", args)
 	logger.Sugar().Debugf("CNI ADD NetConf: %#v", conf)
 
diff --git a/cmd/spiderpool/cmd/command_delete.go b/cmd/spiderpool/cmd/command_delete.go
index 27695e346..d74fd06c1 100644
--- a/cmd/spiderpool/cmd/command_delete.go
+++ b/cmd/spiderpool/cmd/command_delete.go
@@ -12,6 +12,7 @@ import (
 	"github.com/spidernet-io/spiderpool/api/v1/agent/client/daemonset"
 	"github.com/spidernet-io/spiderpool/api/v1/agent/models"
 	"github.com/spidernet-io/spiderpool/cmd/spiderpool-agent/cmd"
+	"github.com/spidernet-io/spiderpool/pkg/logutils"
 	"go.uber.org/zap"
 )
 
@@ -44,13 +45,13 @@ func CmdDel(args *skel.CmdArgs) (err error) {
 		return fmt.Errorf("Load network config failed: %v", err)
 	}
 
-	logger, err = setupFileLogging(conf)
+	err = setupFileLogging(conf)
 	if nil != err {
 		return fmt.Errorf("Unable to setup logging: %w", err)
 	}
 
 	// new cmdDel logger
-	logger = logger.Named(BinNamePlugin)
+	logger = logutils.LoggerFile.Named(BinNamePlugin)
 	logger.Sugar().Debugf("Processing CNI DEL request %#v", args)
 	logger.Sugar().Debugf("CNI DEL NetConf: %#v", conf)
 
diff --git a/cmd/spiderpool/cmd/utils.go b/cmd/spiderpool/cmd/utils.go
index 7055f2917..f128b886e 100644
--- a/cmd/spiderpool/cmd/utils.go
+++ b/cmd/spiderpool/cmd/utils.go
@@ -6,16 +6,21 @@ package cmd
 import (
 	"fmt"
 	"github.com/spidernet-io/spiderpool/pkg/logutils"
-	"go.uber.org/zap"
 )
 
 // Set up logging for spiderpool plugin
-func setupFileLogging(conf *NetConf) (*zap.Logger, error) {
+func setupFileLogging(conf *NetConf) error {
+
 	v := logutils.ConvertLogLevel(conf.IPAM.LogLevel)
 	if v == nil {
-		return nil, fmt.Errorf("wrong log level %s ", conf.IPAM.LogLevel)
+		return fmt.Errorf("wrong log level %s ", conf.IPAM.LogLevel)
 	}
 
-	return logutils.InitFileLogger(*v, conf.IPAM.LogFilePath,
+	err := logutils.InitFileLogger(*v, conf.IPAM.LogFilePath,
 		conf.IPAM.LogFileMaxSize, conf.IPAM.LogFileMaxAge, conf.IPAM.LogFileMaxCount)
+	if nil != err {
+		return err
+	}
+
+	return nil
 }
diff --git a/docs/concepts/config.md b/docs/concepts/config.md
index cc7188406..01fb2b445 100644
--- a/docs/concepts/config.md
+++ b/docs/concepts/config.md
@@ -19,7 +19,7 @@ There is an example of IPAM configuration.
             "mtu":1500,
             "ipam":{
                 "type":"spiderpool",
-                "log_file_path":"/var/log/spidernet/spiderpool.log",
+                "log_file_path":"/var/run/spidernet/spiderpool.log",
                 "log_file_max_size":"100M",
                 "log_file_max_age":"30d",
                 "log_file_max_count":7,
@@ -30,7 +30,7 @@ There is an example of IPAM configuration.
 }
 ```
 
-- `log_file_path` (string, optional): Path to log file  of IPAM plugin, default to `"/var/log/spidernet/spiderpool.log"`.
+- `log_file_path` (string, optional): Path to log file  of IPAM plugin, default to `"/var/run/spidernet/spiderpool.log"`.
 - `log_file_max_size` (string, optional): Max size of each rotated file, default to `"100M"`.
 - `log_file_max_age` (string, optional): Max age of each rotated file, default to `"30d"`.
 - `log_file_max_count` (string, optional): Max number of rotated file, default to `"7"`.
diff --git a/pkg/logutils/log.go b/pkg/logutils/log.go
index bb70c4655..301743a2a 100644
--- a/pkg/logutils/log.go
+++ b/pkg/logutils/log.go
@@ -8,19 +8,20 @@ import (
 	"fmt"
 	"os"
 	"path/filepath"
+
 	"strings"
 
+	"github.com/spidernet-io/spiderpool/pkg/constant"
 	"go.uber.org/zap"
 	"go.uber.org/zap/zapcore"
 	"gopkg.in/natefinch/lumberjack.v2"
-
-	"github.com/spidernet-io/spiderpool/pkg/constant"
 )
 
 // Pre-define log instance with default info level.
 var (
 	Logger       *zap.Logger
 	LoggerStderr *zap.Logger
+	LoggerFile   *zap.Logger
 )
 
 // LogFormat is a type help you choose the log output format, which supports "json" and "console".
@@ -40,7 +41,7 @@ type FileOutputOption struct {
 }
 
 const (
-	DefaultIPAMPluginLogFilePath = "/var/log/spidernet/spiderpool.log"
+	DefaultLogFilePath = "/tmp/cni.log"
 	// MaxSize    = 100 // MB
 	DefaultLogFileMaxSize int = 100
 	// MaxAge     = 30 // days (no limit)
@@ -100,6 +101,12 @@ func init() {
 	if nil != err {
 		panic(err)
 	}
+
+	err = InitFileLogger(InfoLevel, DefaultLogFilePath, DefaultLogFileMaxSize, DefaultLogFileMaxAge, DefaultLogFileMaxBackups)
+	if nil != err {
+		panic(err)
+	}
+
 }
 
 // NewLoggerWithOption provides the ability to custom log with options.
@@ -125,7 +132,7 @@ func NewLoggerWithOption(format LogFormat, outputMode LogMode, fileOutputOption
 		fileLoggerConf.MaxBackups = fileOutputOption.MaxBackups
 
 		if fileOutputOption.Filename == "" {
-			fileLoggerConf.Filename = DefaultIPAMPluginLogFilePath
+			fileLoggerConf.Filename = DefaultLogFilePath
 		}
 		if fileOutputOption.MaxSize < 0 {
 			fileLoggerConf.MaxSize = DefaultLogFileMaxSize
@@ -156,7 +163,7 @@ func NewLoggerWithOption(format LogFormat, outputMode LogMode, fileOutputOption
 	case OUTPUT_STDERR | OUTPUT_FILE:
 		ws = zapcore.NewMultiWriteSyncer(zapcore.AddSync(os.Stderr), zapcore.AddSync(&fileLoggerConf))
 	case OUTPUT_STDOUT | OUTPUT_STDERR:
-		return nil, fmt.Errorf("log output mode can't set to stdout with stderr together")
+		return nil, fmt.Errorf("log output mode can't set to stdout with stderr together.")
 	default:
 		ws = zapcore.AddSync(os.Stdout)
 	}
@@ -221,19 +228,19 @@ func InitStderrLogger(logLevel LogLevel) error {
 
 // InitFileLogger sets LoggerFile configuration for 'file output' usage.
 // fileMaxSize unit MB, fileMaxAge unit days, fileMaxBackups unit counts.
-func InitFileLogger(logLevel LogLevel, filePath string, fileMaxSize, fileMaxAge, fileMaxBackups int) (*zap.Logger, error) {
+func InitFileLogger(logLevel LogLevel, filePath string, fileMaxSize, fileMaxAge, fileMaxBackups int) error {
 	fileLoggerConf := FileOutputOption{
 		Filename:   filePath,
 		MaxSize:    fileMaxSize,
 		MaxAge:     fileMaxAge,
 		MaxBackups: fileMaxBackups,
 	}
-	logFile, err := NewLoggerWithOption(JsonLogFormat, OUTPUT_FILE, &fileLoggerConf, true, true, true, logLevel)
+	l, err := NewLoggerWithOption(JsonLogFormat, OUTPUT_FILE, &fileLoggerConf, true, true, true, logLevel)
 	if nil != err {
-		return nil, fmt.Errorf("Failed to init logger for file: %v", err)
+		return fmt.Errorf("Failed to init logger for file: %v", err)
 	}
-
-	return logFile, nil
+	LoggerFile = l
+	return nil
 }
 
 // loggerKey is how we find Loggers in a context.Context.


Test patch:
diff --git a/pkg/logutils/log_test.go b/pkg/logutils/log_test.go
index dfad9a012..4be3d2fb9 100644
--- a/pkg/logutils/log_test.go
+++ b/pkg/logutils/log_test.go
@@ -13,10 +13,8 @@ import (
 	"go.uber.org/zap"
 )
 
-const tmpLogFilePath = "/tmp/cni.log"
-
 var _ = Describe("Log", Label("unitest", "log_test"), func() {
-	Context("check log with stdout/stderr/file", func() {
+	Context("When on a nice day", func() {
 		It("log with stdout", func() {
 			err := logutils.InitStdoutLogger(logutils.InfoLevel)
 			Expect(err).NotTo(HaveOccurred())
@@ -26,9 +24,9 @@ var _ = Describe("Log", Label("unitest", "log_test"), func() {
 		})
 
 		It("log for file output mode", func() {
-			loggerFile, err := logutils.InitFileLogger(logutils.InfoLevel, tmpLogFilePath, logutils.DefaultLogFileMaxSize, logutils.DefaultLogFileMaxAge, logutils.DefaultLogFileMaxBackups)
+			err := logutils.InitFileLogger(logutils.InfoLevel, logutils.DefaultLogFilePath, logutils.DefaultLogFileMaxSize, logutils.DefaultLogFileMaxAge, logutils.DefaultLogFileMaxBackups)
 			Expect(err).NotTo(HaveOccurred())
-			loggerFile.Info("This is log test.", zap.Int("log mode", 1))
+			logutils.LoggerFile.Info("This is log test.", zap.Int("log mode", 1))
 		})
 
 		It("log with stderr", func() {
diff --git a/test/Makefile b/test/Makefile
index b04dae305..7c2e47e97 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -177,8 +177,10 @@ setup_spiderpool:
 		echo "setup spiderpool with image $(SPIDERPOOL_AGENT_IMAGE_NAME):$(TEST_IMAGE_TAG) and $(SPIDERPOOL_CONTROLLER_IMAGE_NAME):$(TEST_IMAGE_TAG) " ; \
 		helm install $(RELEASE_NAME) $(ROOT_DIR)/charts/spiderpool --wait --debug \
 			-n $(RELEASE_NAMESPACE) $${HELM_OPTION} \
+			--set spiderpoolAgent.image.registry="" \
 			--set spiderpoolAgent.image.repository=$(SPIDERPOOL_AGENT_IMAGE_NAME) \
 			--set spiderpoolAgent.image.tag=$(TEST_IMAGE_TAG) \
+			--set spiderpoolController.image.registry="" \
 			--set spiderpoolController.image.repository=$(SPIDERPOOL_CONTROLLER_IMAGE_NAME) \
 			--set spiderpoolController.image.tag=$(TEST_IMAGE_TAG) \
 			--kubeconfig $(E2E_KUBECONFIG)