Skip to content

fix(component): honor image pull policy for kbagent#10253

Open
weicao wants to merge 1 commit into
mainfrom
lily/kbagent-pull-policy
Open

fix(component): honor image pull policy for kbagent#10253
weicao wants to merge 1 commit into
mainfrom
lily/kbagent-pull-policy

Conversation

@weicao
Copy link
Copy Markdown
Contributor

@weicao weicao commented May 18, 2026

Summary

  • make component kbagent and init-kbagent honor KUBEBLOCKS_IMAGE_PULL_POLICY
  • keep the previous default by falling back to IfNotPresent when the config is empty
  • add focused unit coverage for the main kbagent container and the init-kbagent path

Scope

This only changes the component controller kbagent injection path. Existing DataProtection, custom Ops, and other job paths that already read KBImagePullPolicy are unchanged.

The empty-config fallback to IfNotPresent is deliberate backward compatibility with the previous hardcoded component kbagent behavior. It differs from some job paths that leave an empty pull policy for Kubernetes defaults, but avoids changing component kbagent behavior when KUBEBLOCKS_IMAGE_PULL_POLICY is not set.

Validation

  • go test ./pkg/controller/component -run TestBuildKBAgentContainerUsesConfiguredImagePullPolicy -count=1
  • go test -c ./pkg/controller/component
  • git diff --check

Local Ginkgo/envtest execution is not counted as passed because this machine is missing /usr/local/kubebuilder/bin/etcd; CI should provide that coverage.

Context

MariaDB T6 validation hit a repeated kbagent tools image tag-alias trap while the KubeBlocks deployment had KUBEBLOCKS_IMAGE_PULL_POLICY=Never. The controller component path still injected kbagent with hardcoded IfNotPresent, so pod image resolution could re-enter the registry path.

@weicao weicao requested review from a team and leon-ape as code owners May 18, 2026 20:04
@github-actions github-actions Bot added the size/L Denotes a PR that changes 100-499 lines. label May 18, 2026
@apecloud-bot
Copy link
Copy Markdown
Collaborator

Auto Cherry-pick Instructions

Usage:
  - /nopick: Not auto cherry-pick when PR merged.
  - /pick: release-x.x [release-x.x]: Auto cherry-pick to the specified branch when PR merged.

Example:
  - /nopick
  - /pick release-1.1

@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.49%. Comparing base (a375e10) to head (6c7af05).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10253      +/-   ##
==========================================
+ Coverage   52.42%   52.49%   +0.06%     
==========================================
  Files         533      533              
  Lines       61230    61237       +7     
==========================================
+ Hits        32099    32144      +45     
+ Misses      25872    25837      -35     
+ Partials     3259     3256       -3     
Flag Coverage Δ
unittests 52.49% <100.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes 100-499 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants