Skip to content

Use corev1.PullPolicy instead of string for EmbeddingServer ImagePullPolicy #5240

Merged
ChrisJBurns merged 3 commits into
stacklok:mainfrom
Sanskarzz:pullpolicy
May 11, 2026
Merged

Use corev1.PullPolicy instead of string for EmbeddingServer ImagePullPolicy #5240
ChrisJBurns merged 3 commits into
stacklok:mainfrom
Sanskarzz:pullpolicy

Conversation

@Sanskarzz
Copy link
Copy Markdown
Contributor

Summary

Updates EmbeddingServerSpec.ImagePullPolicy to use corev1.PullPolicy instead of a plain string.

This keeps the existing kubebuilder enum validation and JSON schema behavior unchanged, while giving Go code compile-time safety and consistency with upstream Kubernetes container image pull policy types.

Fixes #4616

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Dependency update
  • Documentation
  • Other (describe):

Test plan

  • Unit tests (task test)
  • E2E tests (task test-e2e)
  • Linting (task lint-fix)
  • Manual testing (describe below)

API Compatibility

  • This PR does not break the v1beta1 API, OR the api-break-allowed label is applied and the migration guidance is described above.

Changes

  • Change EmbeddingServerSpec.ImagePullPolicy from string to corev1.PullPolicy
  • Update GetImagePullPolicy() to return corev1.PullPolicy
  • Remove the controller-side cast when assigning the container image pull policy
  • Update unit and integration tests to use corev1.PullAlways, corev1.PullNever, and corev1.PullIfNotPresent

Signed-off-by: Sanskarzz <sanskar.gur@gmail.com>
@github-actions github-actions Bot added the size/XS Extra small PR: < 100 lines changed label May 10, 2026
ChrisJBurns
ChrisJBurns previously approved these changes May 10, 2026
@github-actions github-actions Bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels May 10, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.97%. Comparing base (6733a54) to head (ae19880).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5240   +/-   ##
=======================================
  Coverage   67.97%   67.97%           
=======================================
  Files         612      612           
  Lines       62723    62723           
=======================================
+ Hits        42633    42636    +3     
+ Misses      16908    16899    -9     
- Partials     3182     3188    +6     

☔ 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.

Signed-off-by: Sanskarzz <sanskar.gur@gmail.com>
@github-actions github-actions Bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels May 11, 2026
@ChrisJBurns ChrisJBurns merged commit 42f765c into stacklok:main May 11, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra small PR: < 100 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use corev1.PullPolicy instead of string for EmbeddingServer ImagePullPolicy

2 participants