diff --git a/api/autoscaling/v2/horizontalpodautoscaler_webhook_test.go b/api/autoscaling/v2/horizontalpodautoscaler_webhook_test.go index 72d86398..5d9cf2ac 100644 --- a/api/autoscaling/v2/horizontalpodautoscaler_webhook_test.go +++ b/api/autoscaling/v2/horizontalpodautoscaler_webhook_test.go @@ -50,15 +50,18 @@ func mutateTest(before, after, torotise string) { err = yaml.NewYAMLOrJSONDecoder(bytes.NewReader(y), 4096).Decode(tor) status := tor.Status Expect(err).NotTo(HaveOccurred()) - err = k8sClient.Create(ctx, tor) + err = k8sClient.Create(ctx, tor.DeepCopy()) Expect(err).NotTo(HaveOccurred()) defer func() { err = k8sClient.Delete(ctx, tor) Expect(err).NotTo(HaveOccurred()) }() + + err = k8sClient.Get(ctx, types.NamespacedName{Name: tor.GetName(), Namespace: tor.GetNamespace()}, tor) + Expect(err).NotTo(HaveOccurred()) tor.Status = status - //nolint:errcheck - k8sClient.Status().Update(ctx, tor) + err = k8sClient.Status().Update(ctx, tor) + Expect(err).NotTo(HaveOccurred()) y, err = os.ReadFile(before) Expect(err).NotTo(HaveOccurred()) @@ -87,9 +90,6 @@ func mutateTest(before, after, torotise string) { var _ = Describe("v2.HPA Webhook", func() { Context("mutating", func() { - It("nothing to do", func() { - mutateTest(filepath.Join("testdata", "mutating", "nothing-to-do", "before.yaml"), filepath.Join("testdata", "mutating", "nothing-to-do", "after.yaml"), filepath.Join("testdata", "mutating", "nothing-to-do", "tortoise.yaml")) - }) It("HPA is mutated based on the recommendation", func() { mutateTest(filepath.Join("testdata", "mutating", "mutate-by-recommendations", "before.yaml"), filepath.Join("testdata", "mutating", "mutate-by-recommendations", "after.yaml"), filepath.Join("testdata", "mutating", "mutate-by-recommendations", "tortoise.yaml")) }) diff --git a/api/autoscaling/v2/testdata/mutating/has-annotation-but-invalid1/tortoise.yaml b/api/autoscaling/v2/testdata/mutating/has-annotation-but-invalid1/tortoise.yaml index f7a45a80..e342e242 100644 --- a/api/autoscaling/v2/testdata/mutating/has-annotation-but-invalid1/tortoise.yaml +++ b/api/autoscaling/v2/testdata/mutating/has-annotation-but-invalid1/tortoise.yaml @@ -22,6 +22,15 @@ spec: memory: Vertical status: tortoisePhase: Working + containerResourcePhases: + - containerName: "nginx" + resourcePhases: + cpu: Working + memory: Working + - containerName: "istio-proxy" + resourcePhases: + cpu: Working + memory: Working targets: deployment: sample horizontalPodAutoscaler: sample diff --git a/api/autoscaling/v2/testdata/mutating/has-annotation-but-invalid2/tortoise.yaml b/api/autoscaling/v2/testdata/mutating/has-annotation-but-invalid2/tortoise.yaml index 67276304..e7cbfd74 100644 --- a/api/autoscaling/v2/testdata/mutating/has-annotation-but-invalid2/tortoise.yaml +++ b/api/autoscaling/v2/testdata/mutating/has-annotation-but-invalid2/tortoise.yaml @@ -22,6 +22,15 @@ spec: memory: Vertical status: tortoisePhase: Working + containerResourcePhases: + - containerName: "nginx" + resourcePhases: + cpu: Working + memory: Working + - containerName: "istio-proxy" + resourcePhases: + cpu: Working + memory: Working targets: deployment: sample horizontalPodAutoscaler: sample2 diff --git a/api/autoscaling/v2/testdata/mutating/mutate-by-recommendations/tortoise.yaml b/api/autoscaling/v2/testdata/mutating/mutate-by-recommendations/tortoise.yaml index f7a45a80..e342e242 100644 --- a/api/autoscaling/v2/testdata/mutating/mutate-by-recommendations/tortoise.yaml +++ b/api/autoscaling/v2/testdata/mutating/mutate-by-recommendations/tortoise.yaml @@ -22,6 +22,15 @@ spec: memory: Vertical status: tortoisePhase: Working + containerResourcePhases: + - containerName: "nginx" + resourcePhases: + cpu: Working + memory: Working + - containerName: "istio-proxy" + resourcePhases: + cpu: Working + memory: Working targets: deployment: sample horizontalPodAutoscaler: sample diff --git a/api/autoscaling/v2/testdata/mutating/nothing-to-do/after.yaml b/api/autoscaling/v2/testdata/mutating/nothing-to-do/after.yaml deleted file mode 100644 index fa1875c6..00000000 --- a/api/autoscaling/v2/testdata/mutating/nothing-to-do/after.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: autoscaling/v2 -kind: HorizontalPodAutoscaler -metadata: - name: sample - namespace: default -spec: - maxReplicas: 10 - metrics: - - type: ContainerResource - containerResource: - name: cpu - container: nginx - target: - type: Utilization - averageUtilization: 60 - - type: ContainerResource - containerResource: - name: cpu - container: istio-proxy - target: - type: Utilization - averageUtilization: 60 - minReplicas: 3 - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: sample \ No newline at end of file diff --git a/api/autoscaling/v2/testdata/mutating/nothing-to-do/before.yaml b/api/autoscaling/v2/testdata/mutating/nothing-to-do/before.yaml deleted file mode 100644 index fa1875c6..00000000 --- a/api/autoscaling/v2/testdata/mutating/nothing-to-do/before.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: autoscaling/v2 -kind: HorizontalPodAutoscaler -metadata: - name: sample - namespace: default -spec: - maxReplicas: 10 - metrics: - - type: ContainerResource - containerResource: - name: cpu - container: nginx - target: - type: Utilization - averageUtilization: 60 - - type: ContainerResource - containerResource: - name: cpu - container: istio-proxy - target: - type: Utilization - averageUtilization: 60 - minReplicas: 3 - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: sample \ No newline at end of file diff --git a/api/autoscaling/v2/testdata/mutating/nothing-to-do/tortoise.yaml b/api/autoscaling/v2/testdata/mutating/nothing-to-do/tortoise.yaml deleted file mode 100644 index feb5dd5e..00000000 --- a/api/autoscaling/v2/testdata/mutating/nothing-to-do/tortoise.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: autoscaling.mercari.com/v1beta1 -kind: Tortoise -metadata: - name: tortoise-sample - namespace: default -spec: - updateMode: "Off" - deletionPolicy: "DeleteAll" - targetRefs: - horizontalPodAutoscalerName: sample - scaleTargetRef: - kind: Deployment - name: sample - resourcePolicy: - - containerName: istio-proxy - autoscalingPolicy: - cpu: Horizontal - memory: Vertical - - containerName: nginx - autoscalingPolicy: - cpu: Horizontal - memory: Vertical \ No newline at end of file diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index 1dd02545..ec0ba3df 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -92,6 +92,28 @@ func (in *ContainerRecommendationFromVPA) DeepCopy() *ContainerRecommendationFro return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ContainerResourcePhases) DeepCopyInto(out *ContainerResourcePhases) { + *out = *in + if in.ResourceePhases != nil { + in, out := &in.ResourceePhases, &out.ResourceePhases + *out = make(map[v1.ResourceName]ContainerResourcePhase, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerResourcePhases. +func (in *ContainerResourcePhases) DeepCopy() *ContainerResourcePhases { + if in == nil { + return nil + } + out := new(ContainerResourcePhases) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ContainerResourcePolicy) DeepCopyInto(out *ContainerResourcePolicy) { *out = *in @@ -432,6 +454,13 @@ func (in *TortoiseStatus) DeepCopyInto(out *TortoiseStatus) { in.Conditions.DeepCopyInto(&out.Conditions) in.Recommendations.DeepCopyInto(&out.Recommendations) in.Targets.DeepCopyInto(&out.Targets) + if in.ContainerResourcePhases != nil { + in, out := &in.ContainerResourcePhases, &out.ContainerResourcePhases + *out = make([]ContainerResourcePhases, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TortoiseStatus. diff --git a/controllers/testdata/deletion-no-delete/before/tortoise.yaml b/controllers/testdata/deletion-no-delete/before/tortoise.yaml index 45c47157..c3ef11ba 100644 --- a/controllers/testdata/deletion-no-delete/before/tortoise.yaml +++ b/controllers/testdata/deletion-no-delete/before/tortoise.yaml @@ -83,3 +83,12 @@ status: - name: tortoise-monitor-mercari role: Monitor tortoisePhase: Working + containerResourcePhases: + - containerName: "nginx" + resourcePhases: + cpu: Working + memory: Working + - containerName: "istio-proxy" + resourcePhases: + cpu: Working + memory: Working diff --git a/controllers/testdata/deletion-policy-all/before/tortoise.yaml b/controllers/testdata/deletion-policy-all/before/tortoise.yaml index c73cc9e4..b62a9d0f 100644 --- a/controllers/testdata/deletion-policy-all/before/tortoise.yaml +++ b/controllers/testdata/deletion-policy-all/before/tortoise.yaml @@ -83,3 +83,12 @@ status: - name: tortoise-monitor-mercari role: Monitor tortoisePhase: Working + containerResourcePhases: + - containerName: "nginx" + resourcePhases: + cpu: Working + memory: Working + - containerName: "istio-proxy" + resourcePhases: + cpu: Working + memory: Working diff --git a/controllers/testdata/mutable-autoscalingpolicy-add-another-horizontal/after/tortoise.yaml b/controllers/testdata/mutable-autoscalingpolicy-add-another-horizontal/after/tortoise.yaml index 7871be02..796883c4 100644 --- a/controllers/testdata/mutable-autoscalingpolicy-add-another-horizontal/after/tortoise.yaml +++ b/controllers/testdata/mutable-autoscalingpolicy-add-another-horizontal/after/tortoise.yaml @@ -91,3 +91,12 @@ status: - name: tortoise-monitor-mercari role: Monitor tortoisePhase: Working + containerResourcePhases: + - containerName: "nginx" + resourcePhases: + cpu: Working + memory: Working + - containerName: "istio-proxy" + resourcePhases: + cpu: Working + memory: Working diff --git a/controllers/testdata/mutable-autoscalingpolicy-add-another-horizontal/before/tortoise.yaml b/controllers/testdata/mutable-autoscalingpolicy-add-another-horizontal/before/tortoise.yaml index 5369d4cf..19af0db3 100644 --- a/controllers/testdata/mutable-autoscalingpolicy-add-another-horizontal/before/tortoise.yaml +++ b/controllers/testdata/mutable-autoscalingpolicy-add-another-horizontal/before/tortoise.yaml @@ -82,3 +82,12 @@ status: - name: tortoise-monitor-mercari role: Monitor tortoisePhase: Working + containerResourcePhases: + - containerName: "nginx" + resourcePhases: + cpu: Working + memory: Working + - containerName: "istio-proxy" + resourcePhases: + cpu: Working + memory: Working diff --git a/controllers/testdata/mutable-autoscalingpolicy-no-hpa-and-add-horizontal/after/tortoise.yaml b/controllers/testdata/mutable-autoscalingpolicy-no-hpa-and-add-horizontal/after/tortoise.yaml index 902c0442..f534b8c5 100644 --- a/controllers/testdata/mutable-autoscalingpolicy-no-hpa-and-add-horizontal/after/tortoise.yaml +++ b/controllers/testdata/mutable-autoscalingpolicy-no-hpa-and-add-horizontal/after/tortoise.yaml @@ -89,3 +89,12 @@ status: - name: tortoise-monitor-mercari role: Monitor tortoisePhase: Working + containerResourcePhases: + - containerName: "nginx" + resourcePhases: + cpu: Working + memory: Working + - containerName: "istio-proxy" + resourcePhases: + cpu: Working + memory: Working diff --git a/controllers/testdata/mutable-autoscalingpolicy-no-hpa-and-add-horizontal/before/tortoise.yaml b/controllers/testdata/mutable-autoscalingpolicy-no-hpa-and-add-horizontal/before/tortoise.yaml index 24c54b34..910d6027 100644 --- a/controllers/testdata/mutable-autoscalingpolicy-no-hpa-and-add-horizontal/before/tortoise.yaml +++ b/controllers/testdata/mutable-autoscalingpolicy-no-hpa-and-add-horizontal/before/tortoise.yaml @@ -87,3 +87,12 @@ status: - name: tortoise-monitor-mercari role: Monitor tortoisePhase: Working + containerResourcePhases: + - containerName: "nginx" + resourcePhases: + cpu: Working + memory: Working + - containerName: "istio-proxy" + resourcePhases: + cpu: Working + memory: Working diff --git a/controllers/testdata/mutable-autoscalingpolicy-remove-horizontal/after/tortoise.yaml b/controllers/testdata/mutable-autoscalingpolicy-remove-horizontal/after/tortoise.yaml index d2c249f4..33454c45 100644 --- a/controllers/testdata/mutable-autoscalingpolicy-remove-horizontal/after/tortoise.yaml +++ b/controllers/testdata/mutable-autoscalingpolicy-remove-horizontal/after/tortoise.yaml @@ -88,3 +88,12 @@ status: - name: tortoise-monitor-mercari role: Monitor tortoisePhase: Working + containerResourcePhases: + - containerName: "nginx" + resourcePhases: + cpu: Working + memory: Working + - containerName: "istio-proxy" + resourcePhases: + cpu: Working + memory: Working diff --git a/controllers/testdata/mutable-autoscalingpolicy-remove-horizontal/before/tortoise.yaml b/controllers/testdata/mutable-autoscalingpolicy-remove-horizontal/before/tortoise.yaml index 6bedb0a6..7a97cd9d 100644 --- a/controllers/testdata/mutable-autoscalingpolicy-remove-horizontal/before/tortoise.yaml +++ b/controllers/testdata/mutable-autoscalingpolicy-remove-horizontal/before/tortoise.yaml @@ -82,3 +82,12 @@ status: - name: tortoise-monitor-mercari role: Monitor tortoisePhase: Working + containerResourcePhases: + - containerName: "nginx" + resourcePhases: + cpu: Working + memory: Working + - containerName: "istio-proxy" + resourcePhases: + cpu: Working + memory: Working diff --git a/controllers/testdata/reconcile-for-the-multiple-containers-pod-all-off/after/tortoise.yaml b/controllers/testdata/reconcile-for-the-multiple-containers-pod-all-off/after/tortoise.yaml index 7797b75f..f26dfbe6 100644 --- a/controllers/testdata/reconcile-for-the-multiple-containers-pod-all-off/after/tortoise.yaml +++ b/controllers/testdata/reconcile-for-the-multiple-containers-pod-all-off/after/tortoise.yaml @@ -86,3 +86,12 @@ status: - name: tortoise-monitor-mercari role: Monitor tortoisePhase: Working + containerResourcePhases: + - containerName: "nginx" + resourcePhases: + cpu: Working + memory: Working + - containerName: "istio-proxy" + resourcePhases: + cpu: Working + memory: Working diff --git a/controllers/testdata/reconcile-for-the-multiple-containers-pod-all-off/before/tortoise.yaml b/controllers/testdata/reconcile-for-the-multiple-containers-pod-all-off/before/tortoise.yaml index 238f072a..0a1b5ce8 100644 --- a/controllers/testdata/reconcile-for-the-multiple-containers-pod-all-off/before/tortoise.yaml +++ b/controllers/testdata/reconcile-for-the-multiple-containers-pod-all-off/before/tortoise.yaml @@ -78,3 +78,12 @@ status: - name: tortoise-monitor-mercari role: Monitor tortoisePhase: Working + containerResourcePhases: + - containerName: "nginx" + resourcePhases: + cpu: Working + memory: Working + - containerName: "istio-proxy" + resourcePhases: + cpu: Working + memory: Working diff --git a/controllers/testdata/reconcile-for-the-multiple-containers-pod-all-vertical/after/tortoise.yaml b/controllers/testdata/reconcile-for-the-multiple-containers-pod-all-vertical/after/tortoise.yaml index 5978faa0..4c11b8b3 100644 --- a/controllers/testdata/reconcile-for-the-multiple-containers-pod-all-vertical/after/tortoise.yaml +++ b/controllers/testdata/reconcile-for-the-multiple-containers-pod-all-vertical/after/tortoise.yaml @@ -87,3 +87,12 @@ status: - name: tortoise-monitor-mercari role: Monitor tortoisePhase: Working + containerResourcePhases: + - containerName: "nginx" + resourcePhases: + cpu: Working + memory: Working + - containerName: "istio-proxy" + resourcePhases: + cpu: Working + memory: Working diff --git a/controllers/testdata/reconcile-for-the-multiple-containers-pod-all-vertical/before/tortoise.yaml b/controllers/testdata/reconcile-for-the-multiple-containers-pod-all-vertical/before/tortoise.yaml index 078c6ed6..eb6a5868 100644 --- a/controllers/testdata/reconcile-for-the-multiple-containers-pod-all-vertical/before/tortoise.yaml +++ b/controllers/testdata/reconcile-for-the-multiple-containers-pod-all-vertical/before/tortoise.yaml @@ -79,3 +79,12 @@ status: - name: tortoise-monitor-mercari role: Monitor tortoisePhase: Working + containerResourcePhases: + - containerName: "nginx" + resourcePhases: + cpu: Working + memory: Working + - containerName: "istio-proxy" + resourcePhases: + cpu: Working + memory: Working diff --git a/controllers/testdata/reconcile-for-the-multiple-containers-pod-emergency/after/tortoise.yaml b/controllers/testdata/reconcile-for-the-multiple-containers-pod-emergency/after/tortoise.yaml index 614d1646..f9c4fafd 100644 --- a/controllers/testdata/reconcile-for-the-multiple-containers-pod-emergency/after/tortoise.yaml +++ b/controllers/testdata/reconcile-for-the-multiple-containers-pod-emergency/after/tortoise.yaml @@ -91,3 +91,12 @@ status: - name: tortoise-monitor-mercari role: Monitor tortoisePhase: Emergency + containerResourcePhases: + - containerName: "nginx" + resourcePhases: + cpu: Working + memory: Working + - containerName: "istio-proxy" + resourcePhases: + cpu: Working + memory: Working diff --git a/controllers/testdata/reconcile-for-the-multiple-containers-pod-emergency/before/tortoise.yaml b/controllers/testdata/reconcile-for-the-multiple-containers-pod-emergency/before/tortoise.yaml index c78e6991..b6403b24 100644 --- a/controllers/testdata/reconcile-for-the-multiple-containers-pod-emergency/before/tortoise.yaml +++ b/controllers/testdata/reconcile-for-the-multiple-containers-pod-emergency/before/tortoise.yaml @@ -83,3 +83,12 @@ status: - name: tortoise-monitor-mercari role: Monitor tortoisePhase: Working + containerResourcePhases: + - containerName: "nginx" + resourcePhases: + cpu: Working + memory: Working + - containerName: "istio-proxy" + resourcePhases: + cpu: Working + memory: Working diff --git a/controllers/testdata/reconcile-for-the-multiple-containers-pod-one-off/after/tortoise.yaml b/controllers/testdata/reconcile-for-the-multiple-containers-pod-one-off/after/tortoise.yaml index 04b48143..799e60c0 100644 --- a/controllers/testdata/reconcile-for-the-multiple-containers-pod-one-off/after/tortoise.yaml +++ b/controllers/testdata/reconcile-for-the-multiple-containers-pod-one-off/after/tortoise.yaml @@ -89,3 +89,12 @@ status: - name: tortoise-monitor-mercari role: Monitor tortoisePhase: Working + containerResourcePhases: + - containerName: "nginx" + resourcePhases: + cpu: Working + memory: Working + - containerName: "istio-proxy" + resourcePhases: + cpu: Working + memory: Working diff --git a/controllers/testdata/reconcile-for-the-multiple-containers-pod-one-off/before/tortoise.yaml b/controllers/testdata/reconcile-for-the-multiple-containers-pod-one-off/before/tortoise.yaml index 8b22c9af..3d6113eb 100644 --- a/controllers/testdata/reconcile-for-the-multiple-containers-pod-one-off/before/tortoise.yaml +++ b/controllers/testdata/reconcile-for-the-multiple-containers-pod-one-off/before/tortoise.yaml @@ -82,3 +82,12 @@ status: - name: tortoise-monitor-mercari role: Monitor tortoisePhase: Working + containerResourcePhases: + - containerName: "nginx" + resourcePhases: + cpu: Working + memory: Working + - containerName: "istio-proxy" + resourcePhases: + cpu: Working + memory: Working diff --git a/controllers/testdata/reconcile-for-the-multiple-containers-pod-working/after/tortoise.yaml b/controllers/testdata/reconcile-for-the-multiple-containers-pod-working/after/tortoise.yaml index c9beeacf..68bae4e1 100644 --- a/controllers/testdata/reconcile-for-the-multiple-containers-pod-working/after/tortoise.yaml +++ b/controllers/testdata/reconcile-for-the-multiple-containers-pod-working/after/tortoise.yaml @@ -90,3 +90,12 @@ status: - name: tortoise-monitor-mercari role: Monitor tortoisePhase: Working + containerResourcePhases: + - containerName: "nginx" + resourcePhases: + cpu: Working + memory: Working + - containerName: "istio-proxy" + resourcePhases: + cpu: Working + memory: Working diff --git a/controllers/testdata/reconcile-for-the-multiple-containers-pod-working/before/tortoise.yaml b/controllers/testdata/reconcile-for-the-multiple-containers-pod-working/before/tortoise.yaml index 4d1bb9d7..c7ee5a6b 100644 --- a/controllers/testdata/reconcile-for-the-multiple-containers-pod-working/before/tortoise.yaml +++ b/controllers/testdata/reconcile-for-the-multiple-containers-pod-working/before/tortoise.yaml @@ -82,3 +82,12 @@ status: - name: tortoise-monitor-mercari role: Monitor tortoisePhase: Working + containerResourcePhases: + - containerName: "nginx" + resourcePhases: + cpu: Working + memory: Working + - containerName: "istio-proxy" + resourcePhases: + cpu: Working + memory: Working diff --git a/controllers/testdata/reconcile-for-the-single-container-pod-dryrun/after/tortoise.yaml b/controllers/testdata/reconcile-for-the-single-container-pod-dryrun/after/tortoise.yaml index f85db2a2..b571a8ce 100644 --- a/controllers/testdata/reconcile-for-the-single-container-pod-dryrun/after/tortoise.yaml +++ b/controllers/testdata/reconcile-for-the-single-container-pod-dryrun/after/tortoise.yaml @@ -65,3 +65,12 @@ status: - name: tortoise-monitor-mercari role: Monitor tortoisePhase: Working + containerResourcePhases: + - containerName: "nginx" + resourcePhases: + cpu: Working + memory: Working + - containerName: "istio-proxy" + resourcePhases: + cpu: Working + memory: Working diff --git a/controllers/testdata/reconcile-for-the-single-container-pod-dryrun/before/tortoise.yaml b/controllers/testdata/reconcile-for-the-single-container-pod-dryrun/before/tortoise.yaml index f8c05329..304eb0ca 100644 --- a/controllers/testdata/reconcile-for-the-single-container-pod-dryrun/before/tortoise.yaml +++ b/controllers/testdata/reconcile-for-the-single-container-pod-dryrun/before/tortoise.yaml @@ -61,3 +61,12 @@ status: - name: tortoise-monitor-mercari role: Monitor tortoisePhase: Working + containerResourcePhases: + - containerName: "nginx" + resourcePhases: + cpu: Working + memory: Working + - containerName: "istio-proxy" + resourcePhases: + cpu: Working + memory: Working diff --git a/controllers/testdata/reconcile-for-the-single-container-pod-emergency/after/tortoise.yaml b/controllers/testdata/reconcile-for-the-single-container-pod-emergency/after/tortoise.yaml index ab0fa1a2..cdfe52d2 100644 --- a/controllers/testdata/reconcile-for-the-single-container-pod-emergency/after/tortoise.yaml +++ b/controllers/testdata/reconcile-for-the-single-container-pod-emergency/after/tortoise.yaml @@ -65,3 +65,12 @@ status: - name: tortoise-monitor-mercari role: Monitor tortoisePhase: Emergency + containerResourcePhases: + - containerName: "nginx" + resourcePhases: + cpu: Working + memory: Working + - containerName: "istio-proxy" + resourcePhases: + cpu: Working + memory: Working diff --git a/controllers/testdata/reconcile-for-the-single-container-pod-emergency/before/tortoise.yaml b/controllers/testdata/reconcile-for-the-single-container-pod-emergency/before/tortoise.yaml index 30ca62b1..4527c364 100644 --- a/controllers/testdata/reconcile-for-the-single-container-pod-emergency/before/tortoise.yaml +++ b/controllers/testdata/reconcile-for-the-single-container-pod-emergency/before/tortoise.yaml @@ -61,3 +61,12 @@ status: - name: tortoise-monitor-mercari role: Monitor tortoisePhase: Working + containerResourcePhases: + - containerName: "nginx" + resourcePhases: + cpu: Working + memory: Working + - containerName: "istio-proxy" + resourcePhases: + cpu: Working + memory: Working diff --git a/controllers/testdata/reconcile-for-the-single-container-pod-working/after/tortoise.yaml b/controllers/testdata/reconcile-for-the-single-container-pod-working/after/tortoise.yaml index 62369bdf..bc3a573f 100644 --- a/controllers/testdata/reconcile-for-the-single-container-pod-working/after/tortoise.yaml +++ b/controllers/testdata/reconcile-for-the-single-container-pod-working/after/tortoise.yaml @@ -64,3 +64,12 @@ status: - name: tortoise-monitor-mercari role: Monitor tortoisePhase: Working + containerResourcePhases: + - containerName: "nginx" + resourcePhases: + cpu: Working + memory: Working + - containerName: "istio-proxy" + resourcePhases: + cpu: Working + memory: Working diff --git a/controllers/testdata/reconcile-for-the-single-container-pod-working/before/tortoise.yaml b/controllers/testdata/reconcile-for-the-single-container-pod-working/before/tortoise.yaml index 1eecdb27..fafecbf0 100644 --- a/controllers/testdata/reconcile-for-the-single-container-pod-working/before/tortoise.yaml +++ b/controllers/testdata/reconcile-for-the-single-container-pod-working/before/tortoise.yaml @@ -60,3 +60,12 @@ status: - name: tortoise-monitor-mercari role: Monitor tortoisePhase: Working + containerResourcePhases: + - containerName: "nginx" + resourcePhases: + cpu: Working + memory: Working + - containerName: "istio-proxy" + resourcePhases: + cpu: Working + memory: Working