Skip to content

Commit 72ba863

Browse files
Update diff
1 parent 06ed371 commit 72ba863

File tree

6 files changed

+16
-5
lines changed

6 files changed

+16
-5
lines changed

.ci/tests/integration/cases/java-download-function/manifests.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
apiVersion: compute.functionmesh.io/v1alpha1
22
kind: Function
33
metadata:
4+
annotations:
5+
compute.functionmesh.io/pause-rollout: "false"
46
name: function-download-sample
57
namespace: default
68
spec:

.ci/tests/integration/cases/java-function-vpa/manifests.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
apiVersion: compute.functionmesh.io/v1alpha1
22
kind: Function
33
metadata:
4+
annotations:
5+
compute.functionmesh.io/pause-rollout: "true"
46
name: function-sample-vpa
57
namespace: default
68
spec:

.ci/tests/integration/cases/java-function/manifests.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
apiVersion: compute.functionmesh.io/v1alpha1
22
kind: Function
33
metadata:
4+
annotations:
5+
compute.functionmesh.io/pause-rollout: "true"
46
name: function-sample
57
namespace: default
68
spec:

.ci/tests/integration/cases/java-log-config/manifests.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
apiVersion: compute.functionmesh.io/v1alpha1
22
kind: Function
33
metadata:
4+
annotations:
5+
compute.functionmesh.io/pause-rollout: "true"
46
name: java-log-config
57
namespace: default
68
spec:

.ci/tests/integration/cases/java-log-format-json/manifests.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
apiVersion: compute.functionmesh.io/v1alpha1
22
kind: Function
33
metadata:
4+
annotations:
5+
compute.functionmesh.io/pause-rollout: "false"
46
name: java-log-format-json
57
namespace: default
68
spec:

controllers/spec/common.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import (
4040
corev1 "k8s.io/api/core/v1"
4141
k8serrors "k8s.io/apimachinery/pkg/api/errors"
4242
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
43-
"k8s.io/apimachinery/pkg/runtime"
4443
"k8s.io/apimachinery/pkg/types"
4544
"k8s.io/apimachinery/pkg/util/intstr"
4645
"k8s.io/apimachinery/pkg/util/strategicpatch"
@@ -2377,9 +2376,11 @@ func makeFilebeatContainer(volumeMounts []corev1.VolumeMount, envVar []corev1.En
23772376
}
23782377
}
23792378

2380-
func CreateDiff(orj, modified runtime.Object) (string, error) {
2381-
orjCopy := orj.DeepCopyObject()
2382-
modifiedCopy := modified.DeepCopyObject()
2379+
func CreateDiff(orj, modified *appsv1.StatefulSet) (string, error) {
2380+
orjCopy := orj.DeepCopyObject().(*appsv1.StatefulSet)
2381+
modifiedCopy := modified.DeepCopyObject().(*appsv1.StatefulSet)
2382+
modifiedCopy.Status = orjCopy.Status
2383+
modifiedCopy.ObjectMeta = orjCopy.ObjectMeta
23832384

23842385
orjData, err := json.Marshal(orjCopy)
23852386
if err != nil {
@@ -2389,7 +2390,7 @@ func CreateDiff(orj, modified runtime.Object) (string, error) {
23892390
if err != nil {
23902391
return "", fmt.Errorf("marshal modified %w", err)
23912392
}
2392-
patch, err := strategicpatch.CreateTwoWayMergePatch(orjData, modifiedData, orj)
2393+
patch, err := strategicpatch.CreateTwoWayMergePatch(orjData, modifiedData, orjCopy)
23932394
if err != nil {
23942395
return "", fmt.Errorf("create diff %w", err)
23952396
}

0 commit comments

Comments
 (0)