You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ts...@apache.org on 2022/08/25 06:26:14 UTC
[camel-k] branch main updated: chore(knative): Remove obsolete Knative service beta v1 mappings
This is an automated email from the ASF dual-hosted git repository.
tsato pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/main by this push:
new 236d2be96 chore(knative): Remove obsolete Knative service beta v1 mappings
236d2be96 is described below
commit 236d2be9621b114f56f547f2ac137197a7b904b4
Author: Christoph Deppisch <cd...@redhat.com>
AuthorDate: Wed Aug 24 10:30:36 2022 +0200
chore(knative): Remove obsolete Knative service beta v1 mappings
- Since we have migrated to Knative service v1 API remove obsolete beta v1 mappings when replacing resources
- In fact the code has been a duplication after the migration to service v1
---
pkg/util/kubernetes/replace.go | 14 --------------
1 file changed, 14 deletions(-)
diff --git a/pkg/util/kubernetes/replace.go b/pkg/util/kubernetes/replace.go
index 9554c07f4..9e047b3f9 100644
--- a/pkg/util/kubernetes/replace.go
+++ b/pkg/util/kubernetes/replace.go
@@ -52,7 +52,6 @@ func ReplaceResource(ctx context.Context, c client.Client, res ctrl.Object) erro
mapRequiredMeta(existing, res)
mapRequiredServiceData(existing, res)
mapRequiredRouteData(existing, res)
- mapRequiredKnativeServiceV1Beta1Data(existing, res)
mapRequiredKnativeServiceV1Data(existing, res)
err = c.Update(ctx, res)
}
@@ -82,19 +81,6 @@ func mapRequiredRouteData(from runtime.Object, to runtime.Object) {
}
}
-func mapRequiredKnativeServiceV1Beta1Data(from runtime.Object, to runtime.Object) {
- if fromC, ok := from.(*serving.Service); ok {
- if toC, ok := to.(*serving.Service); ok {
- if v, present := fromC.ObjectMeta.Annotations["serving.knative.dev/creator"]; present {
- v1.SetAnnotation(&toC.ObjectMeta, "serving.knative.dev/creator", v)
- }
- if v, present := fromC.ObjectMeta.Annotations["serving.knative.dev/lastModifier"]; present {
- v1.SetAnnotation(&toC.ObjectMeta, "serving.knative.dev/lastModifier", v)
- }
- }
- }
-}
-
func mapRequiredKnativeServiceV1Data(from runtime.Object, to runtime.Object) {
if fromC, ok := from.(*serving.Service); ok {
if toC, ok := to.(*serving.Service); ok {