Skip to content

Commit

Permalink
chore: fix replicaset
Browse files Browse the repository at this point in the history
  • Loading branch information
moshloop committed Nov 20, 2024
1 parent 2a4791b commit 8598489
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/health/health_replicaset.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func getAppsv1ReplicaSetHealth(rs *appsv1.ReplicaSet, obj *unstructured.Unstruct
if hr.Health != HealthUnhealthy && failCondition != nil && failCondition.Status == corev1.ConditionTrue {
hr.Ready = true
hr.Health = HealthUnhealthy
hr.Status = HealthStatusCode(HumanCase(failCondition.Reason))
hr.Message = failCondition.Message
}
return hr, nil
Expand Down
69 changes: 69 additions & 0 deletions pkg/health/testdata/Kubernetes/ReplicaSet/failed-create.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
apiVersion: apps/v1
kind: ReplicaSet
metadata:
uid: 31a52623-9a34-48b0-875d-4bed46c58f83
name: karina-c7585bd87
labels:
control-plane: karina-operator
pod-template-hash: c7585bd87
namespace: platform-system
annotations:
expected-status: Failed Create
expected-health: unhealthy
deployment.kubernetes.io/revision: "1"
deployment.kubernetes.io/max-replicas: "2"
deployment.kubernetes.io/desired-replicas: "1"
ownerReferences:
- uid: 03e7bf66-2bbb-4ea9-8bdf-0cf7bc6ba8c1
kind: Deployment
name: karina
apiVersion: apps/v1
controller: true
blockOwnerDeletion: true
creationTimestamp: 2023-05-10T08:11:03Z
spec:
replicas: 1
selector:
matchLabels:
control-plane: karina-operator
pod-template-hash: c7585bd87
template:
spec:
dnsPolicy: ClusterFirst
containers:
- args:
- operator
- --enable-leader-election
- --log-level=debug
name: karina-operator
image: docker.io/flanksource/karina:v0.51.1
command:
- /bin/karina
resources:
limits:
cpu: 500m
memory: 256Mi
requests:
cpu: 100m
memory: 128Mi
imagePullPolicy: IfNotPresent
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
restartPolicy: Always
schedulerName: default-scheduler
serviceAccount: karina
securityContext: {}
serviceAccountName: karina
terminationGracePeriodSeconds: 30
metadata:
labels:
control-plane: karina-operator
pod-template-hash: c7585bd87
status:
replicas: 0
conditions:
- type: ReplicaFailure
reason: FailedCreate
status: "True"
message: 'pods "karina-c7585bd87-" is forbidden: error looking up service
account platform-system/karina: serviceaccount "karina" not found'

0 comments on commit 8598489

Please sign in to comment.