Skip to content
This repository was archived by the owner on May 24, 2023. It is now read-only.

Commit 1238aaa

Browse files
committed
Add support to change image pull policy
1 parent 7c45d7d commit 1238aaa

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

pkg/apis/k8s/v1alpha1/nginxingresscontroller_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ type NginxStatus struct {
120120
// +kubebuilder:validation:Minimum=1023
121121
// +kubebuilder:validation:Maximum=65535
122122
// +kubebuilder:validation:Optional
123-
Port uint16 `json:"port"`
123+
Port uint16 `json:"port"` // TODO try omitempty
124124
// Whitelist IPv4 IP/CIDR blocks to allow access to NGINX stub_status or the NGINX Plus API.
125125
// Separate multiple IP/CIDR by commas. (default “127.0.0.1”)
126126
// +kubebuilder:validation:Optional

pkg/controller/nginxingresscontroller/daemonset.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ func hasDaemonSetChanged(ds *appsv1.DaemonSet, instance *k8sv1alpha1.NginxIngres
8787
return true
8888
}
8989

90+
if container.ImagePullPolicy != corev1.PullPolicy(instance.Spec.Image.PullPolicy) {
91+
return true
92+
}
93+
9094
return hasDifferentArguments(container, instance)
9195
}
9296

pkg/controller/nginxingresscontroller/deployment.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ func hasDeploymentChanged(dep *appsv1.Deployment, instance *k8sv1alpha1.NginxIng
9292
return true
9393
}
9494

95+
if container.ImagePullPolicy != corev1.PullPolicy(instance.Spec.Image.PullPolicy) {
96+
return true
97+
}
98+
9599
return hasDifferentArguments(container, instance)
96100
}
97101

0 commit comments

Comments
 (0)