This repository has been archived by the owner on Oct 18, 2024. It is now read-only.
forked from eclipse-che/che-theia
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(circular-dependency): Remove warning about circular dependency wo…
…rkspaceService-->devFileService --> workspaceService Change-Id: I4e22ca592de046578221956e63638186507202a0 Signed-off-by: Florent Benoit <fbenoit@redhat.com>
- Loading branch information
Showing
5 changed files
with
101 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
extensions/eclipse-che-theia-remote-impl-k8s/src/node/k8s-devworkspace-env-variables.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/********************************************************************** | ||
* Copyright (c) 2021 Red Hat, Inc. | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
***********************************************************************/ | ||
|
||
import { injectable } from 'inversify'; | ||
|
||
/** | ||
* Manage access to env variables defined by a dev workspace | ||
*/ | ||
@injectable() | ||
export class K8sDevWorkspaceEnvVariables { | ||
/** | ||
* workspaceId - workspace ID taken from environment variable, always the same at workspace lifecycle | ||
*/ | ||
private readonly workspaceId: string; | ||
|
||
/** | ||
* workspaceName - workspace name taken from environment variable, always the same at workspace lifecycle | ||
*/ | ||
private readonly workspaceName: string; | ||
|
||
/** | ||
* workspaceNamespace - workspace namespace taken from environment variable, always the same at workspace lifecycle | ||
*/ | ||
private readonly workspaceNamespace: string; | ||
|
||
constructor() { | ||
if (process.env.DEVWORKSPACE_ID === undefined) { | ||
console.error('Environment variable DEVWORKSPACE_ID is not set'); | ||
} else { | ||
this.workspaceId = process.env.DEVWORKSPACE_ID; | ||
} | ||
if (process.env.DEVWORKSPACE_NAMESPACE === undefined) { | ||
console.error('Environment variable DEVWORKSPACE_NAMESPACE is not set'); | ||
} else { | ||
this.workspaceNamespace = process.env.DEVWORKSPACE_NAMESPACE; | ||
} | ||
if (process.env.DEVWORKSPACE_NAME === undefined) { | ||
console.error('Environment variable DEVWORKSPACE_NAME is not set'); | ||
} else { | ||
this.workspaceName = process.env.DEVWORKSPACE_NAME; | ||
} | ||
} | ||
|
||
getWorkspaceId(): string { | ||
return this.workspaceId; | ||
} | ||
|
||
getWorkspaceName(): string { | ||
return this.workspaceName; | ||
} | ||
|
||
getWorkspaceNamespace(): string { | ||
return this.workspaceNamespace; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters