You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by as...@apache.org on 2020/06/04 07:24:52 UTC

[camel-k] 03/03: chore: Migrate to new RawPatch API

This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 791797b86d5730a602aa6e30cb872c603e93639f
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Wed Jun 3 18:24:42 2020 +0200

    chore: Migrate to new RawPatch API
---
 pkg/cmd/builder/builder.go               | 2 +-
 pkg/controller/build/schedule_routine.go | 2 +-
 pkg/platform/defaults.go                 | 2 +-
 pkg/trait/deployer.go                    | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/pkg/cmd/builder/builder.go b/pkg/cmd/builder/builder.go
index aec4c99..da1e28b 100644
--- a/pkg/cmd/builder/builder.go
+++ b/pkg/cmd/builder/builder.go
@@ -90,7 +90,7 @@ func Run(namespace string, buildName string, taskName string) {
 	exitOnError(err, "cannot create merge patch")
 	if len(p) > 0 {
 		exitOnError(
-			c.Status().Patch(ctx, target, controller.ConstantPatch(types.MergePatchType, p)),
+			c.Status().Patch(ctx, target, controller.RawPatch(types.MergePatchType, p)),
 			fmt.Sprintf("\n--- patch ---\n%s\n-------------\n", string(p)),
 		)
 	} else {
diff --git a/pkg/controller/build/schedule_routine.go b/pkg/controller/build/schedule_routine.go
index 26fd0d3..db66bb2 100644
--- a/pkg/controller/build/schedule_routine.go
+++ b/pkg/controller/build/schedule_routine.go
@@ -151,7 +151,7 @@ func (action *scheduleRoutineAction) updateBuildStatus(ctx context.Context, buil
 		action.L.Errorf(err, "Cannot patch build status: %s", build.Name)
 		return err
 	}
-	err = action.client.Status().Patch(ctx, target, client.ConstantPatch(types.MergePatchType, p))
+	err = action.client.Status().Patch(ctx, target, client.RawPatch(types.MergePatchType, p))
 	if err != nil {
 		action.L.Errorf(err, "Cannot update build status: %s", build.Name)
 		return err
diff --git a/pkg/platform/defaults.go b/pkg/platform/defaults.go
index 27063b9..c072152 100644
--- a/pkg/platform/defaults.go
+++ b/pkg/platform/defaults.go
@@ -280,7 +280,7 @@ func createDefaultMavenSettingsConfigMap(ctx context.Context, client client.Clie
 		if err != nil {
 			return err
 		} else if len(p) != 0 {
-			err = client.Patch(ctx, cm, k8sclient.ConstantPatch(types.MergePatchType, p))
+			err = client.Patch(ctx, cm, k8sclient.RawPatch(types.MergePatchType, p))
 			if err != nil {
 				return errors.Wrap(err, "error during patch resource")
 			}
diff --git a/pkg/trait/deployer.go b/pkg/trait/deployer.go
index 8368110..c6f6392 100644
--- a/pkg/trait/deployer.go
+++ b/pkg/trait/deployer.go
@@ -103,7 +103,7 @@ func (t *deployerTrait) Apply(e *Environment) error {
 					continue
 				}
 
-				err = env.Client.Patch(env.C, resource, client.ConstantPatch(types.MergePatchType, p))
+				err = env.Client.Patch(env.C, resource, client.RawPatch(types.MergePatchType, p))
 				if err != nil {
 					return errors.Wrap(err, "error during patch resource")
 				}