Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add imagePullPolicy support to spinApp spec #197

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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: 2 additions & 0 deletions api/v1alpha1/spinapp_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ type SpinAppSpec struct {
// ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling the image.
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`

// ImagePullPolicy is the policy for pulling the image.
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
// Checks defines health checks that should be used by Kubernetes to monitor the application.
Comment on lines +44 to 45
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit

Suggested change
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
// Checks defines health checks that should be used by Kubernetes to monitor the application.
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
// Checks defines health checks that should be used by Kubernetes to monitor the application.

Checks HealthChecks `json:"checks,omitempty"`

Expand Down
3 changes: 3 additions & 0 deletions config/crd/bases/core.spinoperator.dev_spinapps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ spec:
image:
description: Image is the source for this app.
type: string
imagePullPolicy:
description: ImagePullPolicy is the policy for pulling the image.
type: string
imagePullSecrets:
description: ImagePullSecrets is a list of references to secrets in
the same namespace to use for pulling the image.
Expand Down
7 changes: 4 additions & 3 deletions internal/controller/spinapp_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,10 @@ func constructDeployment(ctx context.Context, app *spinv1alpha1.SpinApp, config
RuntimeClassName: &config.RuntimeClassName,
Containers: []corev1.Container{
{
Name: app.Name,
Image: app.Spec.Image,
Command: []string{"/"},
Name: app.Name,
Image: app.Spec.Image,
ImagePullPolicy: app.Spec.ImagePullPolicy,
Command: []string{"/"},
Ports: []corev1.ContainerPort{{
Name: spinapp.HTTPPortName,
ContainerPort: spinapp.DefaultHTTPPort,
Expand Down
Loading