Skip to content

Commit

Permalink
FUSETOOLS2-2163 - Upgrade to Camel K 2.1.0
Browse files Browse the repository at this point in the history
- remove command to deploy with a resource as it was provided only for
files and this feature has been deprecated in 2.0 and removed in 2.1
- the telemetry indicates that his feature was almost never used anyway
see apache/camel-k#4853 (comment)

Signed-off-by: Aurélien Pupier <apupier@redhat.com>
  • Loading branch information
apupier committed Oct 24, 2023
1 parent b21bf9d commit 5c1b2c3
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 153 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/insider.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
- name: Configure Kamel (ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
curl -Lo kamel.tar.gz https://github.com/apache/camel-k/releases/download/v2.0.0/camel-k-client-2.0.0-linux-64bit.tar.gz
curl -Lo kamel.tar.gz https://github.com/apache/camel-k/releases/download/v2.1.0/camel-k-client-2.1.0-linux-amd64.tar.gz
tar -zxvf kamel.tar.gz
chmod +x kamel
sudo mv kamel /usr/local/bin/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
- name: Configure Kamel (ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
curl -Lo kamel.tar.gz https://github.com/apache/camel-k/releases/download/v2.0.0/camel-k-client-2.0.0-linux-64bit.tar.gz
curl -Lo kamel.tar.gz https://github.com/apache/camel-k/releases/download/v2.1.0/camel-k-client-2.1.0-linux-amd64.tar.gz
tar -zxvf kamel.tar.gz
chmod +x kamel
sudo mv kamel /usr/local/bin/
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ All notable changes to the "vscode-camelk" extension will be documented in this

- Requires jbang for java standalone completion. It allows also to get rid of internal dependency to `kamel local` which is removed from kamel 2.x.
- Fix Java standalone support on Windows
- Update default runtime version to v2.0.0
- Update default runtime version to v2.1.0

## 0.0.35

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
},
"camelk.yaml.schema": {
"type": "string",
"default": "https://raw.githubusercontent.com/apache/camel/camel-3.20.1/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camel-yaml-dsl.json",
"default": "https://raw.githubusercontent.com/apache/camel/camel-4.0.0/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camel-yaml-dsl.json",
"description": "Yaml Schema applied when Camel K modeline is set. (I.e. file starting with '# camel-k: ')"
},
"redhat.telemetry.enabled": {
Expand Down
24 changes: 2 additions & 22 deletions src/IntegrationUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ import { TelemetryEvent } from '@redhat-developer/vscode-redhat-telemetry/lib';
let selectedConfigMap : any = undefined;
let selectedSecret : any = undefined;
let devMode = false;
let selectedResource : any = undefined;
let errorEncountered = false;
let selectedProperty : any = undefined;
let selectedDependency : any = undefined;
Expand Down Expand Up @@ -135,18 +134,6 @@ import { TelemetryEvent } from '@redhat-developer/vscode-redhat-telemetry/lib';
errorEncountered = true;
});
break;
case constants.resourceIntegration:
await getSelectedResources().then( (selection) => {
selectedResource = selection;
if (selectedResource === undefined) {
reject (new Error('No Resource selected.'));
errorEncountered = true;
}
}).catch ( (error) => {
reject(error);
errorEncountered = true;
});
break;
case constants.propertyIntegration:
await getSelectedProperties().then ( (selection) => {
selectedProperty = selection;
Expand Down Expand Up @@ -187,7 +174,7 @@ import { TelemetryEvent } from '@redhat-developer/vscode-redhat-telemetry/lib';

if (!errorEncountered) {
try {
const isSuccess = await createNewIntegration(context, devMode, selectedConfigMap, selectedSecret, selectedResource, selectedProperty, selectedDependency);
const isSuccess = await createNewIntegration(context, devMode, selectedConfigMap, selectedSecret, selectedProperty, selectedDependency);
sendStartIntegrationTelemetryEvent(choice, context);
resolve(isSuccess);
} catch(err) {
Expand Down Expand Up @@ -358,7 +345,7 @@ function getSelectedDependencies(): Promise<string[]> {
}

// use command-line "kamel" utility to start a new integration
export function createNewIntegration(integrationFileUri: vscode.Uri, devMode? : boolean, configmap? : string, secret? : string, resourceArray? : string[], propertyArray? : string[], dependencyArray? : string[]): Promise<boolean> {
export function createNewIntegration(integrationFileUri: vscode.Uri, devMode? : boolean, configmap? : string, secret? : string, propertyArray? : string[], dependencyArray? : string[]): Promise<boolean> {
return new Promise( async (resolve, reject) => {
const filename = integrationFileUri.fsPath;
const foldername = path.dirname(filename);
Expand All @@ -372,7 +359,6 @@ export function createNewIntegration(integrationFileUri: vscode.Uri, devMode? :
devMode,
configmap,
secret,
resourceArray,
dependencyArray,
propertyArray);
if (devMode && devMode === true) {
Expand Down Expand Up @@ -407,7 +393,6 @@ export function computeKamelArgs(absoluteRoot: string,
devMode: boolean | undefined,
configmap: string | undefined,
secret: string | undefined,
resourceArray: string[] | undefined,
dependencyArray: string[] | undefined,
propertyArray: string[] | undefined,
traitsArray?: string[] | undefined,
Expand All @@ -433,11 +418,6 @@ export function computeKamelArgs(absoluteRoot: string,
if (profile && profile.trim().length > 0) {
kamelArgs.push(`--profile=${profile}`);
}
if (resourceArray && resourceArray.length > 0) {
resourceArray.forEach(resource => {
kamelArgs.push(`--resource=file:${resource}`);
});
}
if (dependencyArray && dependencyArray.length > 0) {
dependencyArray.forEach(dependency => {
kamelArgs.push(`--dependency=${dependency}`);
Expand Down
121 changes: 0 additions & 121 deletions src/test/suite/StartIntegrationWithResource.test.ts

This file was deleted.

12 changes: 8 additions & 4 deletions src/test/suite/versionUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,16 @@ suite("VersionUtils check", () => {
await validateVersion('2.0.0', Platform.LINUX, 'https://github.com/apache/camel-k/releases/download/v2.0.0/camel-k-client-2.0.0-linux-64bit.tar.gz');
});

test("validate url for existing 2.0.0 windows version", async () => {
await validateVersion('2.0.0', Platform.WINDOWS, 'https://github.com/apache/camel-k/releases/download/v2.0.0/camel-k-client-2.0.0-windows-64bit.tar.gz');
test("validate url for existing 2.1.0 version", async () => {
await validateVersion('2.1.0', Platform.LINUX, 'https://github.com/apache/camel-k/releases/download/v2.1.0/camel-k-client-2.1.0-linux-amd64.tar.gz');
});

test("validate url for existing 2.0.0 MacOS version", async () => {
await validateVersion('2.0.0', Platform.MACOS, 'https://github.com/apache/camel-k/releases/download/v2.0.0/camel-k-client-2.0.0-mac-64bit.tar.gz');
test("validate url for existing 2.1.0 windows version", async () => {
await validateVersion('2.1.0', Platform.WINDOWS, 'https://github.com/apache/camel-k/releases/download/v2.1.0/camel-k-client-2.1.0-windows-amd64.tar.gz');
});

test("validate url for existing 2.1.0 MacOS version", async () => {
await validateVersion('2.1.0', Platform.MACOS, 'https://github.com/apache/camel-k/releases/download/v2.1.0/camel-k-client-2.1.0-darwin-amd64.tar.gz');
});

test("validate invalid url for xyz1 version", async () => {
Expand Down
4 changes: 2 additions & 2 deletions src/versionUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ import { platform } from './installer';
import fetch from 'cross-fetch';
import { Platform } from './shell';

export const version = '2.0.0'; //need to retrieve this if possible, but have a default
export const version = '2.1.0'; //need to retrieve this if possible, but have a default

/*
* Can be retrieved using `curl -i https://api.github.com/repos/apache/camel-k/releases/latest | grep last-modified`
* To be updated when updating the default "version" attribute
*/
const LAST_MODIFIED_DATE_OF_DEFAULT_VERSION = 'Mon, 24 Jul 2023 07:56:50 GMT';
const LAST_MODIFIED_DATE_OF_DEFAULT_VERSION = 'Mon, 23 Oct 2023 08:52:28 GMT';
let latestVersionFromOnline: string;

export async function testVersionAvailable(versionToUse: string): Promise<boolean> {
Expand Down

0 comments on commit 5c1b2c3

Please sign in to comment.