move skip label to be built into images

This commit is contained in:
mbecker20
2025-10-06 03:07:11 -07:00
parent 55a0a8cd05
commit cb34969f1e
10 changed files with 31 additions and 16 deletions

View File

@@ -57,6 +57,8 @@ ENV KOMODO_CLI_CONFIG_KEYWORDS="*config.*,*komodo.cli*.*"
CMD [ "core" ]
# Label to prevent Komodo from stopping with StopAllContainers
LABEL komodo.skip="true"
# Label for Ghcr
LABEL org.opencontainers.image.source="https://github.com/moghtech/komodo"
LABEL org.opencontainers.image.description="Komodo Core"

View File

@@ -53,6 +53,8 @@ ENV KOMODO_CLI_CONFIG_KEYWORDS="*config.*,*komodo.cli*.*"
CMD [ "core" ]
# Label to prevent Komodo from stopping with StopAllContainers
LABEL komodo.skip="true"
# Label for Ghcr
LABEL org.opencontainers.image.source="https://github.com/moghtech/komodo"
LABEL org.opencontainers.image.description="Komodo Core"

View File

@@ -42,6 +42,8 @@ ENV KOMODO_CLI_CONFIG_KEYWORDS="*config.*,*komodo.cli*.*"
CMD [ "core" ]
# Label to prevent Komodo from stopping with StopAllContainers
LABEL komodo.skip="true"
# Label for Ghcr
LABEL org.opencontainers.image.source="https://github.com/moghtech/komodo"
LABEL org.opencontainers.image.description="Komodo Core"

View File

@@ -31,6 +31,9 @@ ENV PERIPHERY_PRIVATE_KEY="file:/config/keys/periphery.key"
CMD [ "periphery" ]
# Label to prevent Komodo from stopping with StopAllContainers
LABEL komodo.skip="true"
# Label for ghcr
LABEL org.opencontainers.image.source="https://github.com/moghtech/komodo"
LABEL org.opencontainers.image.description="Komodo Periphery"
LABEL org.opencontainers.image.licenses="GPL-3.0"

View File

@@ -34,6 +34,9 @@ ENV PERIPHERY_PRIVATE_KEY="file:/config/keys/periphery.key"
CMD [ "periphery" ]
# Label to prevent Komodo from stopping with StopAllContainers
LABEL komodo.skip="true"
# Label for ghcr
LABEL org.opencontainers.image.source="https://github.com/moghtech/komodo"
LABEL org.opencontainers.image.description="Komodo Periphery"
LABEL org.opencontainers.image.licenses="GPL-3.0"

View File

@@ -23,6 +23,9 @@ ENV PERIPHERY_PRIVATE_KEY="file:/config/keys/periphery.key"
CMD [ "periphery" ]
# Label to prevent Komodo from stopping with StopAllContainers
LABEL komodo.skip="true"
# Label for ghcr
LABEL org.opencontainers.image.source="https://github.com/moghtech/komodo"
LABEL org.opencontainers.image.description="Komodo Periphery"
LABEL org.opencontainers.image.licenses="GPL-3.0"

View File

@@ -288,7 +288,9 @@ impl Resolve<super::Args> for StartAllContainers {
.context("failed to list all containers on host")?;
let futures = containers.iter().filter_map(
|ContainerListItem { name, labels, .. }| {
if labels.contains_key("komodo.skip") {
if let Some(skip) = labels.get("komodo.skip")
&& skip != "false"
{
return None;
}
let command = format!("docker start {name}");
@@ -315,7 +317,9 @@ impl Resolve<super::Args> for RestartAllContainers {
.context("failed to list all containers on host")?;
let futures = containers.iter().filter_map(
|ContainerListItem { name, labels, .. }| {
if labels.contains_key("komodo.skip") {
if let Some(skip) = labels.get("komodo.skip")
&& skip != "false"
{
return None;
}
let command = format!("docker restart {name}");
@@ -342,7 +346,9 @@ impl Resolve<super::Args> for PauseAllContainers {
.context("failed to list all containers on host")?;
let futures = containers.iter().filter_map(
|ContainerListItem { name, labels, .. }| {
if labels.contains_key("komodo.skip") {
if let Some(skip) = labels.get("komodo.skip")
&& skip != "false"
{
return None;
}
let command = format!("docker pause {name}");
@@ -369,7 +375,9 @@ impl Resolve<super::Args> for UnpauseAllContainers {
.context("failed to list all containers on host")?;
let futures = containers.iter().filter_map(
|ContainerListItem { name, labels, .. }| {
if labels.contains_key("komodo.skip") {
if let Some(skip) = labels.get("komodo.skip")
&& skip != "false"
{
return None;
}
let command = format!("docker unpause {name}");
@@ -396,7 +404,9 @@ impl Resolve<super::Args> for StopAllContainers {
.context("failed to list all containers on host")?;
let futures = containers.iter().filter_map(
|ContainerListItem { name, labels, .. }| {
if labels.contains_key("komodo.skip") {
if let Some(skip) = labels.get("komodo.skip")
&& skip != "false"
{
return None;
}
Some(async move {