mirror of
https://github.com/moghtech/komodo.git
synced 2026-05-10 15:33:24 -05:00
Allow excluding services from global auto update (#1279)
* add ignore_polling_services for global auto update * rename ignore_polling_services to auto_update_skip_services and reorganize
This commit is contained in:
committed by
GitHub
parent
be5b735c68
commit
2fcee5545c
@@ -776,7 +776,13 @@ pub async fn check_stack_for_update_inner(
|
||||
|
||||
if image.is_empty() ||
|
||||
// Images with a hardcoded digest can't have update.
|
||||
image.contains('@')
|
||||
image.contains('@') ||
|
||||
// Services explicitly excluded from global auto-update checks.
|
||||
// Manual checks should still evaluate all services.
|
||||
(wait_for_auto_update &&
|
||||
stack.config.auto_update_skip_services.contains(
|
||||
&service.service_name,
|
||||
))
|
||||
{
|
||||
service.image_digest = None;
|
||||
continue;
|
||||
|
||||
@@ -383,6 +383,17 @@ pub struct StackConfig {
|
||||
#[builder(default)]
|
||||
pub auto_update_all_services: bool,
|
||||
|
||||
/// Ignore certain services during Global Auto Update polling.
|
||||
/// Services listed here are skipped only in the global auto-update flow.
|
||||
/// Manual checks still include all services.
|
||||
#[serde(default, deserialize_with = "string_list_deserializer")]
|
||||
#[partial_attr(serde(
|
||||
default,
|
||||
deserialize_with = "option_string_list_deserializer"
|
||||
))]
|
||||
#[builder(default)]
|
||||
pub auto_update_skip_services: Vec<String>,
|
||||
|
||||
/// Whether to run `docker compose down` before `compose up`.
|
||||
#[serde(default)]
|
||||
#[builder(default)]
|
||||
@@ -700,6 +711,7 @@ impl Default for StackConfig {
|
||||
poll_for_updates: Default::default(),
|
||||
auto_update: Default::default(),
|
||||
auto_update_all_services: Default::default(),
|
||||
auto_update_skip_services: Default::default(),
|
||||
ignore_services: Default::default(),
|
||||
pre_deploy: Default::default(),
|
||||
post_deploy: Default::default(),
|
||||
|
||||
@@ -2473,6 +2473,12 @@ export interface StackConfig {
|
||||
* Komodo will redeploy the whole Stack (all services).
|
||||
*/
|
||||
auto_update_all_services?: boolean;
|
||||
/**
|
||||
* Ignore certain services during Global Auto Update polling.
|
||||
* Services listed here are skipped only in the global auto-update flow.
|
||||
* Manual checks still include all services.
|
||||
*/
|
||||
auto_update_skip_services?: string[];
|
||||
/** Whether to run `docker compose down` before `compose up`. */
|
||||
destroy_before_deploy?: boolean;
|
||||
/** Whether to skip secret interpolation into the stack environment variables. */
|
||||
|
||||
6
ui/public/client/types.d.ts
vendored
6
ui/public/client/types.d.ts
vendored
@@ -2617,6 +2617,12 @@ export interface StackConfig {
|
||||
* Komodo will redeploy the whole Stack (all services).
|
||||
*/
|
||||
auto_update_all_services?: boolean;
|
||||
/**
|
||||
* Ignore certain services during Global Auto Update polling.
|
||||
* Services listed here are skipped only in the global auto-update flow.
|
||||
* Manual checks still include all services.
|
||||
*/
|
||||
auto_update_skip_services?: string[];
|
||||
/** Whether to run `docker compose down` before `compose up`. */
|
||||
destroy_before_deploy?: boolean;
|
||||
/** Whether to skip secret interpolation into the stack environment variables. */
|
||||
|
||||
@@ -101,6 +101,8 @@ export default function StackConfig({
|
||||
const disabled = global_disabled || !canWrite;
|
||||
|
||||
const runBuild = update.run_build ?? config.run_build;
|
||||
const poll_for_updates = update.poll_for_updates ?? config.poll_for_updates;
|
||||
|
||||
const mode = getStackMode(update, config);
|
||||
|
||||
const gitProvider = update.git_provider ?? config.git_provider;
|
||||
@@ -395,6 +397,27 @@ export default function StackConfig({
|
||||
/>
|
||||
);
|
||||
},
|
||||
auto_update_skip_services: (values, set) =>
|
||||
poll_for_updates && (
|
||||
<ConfigItem
|
||||
label="Ignore Services During Polling"
|
||||
description="Services listed here are skipped only during Global Auto Update checks. Manual checks still include all services."
|
||||
>
|
||||
<MultiSelect
|
||||
leftSection={<ICONS.Service size="1rem" />}
|
||||
placeholder={values?.length ? "Add services" : "Select services"}
|
||||
value={values}
|
||||
data={allServices}
|
||||
onChange={(auto_update_skip_services) =>
|
||||
set({ auto_update_skip_services })
|
||||
}
|
||||
disabled={disabled}
|
||||
w="fit-content"
|
||||
searchable
|
||||
clearable
|
||||
/>
|
||||
</ConfigItem>
|
||||
),
|
||||
auto_update: {
|
||||
description: "Trigger a redeploy if a newer image is found.",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user