Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion jenkins/pipelines/ci/tidb/tidb_ghpr_coverage.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
fsGroup: 1000
containers:
- name: golang
image: "hub.pingcap.net/wangweizhen/tidb_image:go12320241009"
image: "hub.pingcap.net/wangweizhen/tidb_image:go12520261210"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This image definition raises two concerns:

  1. Use of personal image: The image hub.pingcap.net/wangweizhen/tidb_image:go12520261210 is from a personal namespace (wangweizhen). For security and reliability, production CI pipelines should use images from an official, organization-managed repository. This ensures proper image provenance, security scanning, and availability.
  2. Hardcoded value: The image tag is hardcoded here and duplicated across many other files. This makes future updates difficult and error-prone.

I recommend moving the image to an official repository and defining the image name as a variable within the script to be reused. For example:

final TIDB_CI_IMAGE = "hub.pingcap.net/official-repo/tidb_image:go1.25-latest" // Example official image

final podYaml = """
  ...
  containers:
    - name: golang
      image: "${TIDB_CI_IMAGE}"
  ...
"""

tty: true
resources:
requests:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ spec:
fsGroup: 1000
containers:
- name: golang
image: "hub.pingcap.net/wangweizhen/tidb_image:go12320241009"
image: "hub.pingcap.net/wangweizhen/tidb_image:go12520261210"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This image definition has two issues:

  1. Use of personal image: The image is from a personal namespace (wangweizhen). For production CI, images should be sourced from an official, organization-managed repository to guarantee security, provenance, and availability.
  2. Hardcoded value: The image tag is hardcoded and duplicated across numerous configuration files. This makes maintenance difficult and error-prone.

To improve this, the image should be moved to an official repository. Furthermore, the image tag should be parameterized instead of being hardcoded. This can be achieved through templating (e.g., Helm, Kustomize) or by using environment variable substitution in the Jenkins pipeline that processes this YAML file.

securityContext:
privileged: true
tty: true
Expand Down
2 changes: 1 addition & 1 deletion pipelines/pingcap/tidb/latest/ghpr_build/pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ spec:
fsGroup: 1000
containers:
- name: golang
image: "hub.pingcap.net/wangweizhen/tidb_image:go12320241009"
image: "hub.pingcap.net/wangweizhen/tidb_image:go12520261210"
securityContext:
privileged: true
tty: true
Expand Down
2 changes: 1 addition & 1 deletion pipelines/pingcap/tidb/latest/pod-ghpr_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ spec:
fsGroup: 1000
containers:
- name: golang
image: "hub.pingcap.net/wangweizhen/tidb_image:go12320241009"
image: "hub.pingcap.net/wangweizhen/tidb_image:go12520261210"
securityContext:
privileged: true
tty: true
Expand Down
2 changes: 1 addition & 1 deletion pipelines/pingcap/tidb/latest/pod-ghpr_check2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ spec:
fsGroup: 1000
containers:
- name: golang
image: "hub.pingcap.net/wangweizhen/tidb_image:go12320241009"
image: "hub.pingcap.net/wangweizhen/tidb_image:go12520261210"
securityContext:
privileged: true
tty: true
Expand Down
2 changes: 1 addition & 1 deletion pipelines/pingcap/tidb/latest/pod-ghpr_unit_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
- name: golang
# TODO(wuhuizuo): using standard bazel build image to shrink the image size
# and keep image simple,so no need to refresh image to update basic bazel out data.
image: "hub.pingcap.net/wangweizhen/tidb_image:go12320241009"
image: "hub.pingcap.net/wangweizhen/tidb_image:go12520261210"
securityContext:
privileged: true
tty: true
Expand Down
2 changes: 1 addition & 1 deletion pipelines/pingcap/tidb/latest/pod-merged_unit_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
- name: golang
# TODO(wuhuizuo): using standard bazel build image to shrink the image size
# and keep image simple,so no need to refresh image to update basic bazel out data.
image: "hub.pingcap.net/wangweizhen/tidb_image:go12320241009"
image: "hub.pingcap.net/wangweizhen/tidb_image:go12520261210"
securityContext:
privileged: true
tty: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ spec:
fsGroup: 1000
containers:
- name: golang
image: "hub.pingcap.net/wangweizhen/tidb_image:go12320241009"
image: "hub.pingcap.net/wangweizhen/tidb_image:go12520261210"
securityContext:
privileged: true
tty: true
Expand Down
2 changes: 1 addition & 1 deletion pipelines/pingcap/tidb/latest/pull_build_next_gen/pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ spec:
fsGroup: 1000
containers:
- name: golang
image: "hub.pingcap.net/wangweizhen/tidb_image:go12320241009"
image: "hub.pingcap.net/wangweizhen/tidb_image:go12520261210"
securityContext:
privileged: true
tty: true
Expand Down
2 changes: 1 addition & 1 deletion pipelines/pingcap/tidb/latest/pull_check_next_gen/pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ spec:
fsGroup: 1000
containers:
- name: golang
image: "hub.pingcap.net/wangweizhen/tidb_image:go12320241009"
image: "hub.pingcap.net/wangweizhen/tidb_image:go12520261210"
securityContext:
privileged: true
tty: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ spec:
fsGroup: 1000
containers:
- name: golang
image: "hub.pingcap.net/wangweizhen/tidb_image:go12320241009"
image: "hub.pingcap.net/wangweizhen/tidb_image:go12520261210"
securityContext:
privileged: true
tty: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
- name: golang
# TODO(wuhuizuo): using standard bazel build image to shrink the image size
# and keep image simple,so no need to refresh image to update basic bazel out data.
image: "hub.pingcap.net/wangweizhen/tidb_image:go12320241009"
image: "hub.pingcap.net/wangweizhen/tidb_image:go12520261210"
securityContext:
privileged: true
tty: true
Expand Down
2 changes: 1 addition & 1 deletion pipelines/pingcap/tidb/release-8.5/pod-pull_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ spec:
fsGroup: 1000
containers:
- name: golang
image: "hub.pingcap.net/wangweizhen/tidb_image:go12320241009"
image: "hub.pingcap.net/wangweizhen/tidb_image:go12520261210"
securityContext:
privileged: true
tty: true
Expand Down
2 changes: 1 addition & 1 deletion pipelines/pingcap/tidb/release-8.5/pod-pull_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ spec:
fsGroup: 1000
containers:
- name: golang
image: "hub.pingcap.net/wangweizhen/tidb_image:go12320241009"
image: "hub.pingcap.net/wangweizhen/tidb_image:go12520261210"
securityContext:
privileged: true
tty: true
Expand Down
2 changes: 1 addition & 1 deletion pipelines/pingcap/tidb/release-8.5/pod-pull_check2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ spec:
fsGroup: 1000
containers:
- name: golang
image: "hub.pingcap.net/wangweizhen/tidb_image:go12320241009"
image: "hub.pingcap.net/wangweizhen/tidb_image:go12520261210"
securityContext:
privileged: true
tty: true
Expand Down
2 changes: 1 addition & 1 deletion pipelines/pingcap/tidb/release-8.5/pod-pull_unit_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
- name: golang
# TODO(wuhuizuo): using standard bazel build image to shrink the image size
# and keep image simple,so no need to refresh image to update basic bazel out data.
image: "hub.pingcap.net/wangweizhen/tidb_image:go12320241009"
image: "hub.pingcap.net/wangweizhen/tidb_image:go12520261210"
securityContext:
privileged: true
tty: true
Expand Down