This is an automated email from the ASF dual-hosted git repository. pcongiusti 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 b96262394 feat(dependencies): bump kubernetes to 1.32 b96262394 is described below commit b9626239497fab9aba8114c291be885a448666e7 Author: Pasquale Congiusti <pasquale.congiu...@gmail.com> AuthorDate: Thu Feb 27 18:34:21 2025 +0100 feat(dependencies): bump kubernetes to 1.32 We need to drop the support for deprecated Service Binding ahead of time as their dependency would require upgrade to kube as well. Closes #6070 --- docs/modules/traits/pages/service-binding.adoc | 40 ---- e2e/common/traits/service_binding_test.go | 102 ---------- go.mod | 39 ++-- go.sum | 81 ++++---- pkg/apis/camel/v1/common_types.go | 2 + pkg/apis/camel/v1/trait/service_binding.go | 4 +- pkg/cmd/bind.go | 22 --- pkg/cmd/bind_test.go | 3 +- pkg/cmd/run.go | 42 ++--- pkg/trait/mount.go | 10 - pkg/trait/service_binding.go | 245 ------------------------- pkg/trait/service_binding_test.go | 93 ---------- pkg/trait/trait_configure_test.go | 8 +- pkg/trait/trait_register.go | 1 - 14 files changed, 92 insertions(+), 600 deletions(-) diff --git a/docs/modules/traits/pages/service-binding.adoc b/docs/modules/traits/pages/service-binding.adoc deleted file mode 100755 index 75bb79edb..000000000 --- a/docs/modules/traits/pages/service-binding.adoc +++ /dev/null @@ -1,40 +0,0 @@ -= Service Binding Trait - -// Start of autogenerated code - DO NOT EDIT! (badges) -[.badges] -[.badge-key]##Deprecated since##[.badge-unsupported]##2.5.0## -// End of autogenerated code - DO NOT EDIT! (badges) -// Start of autogenerated code - DO NOT EDIT! (description) -The Service Binding trait allows users to connect to Services in Kubernetes: -https://github.com/k8s-service-bindings/spec#service-binding -As the specification is still evolving this is subject to change. - - -This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**. - -// End of autogenerated code - DO NOT EDIT! (description) -// Start of autogenerated code - DO NOT EDIT! (configuration) -== Configuration - -Trait properties can be specified when running any integration with the CLI: -[source,console] ----- -$ kamel run --trait service-binding.[key]=[value] --trait service-binding.[key2]=[value2] integration.yaml ----- -The following configuration options are available: - -[cols="2m,1m,5a"] -|=== -|Property | Type | Description - -| service-binding.enabled -| bool -| Can be used to enable or disable a trait. All traits share this common property. - -| service-binding.services -| []string -| List of Services in the form [[apigroup/]version:]kind:[namespace/]name - -|=== - -// End of autogenerated code - DO NOT EDIT! (configuration) diff --git a/e2e/common/traits/service_binding_test.go b/e2e/common/traits/service_binding_test.go deleted file mode 100644 index 84086f5ad..000000000 --- a/e2e/common/traits/service_binding_test.go +++ /dev/null @@ -1,102 +0,0 @@ -//go:build integration -// +build integration - -// To enable compilation of this file in Goland, go to "Settings -> Go -> Vendoring & Build Tags -> Custom Tags" and add "integration" - -/* -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package common - -import ( - "context" - "fmt" - "testing" - - . "github.com/onsi/gomega" - - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - . "github.com/apache/camel-k/v2/e2e/support" - v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1" -) - -func TestServiceBindingTrait(t *testing.T) { - t.Parallel() - WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) { - t.Run("Integration Service Binding", func(t *testing.T) { - // Create our mock service config - host := "hostname" - port := "12324" - service := &corev1.ConfigMap{ - TypeMeta: metav1.TypeMeta{ - Kind: "ConfigMap", - APIVersion: "v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "mock-service-config-it", - Namespace: ns, - Annotations: map[string]string{ - "service.binding/host": "path={.data.service-host}", - "service.binding/port": "path={.data.service-port}", - }, - }, - Data: map[string]string{ - "service-host": host, - "service-port": port, - }, - } - serviceRef := fmt.Sprintf("%s:%s/%s", service.TypeMeta.Kind, ns, service.ObjectMeta.Name) - g.Expect(TestClient(t).Create(ctx, service)).To(Succeed()) - // Create integration and bind it to our service - name := RandomizedSuffixName("service-binding") - g.Expect(KamelRun(t, ctx, ns, "files/ServiceBinding.java", "--name", name, "--connect", serviceRef).Execute()).To(Succeed()) - - g.Eventually(IntegrationPodPhase(t, ctx, ns, name), TestTimeoutLong).Should(Equal(corev1.PodRunning)) - g.Eventually(IntegrationConditionStatus(t, ctx, ns, name, v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) - g.Eventually(IntegrationLogs(t, ctx, ns, name), TestTimeoutShort).Should(ContainSubstring(fmt.Sprintf("%s:%s", host, port))) - }) - - t.Run("Binding Service Binding", func(t *testing.T) { - // Create our mock service config - message := "hello" - service := &corev1.ConfigMap{ - TypeMeta: metav1.TypeMeta{ - Kind: "ConfigMap", - APIVersion: "v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "mock-service-config-kb", - Namespace: ns, - Annotations: map[string]string{ - "service.binding/message": "path={.data.message}", - }, - }, - Data: map[string]string{ - "message": message, - }, - } - serviceRef := fmt.Sprintf("%s:%s/%s", service.TypeMeta.Kind, ns, service.ObjectMeta.Name) - g.Expect(TestClient(t).Create(ctx, service)).To(Succeed()) - g.Expect(CreateTimerKamelet(t, ctx, ns, "my-timer-source")()).To(Succeed()) - g.Expect(KamelBind(t, ctx, ns, "my-timer-source", "log:info", "-p", "source.message=Hello+world", "--connect", serviceRef).Execute()).To(Succeed()) - g.Eventually(IntegrationPodPhase(t, ctx, ns, "my-timer-source-to-log"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) - g.Eventually(IntegrationLogs(t, ctx, ns, "my-timer-source-to-log")).Should(ContainSubstring("Body: Hello+world")) - }) - }) -} diff --git a/go.mod b/go.mod index 28b8fdaa6..84e4bfd85 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,6 @@ require ( github.com/prometheus/client_golang v1.21.0 github.com/prometheus/client_model v0.6.1 github.com/prometheus/common v0.62.0 - github.com/redhat-developer/service-binding-operator v1.4.0 github.com/rs/xid v1.6.0 github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.9.1 @@ -41,26 +40,28 @@ require ( golang.org/x/text v0.22.0 golang.org/x/time v0.10.0 gopkg.in/yaml.v2 v2.4.0 - k8s.io/api v0.30.8 - k8s.io/apiextensions-apiserver v0.30.8 - k8s.io/apimachinery v0.30.8 - k8s.io/cli-runtime v0.30.8 - k8s.io/client-go v0.30.8 + k8s.io/api v0.32.2 + k8s.io/apiextensions-apiserver v0.32.2 + k8s.io/apimachinery v0.32.2 + k8s.io/cli-runtime v0.32.2 + k8s.io/client-go v0.32.2 k8s.io/gengo v0.0.0-20240404160639-a0386bf69313 k8s.io/klog/v2 v2.130.1 - k8s.io/kubectl v0.30.8 - k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 + k8s.io/kubectl v0.32.2 + k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 knative.dev/eventing v0.43.3 knative.dev/pkg v0.0.0-20241021183759-9b9d535af5ad knative.dev/serving v0.43.1 - sigs.k8s.io/controller-runtime v0.18.5 + sigs.k8s.io/controller-runtime v0.20.2 sigs.k8s.io/structured-merge-diff/v4 v4.5.0 ) +require github.com/redhat-developer/service-binding-operator v1.4.1 + require ( contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d // indirect contrib.go.opencensus.io/exporter/prometheus v0.4.2 // indirect - github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect + github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -77,7 +78,8 @@ require ( github.com/docker/distribution v2.8.2+incompatible // indirect github.com/docker/docker-credential-helpers v0.7.0 // indirect github.com/emicklei/go-restful/v3 v3.12.1 // indirect - github.com/evanphx/json-patch/v5 v5.9.0 // indirect + github.com/evanphx/json-patch/v5 v5.9.11 // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.5.1 // indirect github.com/go-logr/zapr v1.3.0 // indirect @@ -87,6 +89,7 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect + github.com/google/btree v1.1.3 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/go-containerregistry v0.20.2 // indirect @@ -105,8 +108,8 @@ require ( github.com/mailru/easyjson v0.7.7 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/moby/spdystream v0.2.0 // indirect - github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect + github.com/moby/spdystream v0.5.0 // indirect + github.com/moby/term v0.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect @@ -128,6 +131,7 @@ require ( github.com/spf13/cast v1.6.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/vbatts/tar-split v0.11.3 // indirect + github.com/x448/float16 v0.8.4 // indirect go.opencensus.io v0.24.0 // indirect golang.org/x/crypto v0.31.0 // indirect golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect @@ -137,15 +141,16 @@ require ( golang.org/x/tools v0.28.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/api v0.183.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240826202546-f6391c0de4c7 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7 // indirect google.golang.org/grpc v1.67.1 // indirect google.golang.org/protobuf v1.36.1 // indirect + gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/kube-openapi v0.0.0-20240808142205-8e686545bdb8 // indirect + k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect knative.dev/networking v0.0.0-20241022012959-60e29ff520dc // indirect - sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect + sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) diff --git a/go.sum b/go.sum index c9f7d507b..b976a0a63 100644 --- a/go.sum +++ b/go.sum @@ -35,8 +35,8 @@ contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d/g contrib.go.opencensus.io/exporter/prometheus v0.4.2 h1:sqfsYl5GIY/L570iT+l93ehxaWJs2/OwXtiWwew3oAg= contrib.go.opencensus.io/exporter/prometheus v0.4.2/go.mod h1:dvEHbiKmgvbr5pjaF9fpw1KeYcjrnC1J8B+JKjsZyRQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= @@ -111,13 +111,15 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v5.9.11+incompatible h1:ixHHqfcGvxhWkniF1tWxBHA0yb4Z+d1UQi45df52xW8= github.com/evanphx/json-patch v5.9.11+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= -github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= +github.com/evanphx/json-patch/v5 v5.9.11 h1:/8HVnzMq13/3x9TPvjG08wUGqBTmZBsCWzjTM0wiaDU= +github.com/evanphx/json-patch/v5 v5.9.11/go.mod h1:3j+LviiESTElxA4p3EMKAB9HXj3/XEtnUf6OZxqIQTM= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/gertd/go-pluralize v0.2.1 h1:M3uASbVjMnTsPb0PNqg+E/24Vwigyo/tvyMTtAlLgiA= github.com/gertd/go-pluralize v0.2.1/go.mod h1:rbYaKDbsXxmRfr8uygAEKhOWsjyrrqrkHVpZvoOp8zk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -192,6 +194,8 @@ github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -236,7 +240,6 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/grpc-gateway v1.14.6/go.mod h1:zdiPV4Yse/1gnckTHtghG4GkDEdKCRJduHpTxT3/jcw= @@ -304,10 +307,10 @@ github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/moby/term v0.0.0-20221205130635-1aeaba878587 h1:HfkjXDfhgVaN5rmueG8cL8KKeFNecRCXFhaJ2qZ5SKA= -github.com/moby/term v0.0.0-20221205130635-1aeaba878587/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= +github.com/moby/spdystream v0.5.0 h1:7r0J1Si3QO/kjRitvSLVVFUjxMEb/YLj6S9FF62JBCU= +github.com/moby/spdystream v0.5.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI= +github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= +github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -388,8 +391,8 @@ github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0leargg github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/prometheus/statsd_exporter v0.22.7 h1:7Pji/i2GuhK6Lu7DHrtTkFmNBCudCPT1pX2CziuyQR0= github.com/prometheus/statsd_exporter v0.22.7/go.mod h1:N/TevpjkIh9ccs6nuzY3jQn9dFqnUakOjnEuMPJJJnI= -github.com/redhat-developer/service-binding-operator v1.4.0 h1:i3xHPfm+iCE4JOGyrmKl/DpAuHmBj98zVOxUQAt7VSI= -github.com/redhat-developer/service-binding-operator v1.4.0/go.mod h1:iuHe2uSbhFV/Z1iVh8ncmiRc+RLjgDZkDkkUMCwGEXU= +github.com/redhat-developer/service-binding-operator v1.4.1 h1:rBjvdnn9XYVWyb7EpEWqtugkpzu5pcIsSV5sczj0lrc= +github.com/redhat-developer/service-binding-operator v1.4.1/go.mod h1:3f2aNbRJsaLKqZwcEaoZ427W/AtZDr0WKKyIxAdoyJ0= github.com/rickb777/date v1.13.0 h1:+8AmwLuY1d/rldzdqvqTEg7107bZ8clW37x4nsdG3Hs= github.com/rickb777/date v1.13.0/go.mod h1:GZf3LoGnxPWjX+/1TXOuzHefZFDovTyNLHDMd3qH70k= github.com/rickb777/plural v1.2.1 h1:UitRAgR70+yHFt26Tmj/F9dU9aV6UfjGXSbO1DcC9/U= @@ -454,6 +457,8 @@ github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6Kllzaw github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/vbatts/tar-split v0.11.3 h1:hLFqsOLQ1SsppQNTMpkpPXClLDfC2A3Zgy9OUU+RVck= github.com/vbatts/tar-split v0.11.3/go.mod h1:9QlHN18E+fEH7RdG+QAJJcuya3rqT7eXSTY7wGrAokY= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -759,10 +764,10 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8= -google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 h1:e7S5W7MGGLaSu8j3YjdezkZ+m1/Nm0uRVRMEMGk26Xs= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/genproto/googleapis/api v0.0.0-20240826202546-f6391c0de4c7 h1:YcyjlL1PRr2Q17/I0dPk2JmYS5CDXfcdb2Z3YRioEbw= +google.golang.org/genproto/googleapis/api v0.0.0-20240826202546-f6391c0de4c7/go.mod h1:OCdP9MfskevB/rbYvHTsXTtKC+3bHWajPdoKgjcYkfo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7 h1:2035KHhUv+EpyB+hWgJnaWKJOdX1E95w2S8Rr4uWKTs= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -801,6 +806,8 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= +gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= @@ -830,29 +837,29 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.30.8 h1:Y+yZRF3c1WC0MTkLe0qBkiLCquRNa4I21/iDioGMCbo= -k8s.io/api v0.30.8/go.mod h1:89IE5MzirZ5HHxU/Hq1/KWGqXkhXClu/FHGesFhQ0A4= -k8s.io/apiextensions-apiserver v0.30.8 h1:Y0JqPRpiiEmWg7OptY+iwGDol970NXZE0j0LcPwO0U8= -k8s.io/apiextensions-apiserver v0.30.8/go.mod h1:Lg5U2+EIgqSmBvLzxB4bI2K6k0Hx59BZXpHyeiWLB8M= -k8s.io/apimachinery v0.30.8 h1:9jyTItYzmJc00cBDxZC5ArFNxUeKCwbw0m760iFUMKY= -k8s.io/apimachinery v0.30.8/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= -k8s.io/apiserver v0.30.8 h1:DOWCFq7xogXYGmDyRTDwCmftStoWjvSquhM/czhU86M= -k8s.io/apiserver v0.30.8/go.mod h1:OXjKIUTmtoYffVxIOqHDfMpPtqWQoPLpwvsWT++AXiI= -k8s.io/cli-runtime v0.30.8 h1:4lVts4CdKiGQ1nA3YMmkxXNrJOvW9IVSxBrTR780IoU= -k8s.io/cli-runtime v0.30.8/go.mod h1:IPm4dYRlYf7DYIsWOPmkg5sTchCwsdcOhk7sibq87vg= -k8s.io/client-go v0.30.8 h1:fC1SQMZm7bSWiVv9ydN+nv+sqGVAxMdf/5eKUVffNJE= -k8s.io/client-go v0.30.8/go.mod h1:daF3UcGVqGPHvH5mn/ESkp/VoR8i9tg9IBfKr+AeFYo= +k8s.io/api v0.32.2 h1:bZrMLEkgizC24G9eViHGOPbW+aRo9duEISRIJKfdJuw= +k8s.io/api v0.32.2/go.mod h1:hKlhk4x1sJyYnHENsrdCWw31FEmCijNGPJO5WzHiJ6Y= +k8s.io/apiextensions-apiserver v0.32.2 h1:2YMk285jWMk2188V2AERy5yDwBYrjgWYggscghPCvV4= +k8s.io/apiextensions-apiserver v0.32.2/go.mod h1:GPwf8sph7YlJT3H6aKUWtd0E+oyShk/YHWQHf/OOgCA= +k8s.io/apimachinery v0.32.2 h1:yoQBR9ZGkA6Rgmhbp/yuT9/g+4lxtsGYwW6dR6BDPLQ= +k8s.io/apimachinery v0.32.2/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE= +k8s.io/apiserver v0.32.2 h1:WzyxAu4mvLkQxwD9hGa4ZfExo3yZZaYzoYvvVDlM6vw= +k8s.io/apiserver v0.32.2/go.mod h1:PEwREHiHNU2oFdte7BjzA1ZyjWjuckORLIK/wLV5goM= +k8s.io/cli-runtime v0.32.2 h1:aKQR4foh9qeyckKRkNXUccP9moxzffyndZAvr+IXMks= +k8s.io/cli-runtime v0.32.2/go.mod h1:a/JpeMztz3xDa7GCyyShcwe55p8pbcCVQxvqZnIwXN8= +k8s.io/client-go v0.32.2 h1:4dYCD4Nz+9RApM2b/3BtVvBHw54QjMFUl1OLcJG5yOA= +k8s.io/client-go v0.32.2/go.mod h1:fpZ4oJXclZ3r2nDOv+Ux3XcJutfrwjKTCHz2H3sww94= k8s.io/gengo v0.0.0-20240404160639-a0386bf69313 h1:wBIDZID8ju9pwOiLlV22YYKjFGtiNSWgHf5CnKLRUuM= k8s.io/gengo v0.0.0-20240404160639-a0386bf69313/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kube-openapi v0.0.0-20240808142205-8e686545bdb8 h1:1Wof1cGQgA5pqgo8MxKPtf+qN6Sh/0JzznmeGPm1HnE= -k8s.io/kube-openapi v0.0.0-20240808142205-8e686545bdb8/go.mod h1:Os6V6dZwLNii3vxFpxcNaTmH8LJJBkOTg1N0tOA0fvA= -k8s.io/kubectl v0.30.8 h1:p/oOy3lbBAJ2secYbIB5w89fqVGJpMcPePlzkcJWEwI= -k8s.io/kubectl v0.30.8/go.mod h1:BZH/naEOTQfvADYydXGHfe5L+F46oj0WFWW8nuxuYM8= -k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= -k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJJ4JRdzg3+O6e8I+e+8T5Y= +k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4= +k8s.io/kubectl v0.32.2 h1:TAkag6+XfSBgkqK9I7ZvwtF0WVtUAvK8ZqTt+5zi1Us= +k8s.io/kubectl v0.32.2/go.mod h1:+h/NQFSPxiDZYX/WZaWw9fwYezGLISP0ud8nQKg+3g8= +k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro= +k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= knative.dev/eventing v0.43.3 h1:xt10rMoe6t1hFPPrnsR5NYe/vWRXQqLgRK8lS6n5mU8= knative.dev/eventing v0.43.3/go.mod h1:pdrF+bEUfRkNn9ifWXS7DoVj5W31gA5KQVd8iwplXUo= knative.dev/networking v0.0.0-20241022012959-60e29ff520dc h1:0d9XXRLlyuHfINZLlYqo/BYe/+chqqNBMLKJldjTbtw= @@ -864,10 +871,10 @@ knative.dev/serving v0.43.1/go.mod h1:KhhRhb3HPyKSm924/QRjqtAj2U0x5UZM217SxVTbib rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/controller-runtime v0.18.5 h1:nTHio/W+Q4aBlQMgbnC5hZb4IjIidyrizMai9P6n4Rk= -sigs.k8s.io/controller-runtime v0.18.5/go.mod h1:TVoGrfdpbA9VRFaRnKgk9P5/atA0pMwq+f+msb9M8Sg= -sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= -sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/controller-runtime v0.20.2 h1:/439OZVxoEc02psi1h4QO3bHzTgu49bb347Xp4gW1pc= +sigs.k8s.io/controller-runtime v0.20.2/go.mod h1:xg2XB0K5ShQzAgsoujxuKN4LNXR2LfwwHsPj7Iaw+XY= +sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8= +sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo= sigs.k8s.io/structured-merge-diff/v4 v4.5.0 h1:nbCitCK2hfnhyiKo6uf2HxUPTCodY6Qaf85SbDIaMBk= sigs.k8s.io/structured-merge-diff/v4 v4.5.0/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/pkg/apis/camel/v1/common_types.go b/pkg/apis/camel/v1/common_types.go index 1acb0759f..71d4bba36 100644 --- a/pkg/apis/camel/v1/common_types.go +++ b/pkg/apis/camel/v1/common_types.go @@ -199,6 +199,7 @@ type Traits struct { // The configuration of Environment trait Environment *trait.EnvironmentTrait `property:"environment" json:"environment,omitempty"` // The configuration of Error Handler trait + // Deprecated: no longer in use. ErrorHandler *trait.ErrorHandlerTrait `property:"error-handler" json:"error-handler,omitempty"` // The configuration of GC trait GC *trait.GCTrait `property:"gc" json:"gc,omitempty"` @@ -250,6 +251,7 @@ type Traits struct { // The configuration of Service trait Service *trait.ServiceTrait `property:"service" json:"service,omitempty"` // The configuration of Service Binding trait + // Deprecated: no longer in use. ServiceBinding *trait.ServiceBindingTrait `property:"service-binding" json:"service-binding,omitempty"` // The configuration of Telemetry trait Telemetry *trait.TelemetryTrait `property:"telemetry" json:"telemetry,omitempty"` diff --git a/pkg/apis/camel/v1/trait/service_binding.go b/pkg/apis/camel/v1/trait/service_binding.go index 4b5a8bb63..e7fea36ef 100644 --- a/pkg/apis/camel/v1/trait/service_binding.go +++ b/pkg/apis/camel/v1/trait/service_binding.go @@ -17,7 +17,7 @@ limitations under the License. package trait -// WARNING: The Service Binding trait is **deprecated** and will removed in future release versions. +// WARNING: This trait is no longer in use. // // The Service Binding trait allows users to connect to Services in Kubernetes: @@ -25,7 +25,7 @@ package trait // As the specification is still evolving this is subject to change. // // +camel-k:trait=service-binding. -// +camel-k:deprecated=2.5.0. +// +camel-k:internal. type ServiceBindingTrait struct { Trait `property:",squash" json:",inline"` // List of Services in the form [[apigroup/]version:]kind:[namespace/]name diff --git a/pkg/cmd/bind.go b/pkg/cmd/bind.go index d65df8db4..d1af4c390 100644 --- a/pkg/cmd/bind.go +++ b/pkg/cmd/bind.go @@ -54,7 +54,6 @@ func newCmdBind(rootCmdOptions *RootCmdOptions) (*cobra.Command, *bindCmdOptions Annotations: make(map[string]string), } - cmd.Flags().StringArrayP("connect", "c", nil, "A ServiceBinding or Provisioned Service that the integration should bind to, specified as [[apigroup/]version:]kind:[namespace/]name") cmd.Flags().String("error-handler", "", `Add error handler (none|log|sink:<endpoint>). Sink endpoints are expected in the format "[[apigroup/]version:]kind:[namespace/]name", plain Camel URIs or Kamelet name.`) cmd.Flags().String("name", "", "Name for the binding") cmd.Flags().StringP("output", "o", "", "Output format. One of: json|yaml") @@ -81,7 +80,6 @@ type bindCmdOptions struct { *RootCmdOptions ErrorHandler string `mapstructure:"error-handler" yaml:",omitempty"` Name string `mapstructure:"name" yaml:",omitempty"` - Connects []string `mapstructure:"connects" yaml:",omitempty"` OutputFormat string `mapstructure:"output" yaml:",omitempty"` Properties []string `mapstructure:"properties" yaml:",omitempty"` SkipChecks bool `mapstructure:"skip-checks" yaml:",omitempty"` @@ -227,9 +225,6 @@ func (o *bindCmdOptions) run(cmd *cobra.Command, args []string) error { binding.Spec.Steps = append(binding.Spec.Steps, step) } } - for _, item := range o.Connects { - o.Traits = append(o.Traits, fmt.Sprintf("service-binding.services=%s", item)) - } if len(o.Traits) > 0 { if binding.Annotations == nil { @@ -472,23 +467,6 @@ func (o *bindCmdOptions) checkCompliance(cmd *cobra.Command, endpoint v1.Endpoin } return err } - if kamelet.Spec.Definition != nil && len(kamelet.Spec.Definition.Required) > 0 { - pMap, err := endpoint.Properties.GetPropertyMap() - if err != nil { - return err - } - for _, reqProp := range kamelet.Spec.Definition.Required { - found := false - if endpoint.Properties != nil { - if _, contains := pMap[reqProp]; contains { - found = true - } - } - if !found && len(o.Connects) == 0 { - return fmt.Errorf("binding is missing required property %q for Kamelet %q", reqProp, key.Name) - } - } - } } return nil } diff --git a/pkg/cmd/bind_test.go b/pkg/cmd/bind_test.go index 450f6aca3..a85eb00d6 100644 --- a/pkg/cmd/bind_test.go +++ b/pkg/cmd/bind_test.go @@ -177,7 +177,7 @@ status: {} func TestBindTraits(t *testing.T) { buildCmdOptions, bindCmd, _ := initializeBindCmdOptions(t) output, err := ExecuteCommand(bindCmd, cmdBind, "my:src", "my:dst", "-o", "yaml", - "-t", "mount.configs=configmap:my-cm", "-c", "my-service-binding") + "-t", "mount.configs=configmap:my-cm") assert.Equal(t, "yaml", buildCmdOptions.OutputFormat) require.NoError(t, err) @@ -187,7 +187,6 @@ metadata: annotations: camel.apache.org/operator.id: camel-k trait.camel.apache.org/mount.configs: configmap:my-cm - trait.camel.apache.org/service-binding.services: my-service-binding creationTimestamp: null name: my-to-my spec: diff --git a/pkg/cmd/run.go b/pkg/cmd/run.go index 505696681..b4ad0579e 100644 --- a/pkg/cmd/run.go +++ b/pkg/cmd/run.go @@ -82,9 +82,6 @@ func newCmdRun(rootCmdOptions *RootCmdOptions) (*cobra.Command, *runCmdOptions) cmd.Flags().String("name", "", "The integration name") cmd.Flags().String("image", "", "An image built externally (ie, via CICD). Enabling it will skip the Integration build phase.") - // Deprecated: service binding parameter won't be supported in future releases. - cmd.Flags().StringArrayP("connect", "c", nil, "A Service that the integration should bind to, specified as [[apigroup/]version:]kind:[namespace/]name."+ - "Deprecated: service binding won't be supported in future releases.") cmd.Flags().StringArrayP("dependency", "d", nil, `A dependency that should be included, e.g., "-d camel:mail" for a Camel component, "-d mvn:org.my:app:1.0" for a Maven dependency`) cmd.Flags().BoolP("wait", "w", false, "Wait for the integration to be running") cmd.Flags().StringP("kit", "k", "", "The kit used to run the integration") @@ -129,25 +126,23 @@ func newCmdRun(rootCmdOptions *RootCmdOptions) (*cobra.Command, *runCmdOptions) type runCmdOptions struct { *RootCmdOptions `json:"-"` - Compression bool `mapstructure:"compression" yaml:",omitempty"` - Wait bool `mapstructure:"wait" yaml:",omitempty"` - Logs bool `mapstructure:"logs" yaml:",omitempty"` - Sync bool `mapstructure:"sync" yaml:",omitempty"` - Dev bool `mapstructure:"dev" yaml:",omitempty"` - UseFlows bool `mapstructure:"use-flows" yaml:",omitempty"` - Save bool `mapstructure:"save" yaml:",omitempty" kamel:"omitsave"` - IntegrationKit string `mapstructure:"kit" yaml:",omitempty"` - IntegrationName string `mapstructure:"name" yaml:",omitempty"` - ContainerImage string `mapstructure:"image" yaml:",omitempty"` - Profile string `mapstructure:"profile" yaml:",omitempty"` - IntegrationProfile string `mapstructure:"integration-profile" yaml:",omitempty"` - OperatorID string `mapstructure:"operator-id" yaml:",omitempty"` - OutputFormat string `mapstructure:"output" yaml:",omitempty"` - PodTemplate string `mapstructure:"pod-template" yaml:",omitempty"` - ServiceAccount string `mapstructure:"service-account" yaml:",omitempty"` - // Deprecated: service binding parameter won't be supported in future releases. - Connects []string `mapstructure:"connects" yaml:",omitempty"` - Resources []string `mapstructure:"resources" yaml:",omitempty"` + Compression bool `mapstructure:"compression" yaml:",omitempty"` + Wait bool `mapstructure:"wait" yaml:",omitempty"` + Logs bool `mapstructure:"logs" yaml:",omitempty"` + Sync bool `mapstructure:"sync" yaml:",omitempty"` + Dev bool `mapstructure:"dev" yaml:",omitempty"` + UseFlows bool `mapstructure:"use-flows" yaml:",omitempty"` + Save bool `mapstructure:"save" yaml:",omitempty" kamel:"omitsave"` + IntegrationKit string `mapstructure:"kit" yaml:",omitempty"` + IntegrationName string `mapstructure:"name" yaml:",omitempty"` + ContainerImage string `mapstructure:"image" yaml:",omitempty"` + Profile string `mapstructure:"profile" yaml:",omitempty"` + IntegrationProfile string `mapstructure:"integration-profile" yaml:",omitempty"` + OperatorID string `mapstructure:"operator-id" yaml:",omitempty"` + OutputFormat string `mapstructure:"output" yaml:",omitempty"` + PodTemplate string `mapstructure:"pod-template" yaml:",omitempty"` + ServiceAccount string `mapstructure:"service-account" yaml:",omitempty"` + Resources []string `mapstructure:"resources" yaml:",omitempty"` // Deprecated: openapi parameter won't be supported in future releases. OpenAPIs []string `mapstructure:"open-apis" yaml:",omitempty"` Dependencies []string `mapstructure:"dependencies" yaml:",omitempty"` @@ -750,9 +745,6 @@ func (o *runCmdOptions) convertOptionsToTraits(cmd *cobra.Command, c client.Clie for _, item := range o.EnvVars { o.Traits = append(o.Traits, fmt.Sprintf("environment.vars=%s", item)) } - for _, item := range o.Connects { - o.Traits = append(o.Traits, fmt.Sprintf("service-binding.services=%s", item)) - } return nil } diff --git a/pkg/trait/mount.go b/pkg/trait/mount.go index e3a3c0744..65247e11e 100644 --- a/pkg/trait/mount.go +++ b/pkg/trait/mount.go @@ -63,8 +63,6 @@ func (t *mountTrait) Configure(e *Environment) (bool, *TraitCondition, error) { if e.Integration == nil || !e.IntegrationInRunningPhases() { return false, nil, nil } - // Look for secrets which may have been created by service binding trait - t.addServiceBindingSecret(e) // Validate resources and pvcs for _, c := range t.Configs { @@ -278,14 +276,6 @@ func (t *mountTrait) mountResource(vols *[]corev1.Volume, mnts *[]corev1.VolumeM return mnt.MountPath } -func (t *mountTrait) addServiceBindingSecret(e *Environment) { - e.Resources.VisitSecret(func(secret *corev1.Secret) { - if secret.Labels[serviceBindingLabel] == boolean.TrueString { - t.Configs = append(t.Configs, "secret:"+secret.Name) - } - }) -} - // ParseEmptyDirVolume will parse and return an empty-dir volume. func ParseEmptyDirVolume(item string) (*corev1.Volume, *corev1.VolumeMount, error) { volumeParts := strings.Split(item, ":") diff --git a/pkg/trait/service_binding.go b/pkg/trait/service_binding.go deleted file mode 100644 index ce790e8ae..000000000 --- a/pkg/trait/service_binding.go +++ /dev/null @@ -1,245 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package trait - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/dynamic" - "k8s.io/utils/ptr" - - sb "github.com/redhat-developer/service-binding-operator/apis/binding/v1alpha1" - "github.com/redhat-developer/service-binding-operator/pkg/client/kubernetes" - "github.com/redhat-developer/service-binding-operator/pkg/reconcile/pipeline" - "github.com/redhat-developer/service-binding-operator/pkg/reconcile/pipeline/context" - "github.com/redhat-developer/service-binding-operator/pkg/reconcile/pipeline/handler/collect" - "github.com/redhat-developer/service-binding-operator/pkg/reconcile/pipeline/handler/mapping" - "github.com/redhat-developer/service-binding-operator/pkg/reconcile/pipeline/handler/naming" - - v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1" - traitv1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1/trait" - "github.com/apache/camel-k/v2/pkg/util/boolean" - "github.com/apache/camel-k/v2/pkg/util/camel" - "github.com/apache/camel-k/v2/pkg/util/reference" -) - -const ( - serviceBindingTraitID = "service-binding" - serviceBindingTraitOrder = 250 - - serviceBindingMountPointAnnotation = "camel.apache.org/serviceBinding.mount-point" - serviceBindingLabel = "camel.apache.org/serviceBinding" -) - -var handlers = []pipeline.Handler{ - pipeline.HandlerFunc(collect.PreFlight), - pipeline.HandlerFunc(collect.ProvisionedService), - pipeline.HandlerFunc(collect.BindingDefinitions), - pipeline.HandlerFunc(collect.BindingItems), - pipeline.HandlerFunc(collect.OwnedResources), - pipeline.HandlerFunc(mapping.Handle), - pipeline.HandlerFunc(naming.Handle), -} - -type serviceBindingTrait struct { - BaseTrait - traitv1.ServiceBindingTrait `property:",squash"` -} - -func newServiceBindingTrait() Trait { - return &serviceBindingTrait{ - BaseTrait: NewBaseTrait(serviceBindingTraitID, serviceBindingTraitOrder), - } -} - -func (t *serviceBindingTrait) Configure(e *Environment) (bool, *TraitCondition, error) { - if e.Integration == nil { - return false, nil, nil - } - if !ptr.Deref(t.Enabled, true) { - return false, NewIntegrationConditionUserDisabled("ServiceBinding"), nil - } - if len(t.Services) == 0 { - return false, nil, nil - } - - var condition *TraitCondition - enabled := e.IntegrationInPhase(v1.IntegrationPhaseInitialization) || e.IntegrationInRunningPhases() - if enabled { - condition = NewIntegrationCondition( - "ServiceBinding", - v1.IntegrationConditionTraitInfo, - corev1.ConditionTrue, - TraitConfigurationReason, - "ServiceBinding trait is deprecated as the Service Binding Operator is no longer supported. It may be removed in future version.", - ) - } - - return enabled, condition, nil -} - -func (t *serviceBindingTrait) Apply(e *Environment) error { - ctx, err := t.getContext(e) - if err != nil { - return err - } - // let the SBO retry policy be controlled by Camel-k - err = process(ctx, handlers) - if err != nil { - return err - } - - if e.CamelCatalog.Runtime.Capabilities["service-binding"].RuntimeProperties != nil { - t.setCatalogConfiguration(e) - } else { - t.setProperties(e) - } - - secret := createSecret(ctx, e.Integration.Namespace, e.Integration.Name) - if secret != nil { - e.Resources.Add(secret) - } - - return nil -} - -func (t *serviceBindingTrait) setCatalogConfiguration(e *Environment) { - if e.ApplicationProperties == nil { - e.ApplicationProperties = make(map[string]string) - } - e.ApplicationProperties["camel.k.serviceBinding.enabled"] = boolean.TrueString - for _, cp := range e.CamelCatalog.Runtime.Capabilities["service-binding"].RuntimeProperties { - e.ApplicationProperties[CapabilityPropertyKey(cp.Key, e.ApplicationProperties)] = cp.Value - } -} - -// Deprecated: to be removed in future release in favor of func setCatalogConfiguration(). -func (t *serviceBindingTrait) setProperties(e *Environment) { - if e.ApplicationProperties == nil { - e.ApplicationProperties = make(map[string]string) - } - e.ApplicationProperties["quarkus.kubernetes-service-binding.enabled"] = boolean.TrueString -} - -func (t *serviceBindingTrait) getContext(e *Environment) (pipeline.Context, error) { - services, err := t.parseServices(e.Integration.Namespace) - if err != nil { - return nil, err - } - serviceBinding := createServiceBinding(e, services, e.Integration.Name) - dyn, err := dynamic.NewForConfig(e.Client.GetConfig()) - if err != nil { - return nil, err - } - ctxProvider := context.Provider(dyn, e.Client.AuthorizationV1().SubjectAccessReviews(), kubernetes.ResourceLookup(e.Client.RESTMapper())) - ctx, err := ctxProvider.Get(serviceBinding) - if err != nil { - return nil, err - } - return ctx, nil -} - -func (t *serviceBindingTrait) parseServices(ns string) ([]sb.Service, error) { - services := make([]sb.Service, 0) - converter := reference.NewConverter("") - for _, s := range t.Services { - ref, err := converter.FromString(s) - if err != nil { - return services, err - } - namespace := ns - if ref.Namespace != "" { - namespace = ref.Namespace - } - service := sb.Service{ - NamespacedRef: sb.NamespacedRef{ - Ref: sb.Ref{ - Group: ref.GroupVersionKind().Group, - Version: ref.GroupVersionKind().Version, - Kind: ref.Kind, - Name: ref.Name, - }, - Namespace: &namespace, - }, - } - services = append(services, service) - } - return services, nil -} - -func process(ctx pipeline.Context, handlers []pipeline.Handler) error { - var status pipeline.FlowStatus - for _, h := range handlers { - h.Handle(ctx) - status = ctx.FlowStatus() - if status.Stop { - break - } - } - - return status.Err -} - -func createServiceBinding(e *Environment, services []sb.Service, name string) *sb.ServiceBinding { - spec := sb.ServiceBindingSpec{ - NamingStrategy: "none", - Services: services, - } - labels := map[string]string{ - v1.IntegrationLabel: e.Integration.Name, - } - return &sb.ServiceBinding{ - TypeMeta: metav1.TypeMeta{ - Kind: "ServiceBinding", - APIVersion: "binding.operators.coreos.com/v1alpha1", - }, - ObjectMeta: metav1.ObjectMeta{ - Namespace: e.Integration.Namespace, - Name: name, - Labels: labels, - }, - Spec: spec, - } -} - -func createSecret(ctx pipeline.Context, ns, integrationName string) *corev1.Secret { - name := ctx.BindingSecretName() - items := ctx.BindingItems() - data := items.AsMap() - if len(data) == 0 { - return nil - } - return &corev1.Secret{ - TypeMeta: metav1.TypeMeta{ - Kind: "Secret", - APIVersion: corev1.SchemeGroupVersion.String(), - }, - ObjectMeta: metav1.ObjectMeta{ - Namespace: ns, - Name: name, - Labels: map[string]string{ - v1.IntegrationLabel: integrationName, - serviceBindingLabel: boolean.TrueString, - }, - Annotations: map[string]string{ - serviceBindingMountPointAnnotation: camel.ServiceBindingsMountPath, - }, - }, - StringData: data, - } -} diff --git a/pkg/trait/service_binding_test.go b/pkg/trait/service_binding_test.go deleted file mode 100644 index ee00d87c2..000000000 --- a/pkg/trait/service_binding_test.go +++ /dev/null @@ -1,93 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package trait - -import ( - "testing" - - "github.com/redhat-developer/service-binding-operator/pkg/reconcile/pipeline" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1" - "github.com/apache/camel-k/v2/pkg/internal" - "github.com/apache/camel-k/v2/pkg/util/boolean" - "github.com/apache/camel-k/v2/pkg/util/camel" -) - -func TestServiceBinding(t *testing.T) { - sbTrait, environment := createNominalServiceBindingTest() - sbTrait.Services = []string{ - "ConfigMap:default/my-service-name", - } - configured, condition, err := sbTrait.Configure(environment) - - assert.True(t, configured) - require.NoError(t, err) - assert.NotNil(t, condition) - assert.Equal(t, "ServiceBinding trait is deprecated as the Service Binding Operator is no longer supported. It may be removed in future version.", - condition.message) - - // Required for local testing purposes only - handlers = []pipeline.Handler{} - err = sbTrait.Apply(environment) - require.NoError(t, err) - assert.Equal(t, boolean.TrueString, environment.ApplicationProperties["camel.k.serviceBinding.enabled"]) - assert.Equal(t, "${camel.k.serviceBinding.enabled}", environment.ApplicationProperties["quarkus.kubernetes-service-binding.enabled"]) - // TODO we should make the service binding trait to easily work with fake client - // and test the apply secret in the environment accordingly. -} - -func createNominalServiceBindingTest() (*serviceBindingTrait, *Environment) { - trait, _ := newServiceBindingTrait().(*serviceBindingTrait) - client, _ := internal.NewFakeClient() - catalog := NewCatalog(client) - c, err := camel.DefaultCatalog() - if err != nil { - panic(err) - } - environment := &Environment{ - Client: client, - Catalog: catalog, - CamelCatalog: c, - Integration: &v1.Integration{ - Spec: v1.IntegrationSpec{ - Sources: []v1.SourceSpec{ - { - Language: v1.LanguageJavaSource, - }, - }, - }, - Status: v1.IntegrationStatus{ - Phase: v1.IntegrationPhaseInitialization, - }, - }, - IntegrationKit: &v1.IntegrationKit{}, - Pipeline: []v1.Task{ - { - Builder: &v1.BuilderTask{}, - }, - { - Package: &v1.BuilderTask{}, - }, - }, - Platform: &v1.IntegrationPlatform{}, - } - - return trait, environment -} diff --git a/pkg/trait/trait_configure_test.go b/pkg/trait/trait_configure_test.go index a9bfbdf75..5e5d76d7d 100644 --- a/pkg/trait/trait_configure_test.go +++ b/pkg/trait/trait_configure_test.go @@ -178,8 +178,8 @@ func TestTraitListConfigurationFromAnnotations(t *testing.T) { Integration: &v1.Integration{ ObjectMeta: metav1.ObjectMeta{ Annotations: map[string]string{ - v1.TraitAnnotationPrefix + "jolokia.options": `["opt1", "opt2"]`, - v1.TraitAnnotationPrefix + "service-binding.services": `Binding:xxx`, // lenient + v1.TraitAnnotationPrefix + "jolokia.options": `["opt1", "opt2"]`, + v1.TraitAnnotationPrefix + "camel.runtime-version": "1.2.3", }, }, Spec: v1.IntegrationSpec{ @@ -191,8 +191,8 @@ func TestTraitListConfigurationFromAnnotations(t *testing.T) { require.NoError(t, c.Configure(&env)) jt, _ := c.GetTrait("jolokia").(*jolokiaTrait) assert.Equal(t, []string{"opt1", "opt2"}, jt.Options) - sbt, _ := c.GetTrait("service-binding").(*serviceBindingTrait) - assert.Equal(t, []string{"Binding:xxx"}, sbt.Services) + cml, _ := c.GetTrait("camel").(*camelTrait) + assert.Equal(t, "1.2.3", cml.RuntimeVersion) } func TestTraitSplitConfiguration(t *testing.T) { diff --git a/pkg/trait/trait_register.go b/pkg/trait/trait_register.go index e21402783..a0f8544fe 100644 --- a/pkg/trait/trait_register.go +++ b/pkg/trait/trait_register.go @@ -53,7 +53,6 @@ func init() { AddToTraits(newRouteTrait) AddToTraits(newSecurityContextTrait) AddToTraits(newServiceTrait) - AddToTraits(newServiceBindingTrait) AddToTraits(NewTelemetryTrait) AddToTraits(newTolerationTrait) // ^^ Declaration order is not important, but let's keep them sorted for debugging.