diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 19570fe6a7..9b6bf2b41d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -84,7 +84,8 @@ jobs: tag_name: ${{ env.VERSION }} release_name: Release ${{ env.VERSION }} body: | - Apache Camel K ${{ env.VERSION }} build for testing (unstable). + Apache Camel K ${{ env.VERSION }} build for testing (unstable). This nightly release is using + an **unsupported** operator image published as `${{ env.IMAGE_NAME }}:${{ env.VERSION }}` To test it, download the client for your OS and run: @@ -94,6 +95,7 @@ jobs: draft: false prerelease: true + allowUpdates: true - name: Upload Client Linux uses: actions/upload-release-asset@v1 env: diff --git a/.mvn/wrapper/MavenWrapperDownloader.java b/.mvn/wrapper/MavenWrapperDownloader.java deleted file mode 100755 index fa4f7b499f..0000000000 --- a/.mvn/wrapper/MavenWrapperDownloader.java +++ /dev/null @@ -1,110 +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. -*/ - -import java.net.*; -import java.io.*; -import java.nio.channels.*; -import java.util.Properties; - -public class MavenWrapperDownloader { - - /** - * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. - */ - private static final String DEFAULT_DOWNLOAD_URL = - "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"; - - /** - * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to - * use instead of the default one. - */ - private static final String MAVEN_WRAPPER_PROPERTIES_PATH = - ".mvn/wrapper/maven-wrapper.properties"; - - /** - * Path where the maven-wrapper.jar will be saved to. - */ - private static final String MAVEN_WRAPPER_JAR_PATH = - ".mvn/wrapper/maven-wrapper.jar"; - - /** - * Name of the property which should be used to override the default download url for the wrapper. - */ - private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; - - public static void main(String args[]) { - System.out.println("- Downloader started"); - File baseDirectory = new File(args[0]); - System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); - - // If the maven-wrapper.properties exists, read it and check if it contains a custom - // wrapperUrl parameter. - File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); - String url = DEFAULT_DOWNLOAD_URL; - if(mavenWrapperPropertyFile.exists()) { - FileInputStream mavenWrapperPropertyFileInputStream = null; - try { - mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); - Properties mavenWrapperProperties = new Properties(); - mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); - url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); - } catch (IOException e) { - System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); - } finally { - try { - if(mavenWrapperPropertyFileInputStream != null) { - mavenWrapperPropertyFileInputStream.close(); - } - } catch (IOException e) { - // Ignore ... - } - } - } - System.out.println("- Downloading from: : " + url); - - File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); - if(!outputFile.getParentFile().exists()) { - if(!outputFile.getParentFile().mkdirs()) { - System.out.println( - "- ERROR creating output direcrory '" + outputFile.getParentFile().getAbsolutePath() + "'"); - } - } - System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); - try { - downloadFileFromURL(url, outputFile); - System.out.println("Done"); - System.exit(0); - } catch (Throwable e) { - System.out.println("- Error downloading"); - e.printStackTrace(); - System.exit(1); - } - } - - private static void downloadFileFromURL(String urlString, File destination) throws Exception { - URL website = new URL(urlString); - ReadableByteChannel rbc; - rbc = Channels.newChannel(website.openStream()); - FileOutputStream fos = new FileOutputStream(destination); - fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); - fos.close(); - rbc.close(); - } - -} diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar deleted file mode 100755 index 01e6799737..0000000000 Binary files a/.mvn/wrapper/maven-wrapper.jar and /dev/null differ diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties deleted file mode 100755 index d6f02e60b8..0000000000 --- a/.mvn/wrapper/maven-wrapper.properties +++ /dev/null @@ -1 +0,0 @@ -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f45bcd8ab..a63963b5b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,11 +6,16 @@ **Closed issues:** +- Use Kubernetes recommended labels [\#3137](https://github.com/apache/camel-k/issues/3137) +- Nightly release fail to create an existing tag [\#3130](https://github.com/apache/camel-k/issues/3130) - Jsonata does not evaluate correctly [\#3129](https://github.com/apache/camel-k/issues/3129) - Best practice to manage multiple routes in Camel-K [\#2824](https://github.com/apache/camel-k/issues/2824) - way to add a trusted root cert? \(non-maven\) [\#2820](https://github.com/apache/camel-k/issues/2820) - Be able to configure PodMonitor via prometheus trait [\#2812](https://github.com/apache/camel-k/issues/2812) - SEDA low performance issue [\#2808](https://github.com/apache/camel-k/issues/2808) +- Remove maven wrapper and any leftover pom.xml [\#2659](https://github.com/apache/camel-k/issues/2659) +- Document how to use Camel K without the "kamel" tool [\#52](https://github.com/apache/camel-k/issues/52) +- Add roadmap information [\#35](https://github.com/apache/camel-k/issues/35) ## [1.9.0-nightly](https://github.com/apache/camel-k/tree/1.9.0-nightly) (2022-03-14) @@ -980,7 +985,6 @@ - Multiple of the examples fail on Minikube [\#2537](https://github.com/apache/camel-k/issues/2537) - Camel-K - uninstall and namespace deletion w/ k8s let all Camel-K Integrations in this namespace alive [\#2533](https://github.com/apache/camel-k/issues/2533) - insecure=true does not work with base image [\#2531](https://github.com/apache/camel-k/issues/2531) -- Reduce time for first Integration start [\#2520](https://github.com/apache/camel-k/issues/2520) - Install Error [\#2498](https://github.com/apache/camel-k/issues/2498) - Make sure Camel K runs on Microshift [\#2473](https://github.com/apache/camel-k/issues/2473) - If the pod is in CrashLoopBackOff, the phase is reported as Running [\#2445](https://github.com/apache/camel-k/issues/2445) diff --git a/build/maven/pom-catalog.xml b/build/maven/pom-catalog.xml deleted file mode 100644 index 9e09c6ce7e..0000000000 --- a/build/maven/pom-catalog.xml +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - 4.0.0 - org.apache.camel.k - camel-k-catalog-generator - 1.0.0 - - - generate-resources - - - org.apache.camel.k - camel-k-maven-plugin - ${runtime.version} - - - generate-catalog - - generate-catalog - - - - - - - - - - staging - - - staging.repo - - - - - staging - ${staging.repo} - - true - - - false - - - - - - staging - ${staging.repo} - - true - - - false - - - - - - - - - apache.snapshots - https://repository.apache.org/content/repositories/snapshots/ - - false - - - true - - - - oss.snapshots - https://oss.sonatype.org/content/repositories/snapshots - - false - - - true - - - - - - - apache.snapshots - https://repository.apache.org/content/repositories/snapshots/ - - false - - - true - - - - oss.snapshots - https://oss.sonatype.org/content/repositories/snapshots - - false - - - true - - - - - diff --git a/build/maven/pom-runtime.xml b/build/maven/pom-runtime.xml deleted file mode 100644 index a900a89ab1..0000000000 --- a/build/maven/pom-runtime.xml +++ /dev/null @@ -1,235 +0,0 @@ - - - - - - 4.0.0 - org.apache.camel.k - camel-k-runtime-builder - 1.0.0 - - - - org.apache.camel.k - camel-k-maven-plugin - ${runtime.version} - maven-plugin - - - org.apache.camel.k - camel-k-runtime-bom - ${runtime.version} - pom - - - - - org.apache.camel.k - camel-k-runtime - ${runtime.version} - - - org.apache.camel.k - camel-k-runtime-deployment - ${runtime.version} - - - org.apache.camel.k - camel-knative-api - ${runtime.version} - - - org.apache.camel.k - camel-knative - ${runtime.version} - - - org.apache.camel.k - camel-k-knative-consumer - ${runtime.version} - - - org.apache.camel.k - camel-k-knative-consumer-deployment - ${runtime.version} - - - org.apache.camel.k - camel-k-knative-producer - ${runtime.version} - - - org.apache.camel.k - camel-k-knative-producer-deployment - ${runtime.version} - - - org.apache.camel.k - camel-knative-http - ${runtime.version} - - - org.apache.camel.k - camel-k-core - ${runtime.version} - - - org.apache.camel.k - camel-k-core-deployment - ${runtime.version} - - - org.apache.camel.k - camel-k-knative - ${runtime.version} - - - org.apache.camel.k - camel-k-knative-deployment - ${runtime.version} - - - org.apache.camel.k - camel-k-master - ${runtime.version} - - - org.apache.camel.k - camel-k-master-deployment - ${runtime.version} - - - org.apache.camel.k - camel-k-cron - ${runtime.version} - - - org.apache.camel.k - camel-k-cron-deployment - ${runtime.version} - - - org.apache.camel.k - camel-k-core-support - ${runtime.version} - - - - - - - apache.snapshots - Apache Development Snapshot Repository - https://repository.apache.org/content/repositories/snapshots/ - - false - - - true - - - - oss.snapshots - https://oss.sonatype.org/content/repositories/snapshots - - false - - - true - - - - - - - apache.snapshots - Apache Development Snapshot Repository - https://repository.apache.org/content/repositories/snapshots/ - - false - - - true - - - - oss.snapshots - https://oss.sonatype.org/content/repositories/snapshots - - false - - - true - - - - - - - staging - - - staging.repo - - - - - - staging - ${staging.repo} - - true - - - false - - - - - - - staging - ${staging.repo} - - true - - - false - - - - - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - 3.1.1 - - true - true - true - - - - - - diff --git a/config/manager/operator-deployment.yaml b/config/manager/operator-deployment.yaml index f788171993..7c3fbcbd5b 100644 --- a/config/manager/operator-deployment.yaml +++ b/config/manager/operator-deployment.yaml @@ -22,6 +22,10 @@ metadata: labels: app: "camel-k" camel.apache.org/component: operator + name: camel-k-operator + app.kubernetes.io/component: operator + app.kubernetes.io/name: camel-k + app.kubernetes.io/version: "1.8.2" spec: replicas: 1 strategy: @@ -35,6 +39,9 @@ spec: name: camel-k-operator camel.apache.org/component: operator app: "camel-k" + app.kubernetes.io/component: operator + app.kubernetes.io/name: camel-k + app.kubernetes.io/version: "1.8.2" spec: serviceAccountName: camel-k-operator containers: diff --git a/docs/modules/ROOT/pages/contributing/e2e.adoc b/docs/modules/ROOT/pages/contributing/e2e.adoc index 49ac4e76ea..6b25a655df 100644 --- a/docs/modules/ROOT/pages/contributing/e2e.adoc +++ b/docs/modules/ROOT/pages/contributing/e2e.adoc @@ -44,11 +44,11 @@ make images The script will take care to build the operator docker image and push to the underlying docker daemon registry. At this stage, the cluster will be able to pickup this latest image when it executes the tests. -You can also execute the following script, if by any chance you have some change applied to the `camel-k-runtime`: +You can also execute the following script, if by any chance you have some change applied to the `camel-k-runtime`. You can optionally point to your local Camel K runtime project directory if you need to install any SNAPSHOT dependency: [source] ---- -make images-dev +make images-dev [CAMEL_K_RUNTIME_DIR=/path/to/camel-k-runtime-project] ---- [[using-nexus]] diff --git a/docs/modules/ROOT/pages/troubleshooting/debugging.adoc b/docs/modules/ROOT/pages/troubleshooting/debugging.adoc index 1ff6903fd8..0b06d75c36 100644 --- a/docs/modules/ROOT/pages/troubleshooting/debugging.adoc +++ b/docs/modules/ROOT/pages/troubleshooting/debugging.adoc @@ -59,6 +59,6 @@ When the debugging session is done, hitting kbd:[Ctrl+c] on the terminal where t As we've seen in the previous section, all `Integration` created in Camel K are finally bundled as a Java application, hence, the possibility to debug via JVM debugger. Any `Kamelet` you will be using directly in your `Route` definition or in a `KameletBinding` is automatically converted in a `yaml` route and injected in the Camel Context to be executed. That means that you cannot directly debug a `Kamelet` as you would do with a Java or any other JVM language `Route`. -However, you can troubleshoot individually each `Kamelet` definition by focusing on the specification xref:kamelets/kamelets-user.adoc#_flow[`Flow`]. As an example, you can create a simple xref:languages:yaml.adoc[`yaml`] test `Route` substituting the `kamelet:source` or `kamelet:sink` with any mock endpoint that can help you debugging the single `Kamelet` flow. Even using a `timer` and a `log` component may be enough for a basic check. +However, you can troubleshoot individually each `Kamelet` definition by focusing on the specification xref:kamelets/kamelets-user.adoc#_flow[`Flow`]. As an example, you can create a simple `yaml` test `Route` substituting the `kamelet:source` or `kamelet:sink` with any mock endpoint that can help you debugging the single `Kamelet` flow. Even using a `timer` and a `log` component may be enough for a basic check. NOTE: the same idea applies for a `KameletBinding` which translates to an `Integration` type under the hood. If you need to debug a `KameletBinding` just apply the same troubleshooting technique you would apply on an `Integration`. diff --git a/e2e/builder/global_test.go b/e2e/builder/global_test.go index 52053181ed..8eb8e83268 100644 --- a/e2e/builder/global_test.go +++ b/e2e/builder/global_test.go @@ -53,7 +53,7 @@ func TestRunGlobalInstall(t *testing.T) { WithGlobalOperatorNamespace(t, func(operatorNamespace string) { Expect(Kamel("install", "-n", operatorNamespace, "--global", "--force").Execute()).To(Succeed()) - + Eventually(OperatorPodPhase(operatorNamespace), TestTimeoutMedium).Should(Equal(corev1.PodRunning)) t.Run("Global test on namespace with platform", func(t *testing.T) { WithNewTestNamespace(t, func(ns2 string) { // Creating platform @@ -74,12 +74,18 @@ func TestRunGlobalInstall(t *testing.T) { t.Run("Global test on namespace with its own operator", func(t *testing.T) { WithNewTestNamespace(t, func(ns3 string) { - Expect(Kamel("install", "-n", ns3, "--olm=false").Execute()).To(Succeed()) - + if NoOlmOperatorImage != "" { + Expect(Kamel("install", "-n", ns3, "--olm=false", "--operator-image", NoOlmOperatorImage).Execute()).To(Succeed()) + } else { + Expect(Kamel("install", "-n", ns3, "--olm=false").Execute()).To(Succeed()) + } + Eventually(OperatorPodPhase(ns3), TestTimeoutMedium).Should(Equal(corev1.PodRunning)) Expect(Kamel("run", "-n", ns3, "files/Java.java").Execute()).To(Succeed()) Eventually(IntegrationPodPhase(ns3, "java"), TestTimeoutMedium).Should(Equal(corev1.PodRunning)) Eventually(IntegrationLogs(ns3, "java"), TestTimeoutShort).Should(ContainSubstring("Magicstring!")) Expect(IntegrationConditionMessage(IntegrationCondition(ns3, "java", v1.IntegrationConditionPlatformAvailable)())).To(MatchRegexp(ns3 + "\\/.*")) + kit := IntegrationKit(ns3, "java")() + Expect(Kits(ns3)()).Should(WithTransform(integrationKitsToNamesTransform(), ContainElement(kit))) Expect(Kamel("delete", "--all", "-n", ns3).Execute()).To(Succeed()) Expect(Lease(ns3, platform.OperatorLockName)()).ShouldNot(BeNil(), diff --git a/e2e/support/test_support.go b/e2e/support/test_support.go index c57c081063..b964f8a51b 100644 --- a/e2e/support/test_support.go +++ b/e2e/support/test_support.go @@ -91,6 +91,7 @@ const kubeConfigEnvVar = "KUBECONFIG" var TestTimeoutShort = 1 * time.Minute var TestTimeoutMedium = 5 * time.Minute var TestTimeoutLong = 10 * time.Minute +var NoOlmOperatorImage string var TestContext context.Context var testClient client.Client @@ -165,6 +166,14 @@ func init() { } } + if imageNoOlm, ok := os.LookupEnv("CAMEL_K_TEST_NO_OLM_OPERATOR_IMAGE"); ok { + if imageNoOlm != "" { + NoOlmOperatorImage = imageNoOlm + } else { + fmt.Printf("Can't parse CAMEL_K_TEST_NO_OLM_OPERATOR_IMAGE. Using default value from kamel") + } + } + if value, ok := os.LookupEnv("CAMEL_K_TEST_TIMEOUT_LONG"); ok { if duration, err = time.ParseDuration(value); err == nil { TestTimeoutLong = duration diff --git a/go.mod b/go.mod index f7f80ed65a..a2b9d382e8 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/magiconair/properties v1.8.6 github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/mapstructure v1.4.3 - github.com/onsi/gomega v1.16.0 + github.com/onsi/gomega v1.19.0 github.com/openshift/api v3.9.1-0.20190927182313-d4a64ec2cbd8+incompatible github.com/operator-framework/api v0.3.8 github.com/pkg/errors v0.9.1 @@ -34,7 +34,7 @@ require ( github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd github.com/sirupsen/logrus v1.8.1 - github.com/spf13/cobra v1.2.1 + github.com/spf13/cobra v1.4.0 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.10.1 github.com/stoewer/go-strcase v1.2.0 diff --git a/go.sum b/go.sum index 750c9421ba..a6d478ab83 100644 --- a/go.sum +++ b/go.sum @@ -673,6 +673,7 @@ github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= @@ -945,6 +946,8 @@ github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9k github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.1.3 h1:e/3Cwtogj0HA+25nMP1jCMDIf8RtRYbGwGGuBIFztkc= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -957,8 +960,10 @@ github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/onsi/gomega v1.10.4/go.mod h1:g/HbgYopi++010VEqkFgJHKC09uJiW9UkXvMUuKHUCQ= github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= -github.com/onsi/gomega v1.16.0 h1:6gjqkI8iiRHMvdccRJM8rVKjCWk6ZIm6FTm3ddIe4/c= github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -1135,8 +1140,9 @@ github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tL github.com/spf13/cobra v0.0.6/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= -github.com/spf13/cobra v1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw= github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= +github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q= +github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= @@ -1427,8 +1433,9 @@ golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211118161319-6a13c67c3ce4/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211216030914-fe4d6282115f h1:hEYJvxw1lSnWIl8X9ofsYMklzaDs90JI2az5YMd4fPM= golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1582,8 +1589,9 @@ golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b h1:9zKuko04nR4gjZ4+DNjHqRlAJqbJETHwiNKDqTfOjfE= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/mvnw b/mvnw deleted file mode 100755 index 5551fde8e7..0000000000 --- a/mvnw +++ /dev/null @@ -1,286 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------------------- -# 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. -# ---------------------------------------------------------------------------- - -# ---------------------------------------------------------------------------- -# Maven2 Start Up Batch script -# -# Required ENV vars: -# ------------------ -# JAVA_HOME - location of a JDK home dir -# -# Optional ENV vars -# ----------------- -# M2_HOME - location of maven2's installed home dir -# MAVEN_OPTS - parameters passed to the Java VM when running Maven -# e.g. to debug Maven itself, use -# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -# MAVEN_SKIP_RC - flag to disable loading of mavenrc files -# ---------------------------------------------------------------------------- - -if [ -z "$MAVEN_SKIP_RC" ] ; then - - if [ -f /etc/mavenrc ] ; then - . /etc/mavenrc - fi - - if [ -f "$HOME/.mavenrc" ] ; then - . "$HOME/.mavenrc" - fi - -fi - -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -mingw=false -case "`uname`" in - CYGWIN*) cygwin=true ;; - MINGW*) mingw=true;; - Darwin*) darwin=true - # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home - # See https://developer.apple.com/library/mac/qa/qa1170/_index.html - if [ -z "$JAVA_HOME" ]; then - if [ -x "/usr/libexec/java_home" ]; then - export JAVA_HOME="`/usr/libexec/java_home`" - else - export JAVA_HOME="/Library/Java/Home" - fi - fi - ;; -esac - -if [ -z "$JAVA_HOME" ] ; then - if [ -r /etc/gentoo-release ] ; then - JAVA_HOME=`java-config --jre-home` - fi -fi - -if [ -z "$M2_HOME" ] ; then - ## resolve links - $0 may be a link to maven's home - PRG="$0" - - # need this for relative symlinks - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi - done - - saveddir=`pwd` - - M2_HOME=`dirname "$PRG"`/.. - - # make it fully qualified - M2_HOME=`cd "$M2_HOME" && pwd` - - cd "$saveddir" - # echo Using m2 at $M2_HOME -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --unix "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` -fi - -# For Mingw, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$M2_HOME" ] && - M2_HOME="`(cd "$M2_HOME"; pwd)`" - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" - # TODO classpath? -fi - -if [ -z "$JAVA_HOME" ]; then - javaExecutable="`which javac`" - if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then - # readlink(1) is not available as standard on Solaris 10. - readLink=`which readlink` - if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then - if $darwin ; then - javaHome="`dirname \"$javaExecutable\"`" - javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" - else - javaExecutable="`readlink -f \"$javaExecutable\"`" - fi - javaHome="`dirname \"$javaExecutable\"`" - javaHome=`expr "$javaHome" : '\(.*\)/bin'` - JAVA_HOME="$javaHome" - export JAVA_HOME - fi - fi -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD="`which java`" - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." >&2 - echo " We cannot execute $JAVACMD" >&2 - exit 1 -fi - -if [ -z "$JAVA_HOME" ] ; then - echo "Warning: JAVA_HOME environment variable is not set." -fi - -CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher - -# traverses directory structure from process work directory to filesystem root -# first directory with .mvn subdirectory is considered project base directory -find_maven_basedir() { - - if [ -z "$1" ] - then - echo "Path not specified to find_maven_basedir" - return 1 - fi - - basedir="$1" - wdir="$1" - while [ "$wdir" != '/' ] ; do - if [ -d "$wdir"/.mvn ] ; then - basedir=$wdir - break - fi - # workaround for JBEAP-8937 (on Solaris 10/Sparc) - if [ -d "${wdir}" ]; then - wdir=`cd "$wdir/.."; pwd` - fi - # end of workaround - done - echo "${basedir}" -} - -# concatenates all lines of a file -concat_lines() { - if [ -f "$1" ]; then - echo "$(tr -s '\n' ' ' < "$1")" - fi -} - -BASE_DIR=`find_maven_basedir "$(pwd)"` -if [ -z "$BASE_DIR" ]; then - exit 1; -fi - -########################################################################################## -# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -# This allows using the maven wrapper in projects that prohibit checking in binary data. -########################################################################################## -if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found .mvn/wrapper/maven-wrapper.jar" - fi -else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." - fi - jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" - while IFS="=" read key value; do - case "$key" in (wrapperUrl) jarUrl="$value"; break ;; - esac - done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" - if [ "$MVNW_VERBOSE" = true ]; then - echo "Downloading from: $jarUrl" - fi - wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" - - if command -v wget > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found wget ... using wget" - fi - wget "$jarUrl" -O "$wrapperJarPath" - elif command -v curl > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found curl ... using curl" - fi - curl -o "$wrapperJarPath" "$jarUrl" - else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Falling back to using Java to download" - fi - javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" - if [ -e "$javaClass" ]; then - if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Compiling MavenWrapperDownloader.java ..." - fi - # Compiling the Java class - ("$JAVA_HOME/bin/javac" "$javaClass") - fi - if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - # Running the downloader - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Running MavenWrapperDownloader.java ..." - fi - ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") - fi - fi - fi -fi -########################################################################################## -# End of extension -########################################################################################## - -export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} -if [ "$MVNW_VERBOSE" = true ]; then - echo $MAVEN_PROJECTBASEDIR -fi -MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --path --windows "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - [ -n "$MAVEN_PROJECTBASEDIR" ] && - MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` -fi - -WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -exec "$JAVACMD" \ - $MAVEN_OPTS \ - -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ - "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ - ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/mvnw.cmd b/mvnw.cmd deleted file mode 100755 index 48363fa60b..0000000000 --- a/mvnw.cmd +++ /dev/null @@ -1,161 +0,0 @@ -@REM ---------------------------------------------------------------------------- -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. -@REM ---------------------------------------------------------------------------- - -@REM ---------------------------------------------------------------------------- -@REM Maven2 Start Up Batch script -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir -@REM -@REM Optional ENV vars -@REM M2_HOME - location of maven2's installed home dir -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files -@REM ---------------------------------------------------------------------------- - -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM set title of command window -title %0 -@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% - -@REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") - -@REM Execute a user defined script before this one -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre -@REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" -if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" -:skipRcPre - -@setlocal - -set ERROR_CODE=0 - -@REM To isolate internal variables from possible post scripts, we use another setlocal -@setlocal - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo Error: JAVA_HOME not found in your environment. >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -echo Error: JAVA_HOME is set to an invalid directory. >&2 -echo JAVA_HOME = "%JAVA_HOME%" >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -@REM ==== END VALIDATION ==== - -:init - -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". -@REM Fallback to current working directory if not found. - -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir - -set EXEC_DIR=%CD% -set WDIR=%EXEC_DIR% -:findBaseDir -IF EXIST "%WDIR%"\.mvn goto baseDirFound -cd .. -IF "%WDIR%"=="%CD%" goto baseDirNotFound -set WDIR=%CD% -goto findBaseDir - -:baseDirFound -set MAVEN_PROJECTBASEDIR=%WDIR% -cd "%EXEC_DIR%" -goto endDetectBaseDir - -:baseDirNotFound -set MAVEN_PROJECTBASEDIR=%EXEC_DIR% -cd "%EXEC_DIR%" - -:endDetectBaseDir - -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% - -:endReadAdditionalConfig - -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" -set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" -FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO ( - IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B -) - -@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -@REM This allows using the maven wrapper in projects that prohibit checking in binary data. -if exist %WRAPPER_JAR% ( - echo Found %WRAPPER_JAR% -) else ( - echo Couldn't find %WRAPPER_JAR%, downloading it ... - echo Downloading from: %DOWNLOAD_URL% - powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')" - echo Finished downloading %WRAPPER_JAR% -) -@REM End of extension - -%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* -if ERRORLEVEL 1 goto error -goto end - -:error -set ERROR_CODE=1 - -:end -@endlocal & set ERROR_CODE=%ERROR_CODE% - -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost -@REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" -if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" -:skipRcPost - -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%" == "on" pause - -if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% - -exit /B %ERROR_CODE% diff --git a/pkg/util/util_test.go b/pkg/util/util_test.go index 9b37a9ee40..adc6beb09d 100644 --- a/pkg/util/util_test.go +++ b/pkg/util/util_test.go @@ -32,4 +32,5 @@ func TestStringContainsPrefix(t *testing.T) { func TestRandomString(t *testing.T) { assert.Equal(t, 10, len(RandomString(10))) assert.NotEqual(t, RandomString(10), RandomString(10)) + } diff --git a/script/Makefile b/script/Makefile index 5b59efd233..9cd3ee7060 100644 --- a/script/Makefile +++ b/script/Makefile @@ -68,10 +68,6 @@ KAMELET_CATALOG_REPO := https://github.com/apache/camel-kamelets.git # Optional branch for the default Kamelet catalog (change this to a tag before release) KAMELET_CATALOG_REPO_BRANCH := v0.7.1 -# When packaging artifacts into the docker image, you can "copy" them from local maven -# or "download" them from Apache Snapshots and Maven Central -PACKAGE_ARTIFACTS_STRATEGY := copy - # OLM (Operator Lifecycle Manager and Operator Hub): uncomment to override operator settings at build time #GOLDFLAGS += -X github.com/apache/camel-k/pkg/util/olm.DefaultOperatorName=camel-k-operator #GOLDFLAGS += -X github.com/apache/camel-k/pkg/util/olm.DefaultPackage=camel-k @@ -162,7 +158,7 @@ codegen: gofmt -w pkg/util/defaults/defaults.go -generate: generate-deepcopy generate-crd generate-client generate-doc generate-json-schema generate-keda generate-strimzi +generate: generate-deepcopy generate-crd generate-client generate-doc generate-keda generate-strimzi generate-client: ./script/gen_client.sh @@ -176,10 +172,6 @@ generate-doc: generate-deepcopy: controller-gen cd pkg/apis/camel && $(CONTROLLER_GEN) paths="./..." object -generate-json-schema: - # Skip since the YAML DSL schema has been moved to apache/camel - #./script/gen_json_schema.sh $(RUNTIME_VERSION) $(STAGING_RUNTIME_REPO) - generate-keda: cd addons/keda/duck && $(CONTROLLER_GEN) paths="./..." object @@ -243,7 +235,7 @@ else endif build-resources: - ./script/build_catalog.sh $(RUNTIME_VERSION) -Dcatalog.file=camel-catalog-$(RUNTIME_VERSION).yaml -Dcatalog.runtime=quarkus -Dstaging.repo="$(STAGING_RUNTIME_REPO)" + ./script/get_catalog.sh $(RUNTIME_VERSION) go generate ./pkg/... bundle-kamelets: @@ -295,6 +287,7 @@ check-licenses: check-platform: ./script/check_platform.sh +# The below are dependencies needed for maven structured logs. We must bundle into the final container image. maven-overlay: mkdir -p build/_maven_overlay ./script/maven_overlay.sh build/_maven_overlay @@ -356,7 +349,8 @@ package-examples: ./script/package_examples.sh $(CUSTOM_VERSION) package-artifacts: - ./script/package_maven_artifacts.sh $(RUNTIME_VERSION) $(PACKAGE_ARTIFACTS_STRATEGY) $(STAGING_RUNTIME_REPO) + # useful for development purpose only in order to include any local development runtime dependency + ./script/package_maven_artifacts.sh $(RUNTIME_VERSION) $(CAMEL_K_RUNTIME_DIR) release: clean codegen set-module-version set-version build-resources check-licenses build images images-push cross-compile package-examples git-tag diff --git a/script/check_licenses.sh b/script/check_licenses.sh index ce7d5f3e59..85416caeac 100755 --- a/script/check_licenses.sh +++ b/script/check_licenses.sh @@ -18,7 +18,7 @@ location=$(dirname $0) rootdir=$location/../ -blacklist=("zz_generated" "zz_desc_generated" "./.mvn/wrapper" "./docs/" "./.idea" "./build/" "./resources/traits.yaml") +blacklist=("zz_generated" "zz_desc_generated" "./docs/" "./.idea" "./build/" "./resources/traits.yaml") cd $rootdir go build ./cmd/util/license-check/ diff --git a/script/gen_json_schema.sh b/script/gen_json_schema.sh deleted file mode 100755 index 5ea967aa66..0000000000 --- a/script/gen_json_schema.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -# 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. - -set -e - -location=$(dirname $0) -cd $location/.. - -version=$1 -repo=$2 - -[ -d "./tmpschema" ] && rm -r ./tmpschema -mkdir tmpschema - -./mvnw dependency:copy \ - -f build/maven/pom-catalog.xml \ - -Dartifact=org.apache.camel.k:camel-k-loader-yaml-impl:$version:json:json-schema \ - -DoutputDirectory=../../tmpschema \ - -Dmdep.stripVersion \ - -Druntime.version=$1 \ - -Dstaging.repo=$repo - -schema=./tmpschema/camel-k-loader-yaml-impl-json-schema.json - -go run ./cmd/util/json-schema-gen ./config/crd/bases/camel.apache.org_kamelets.yaml $schema .spec.flow false ./docs/modules/ROOT/assets/attachments/schema/kamelet-schema.json -go run ./cmd/util/json-schema-gen ./config/crd/bases/camel.apache.org_integrations.yaml $schema .spec.flows true ./docs/modules/ROOT/assets/attachments/schema/integration-schema.json - -rm -r ./tmpschema diff --git a/script/build_catalog.sh b/script/get_catalog.sh similarity index 73% rename from script/build_catalog.sh rename to script/get_catalog.sh index 6240655edb..6f038006f5 100755 --- a/script/build_catalog.sh +++ b/script/get_catalog.sh @@ -18,17 +18,10 @@ location=$(dirname $0) rootdir=$location/../ -if [ "$#" -ge 1 ]; then - runtimeVersion="$1" - shift 1 - $rootdir/mvnw -q \ - -f ${rootdir}/build/maven/pom-catalog.xml \ - -Dcatalog.path=${rootdir}/resources \ - -Druntime.version=$runtimeVersion \ - -B \ - -U \ - "$@" -else - echo "usage: $0 runtime.version catalog.runtime [staging.repo]" +if [ "$#" -lt 1 ]; then + echo "usage: $0 " exit 1 fi + +mvn dependency:copy -Dartifact="org.apache.camel.k:camel-k-catalog:$1:yaml:catalog" -DoutputDirectory=${rootdir}/resources/ + diff --git a/script/package_maven_artifacts.sh b/script/package_maven_artifacts.sh index 640eb49552..70449a5026 100755 --- a/script/package_maven_artifacts.sh +++ b/script/package_maven_artifacts.sh @@ -17,39 +17,46 @@ location=$(dirname $0) -if [ "$#" -lt 2 ] || [ "$#" -gt 3 ]; then - echo "usage: $0 version strategy [staging.repo]" +if [ "$#" -lt 1 ]; then + echo "usage: $0 []" exit 1 fi -version=$1 -strategy=$2 -staging_repo=$3 - -cd ${location}/.. - -if [ "$strategy" = "copy" ]; then - ./mvnw \ - -V \ - --no-transfer-progress \ - -f build/maven/pom-runtime.xml \ - -DoutputDirectory=$PWD/build/_maven_output \ - -Druntime.version=$version \ - -Dstaging.repo=$staging_repo \ - -Dalpn.jdk8.version="8.1.13.v20181017" \ - dependency:copy-dependencies -elif [ "$strategy" = "download" ]; then - ./mvnw \ - -V \ - --no-transfer-progress \ - -f build/maven/pom-runtime.xml \ - -Dmaven.repo.local=$PWD/build/_maven_output \ - -Druntime.version=$version \ - -Dstaging.repo=$staging_repo \ - -Dalpn.jdk8.version="8.1.13.v20181017" \ - install +camel_k_destination="$PWD/build/_maven_output" +camel_k_runtime_version=$1 + +if [ -z "$2" ]; then + is_snapshot=$(echo "$1" | grep "SNAPSHOT") + if [ "$is_snapshot" = "$1" ]; then + echo "You're trying to package SNAPSHOT artifacts. You probably wants them from your local environment, try calling:" + echo "$0 " + exit 3 + fi + + # Take the dependencies officially released + wget https://repo1.maven.org/maven2/org/apache/camel/k/apache-camel-k-runtime/$1/apache-camel-k-runtime-$1-source-release.zip -O $PWD/build/apache-camel-k-runtime-$1-source-release.zip + unzip -o $PWD/build/apache-camel-k-runtime-$1-source-release.zip -d $PWD/build + mvn -f $PWD/build/apache-camel-k-runtime-$1/pom.xml \ + dependency:copy-dependencies \ + -DincludeScope=runtime \ + -Dmdep.copyPom=true \ + -DoutputDirectory=$camel_k_destination \ + -Dmdep.useRepositoryLayout=true + rm -rf $PWD/build/apache-camel-k-runtime* else - echo "unknown strategy: $strategy" - exit 1 -fi + # Take the dependencies from a local development environment + camel_k_runtime_source=$2 + camel_k_runtime_source_version=$(mvn -f $camel_k_runtime_source/pom.xml help:evaluate -Dexpression=project.version -q -DforceStdout) + + if [ "$camel_k_runtime_version" != "$camel_k_runtime_source_version" ]; then + echo "Misaligned version. You're building Camel K project using $camel_k_runtime_version but trying to bundle dependencies from local Camel K runtime $camel_k_runtime_source_version" + exit 2 + fi + mvn -f $camel_k_runtime_source/pom.xml \ + dependency:copy-dependencies \ + -DincludeScope=runtime \ + -Dmdep.copyPom=true \ + -DoutputDirectory=$camel_k_destination \ + -Dmdep.useRepositoryLayout=true +fi diff --git a/script/set_version.sh b/script/set_version.sh index ff61ab6695..0d6dd1183f 100755 --- a/script/set_version.sh +++ b/script/set_version.sh @@ -26,14 +26,17 @@ location=$(dirname $0) version=$1 image_name=${2:-docker.io\/apache\/camel-k} sanitized_image_name=${image_name//\//\\\/} +k8s_version_label="app.kubernetes.io\/version" for f in $(find $location/../config/manager -type f -name "*.yaml"); do if [[ "$OSTYPE" == "linux-gnu"* ]]; then sed -i -r "s/image: .*/image: ${sanitized_image_name}:${version}/" $f + sed -i -r "s/${k8s_version_label}: .*/${k8s_version_label}: \""${version}"\"/" $f elif [[ "$OSTYPE" == "darwin"* ]]; then # Mac OSX sed -i '' -E "s/image: .*/image: ${sanitized_image_name}:${version}/" $f + sed -i '' -E "s/${k8s_version_label}: .*/${k8s_version_label}: \""${version}"\"/" $f fi done