-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add kube to compose actions (#3253)
### What does this PR do? * Adds "Generate Kube" to Compose actions * Adds "Kube" tab to Compose details ### Screenshot/screencast of this PR <!-- Please include a screenshot or a screencast explaining what is doing this PR --> ### What issues does this PR fix or reference? <!-- Please include any related issue from Podman Desktop repository (or from another issue tracker). --> Closes #3105 ### How to test this PR? 1. Deploy a docker-compose example (https://raw.githubusercontent.com/kubernetes/kompose/main/examples/docker-compose.yaml) 2. Go to the container view in PD 3. Press on the compose group 4. View kube tab <!-- Please explain steps to reproduce --> Signed-off-by: Charlie Drage <charlie@charliedrage.com>
- Loading branch information
Showing
4 changed files
with
49 additions
and
1 deletion.
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
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
23 changes: 23 additions & 0 deletions
23
packages/renderer/src/lib/compose/ComposeDetailsKube.svelte
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,23 @@ | ||
<script lang="ts"> | ||
import { onMount } from 'svelte'; | ||
import MonacoEditor from '../editor/MonacoEditor.svelte'; | ||
import type { ComposeInfoUI } from './ComposeInfoUI'; | ||
export let compose: ComposeInfoUI; | ||
let kubeDetails: string; | ||
onMount(async () => { | ||
// Grab all the container ID's from compose.containers | ||
const containerIds = compose.containers.map(container => container.id); | ||
// Generate the kube yaml using the generatePodmanKube function which | ||
// only has to take in the engineID and an array of container ID's to generate from | ||
const kubeResult = await window.generatePodmanKube(compose.engineId, containerIds); | ||
kubeDetails = kubeResult; | ||
}); | ||
</script> | ||
|
||
{#if kubeDetails} | ||
<MonacoEditor content="{kubeDetails}" language="yaml" /> | ||
{/if} |