Skip to content

Commit e92c17a

Browse files
authored
use fallback nodeslist if still pulling image #261 (#262)
1 parent 97e250c commit e92c17a

6 files changed

Lines changed: 26 additions & 7 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ OPERATOR_SDK_VERSION ?= v1.39.0
5252
# Image URL to use all building/pushing image targets
5353
DOCKER_HUB_NAME ?= quay.io/akyriako#$(shell docker info | sed '/Username:/!d;s/.* //')
5454
IMG_NAME ?= typesense-operator
55-
IMG_TAG ?= 0.4.1-rc.1
55+
IMG_TAG ?= 0.4.1-rc.2
5656
IMG ?= $(DOCKER_HUB_NAME)/$(IMG_NAME):$(IMG_TAG)
5757

5858
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ Join the conversation:
228228
## 📦 Project Status
229229
230230
TyKO is an **independently maintained** project (not affiliated with Typesense, Inc.).
231-
- Latest version: **0.4.1-rc.1**
231+
- Latest version: **0.4.1-rc.2**
232232
- Tested on: Kubernetes 1.35 (earliest 1.26), Typesense 30.0 (earliest 26.0)
233233
- Contributions welcome! See [FAQ](https://akyriako.github.io/typesense-operator-docs/docs/faq) and [Development](https://akyriako.github.io/typesense-operator-docs/docs/development)
234234

charts/typesense-operator/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ type: application
1414
# This is the chart version. This version number should be incremented each time you make changes
1515
# to the chart and its templates, including the app version.
1616
# Versions are expected to follow Semantic Versioning (https://semver.org/)
17-
version: 0.4.1-rc.1
17+
version: 0.4.1-rc.2
1818
# This is the version number of the application being deployed. This version number should be
1919
# incremented each time you make changes to the application. Versions are not expected to
2020
# follow Semantic Versioning. They should reflect the version the application is using.
2121
# It is recommended to use it with quotes.
22-
appVersion: "0.4.1-rc.1"
22+
appVersion: "0.4.1-rc.2"
2323

2424
maintainers:
2525
- name: Kyriakos Akriotis

charts/typesense-operator/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ controllerManager:
1212
- ALL
1313
image:
1414
repository: quay.io/akyriako/typesense-operator
15-
tag: 0.4.1-rc.1
15+
tag: 0.4.1-rc.2
1616
imagePullPolicy: IfNotPresent
1717
resources:
1818
limits:

config/manager/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ kind: Kustomization
55
images:
66
- name: controller
77
newName: quay.io/akyriako/typesense-operator
8-
newTag: 0.4.1-rc.1
8+
newTag: 0.4.1-rc.2

internal/controller/typesensecluster_configmap.go

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,17 +260,36 @@ func (r *TypesenseClusterReconciler) getNodes(ctx context.Context, ts *tsv1alpha
260260
}
261261

262262
for _, pod := range pods.Items {
263+
markAsScheduled := false
264+
// mark the pod as unscheduled if it's still pulling the image
265+
for _, cs := range append(pod.Status.InitContainerStatuses, pod.Status.ContainerStatuses...) {
266+
if cs.State.Waiting == nil {
267+
continue
268+
}
269+
270+
switch cs.State.Waiting.Reason {
271+
case "ContainerCreating", "ErrImagePull", "ImagePullBackOff":
272+
markAsScheduled = true
273+
break
274+
}
275+
}
276+
263277
if pod.Status.Phase != v1.PodPending {
264278
continue
265279
}
280+
266281
for _, cond := range pod.Status.Conditions {
267282
if cond.Type == v1.PodScheduled &&
268283
cond.Status == v1.ConditionFalse &&
269284
cond.Reason == v1.PodReasonUnschedulable {
270-
unscheduledPods++
285+
markAsScheduled = true
271286
break
272287
}
273288
}
289+
290+
if markAsScheduled {
291+
unscheduledPods++
292+
}
274293
}
275294

276295
targetReplicas = ptr.Deref[int32](sts.Spec.Replicas, 1)

0 commit comments

Comments
 (0)