public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: "Proxmox VE development discussion" <pve-devel@lists.proxmox.com>,
	"Michael Köppl" <m.koeppl@proxmox.com>
Subject: Re: [pve-devel] [PATCH FOLLOW-UP ha-manager v2 4/4] ha: check for actual disable value during rule checks
Date: Wed, 17 Sep 2025 14:34:43 +0200	[thread overview]
Message-ID: <5004e2f6-4e7d-4170-9b2a-1f815fc02391@proxmox.com> (raw)
In-Reply-To: <20250723153524.288508-5-m.koeppl@proxmox.com>

Am I correct in that ha-manager patches 1/4, 2/4 and 3/4 have been
superseded/obsoleted?

Am 23.07.25 um 5:35 PM schrieb Michael Köppl:
> When exclude_disabled_rules was enabled, rules would be excluded from
> the check even if the value was actually false, since it still existed.
> The check now makes sure that the rule is really disabled before
> excluding it.
> 
> Signed-off-by: Michael Köppl <m.koeppl@proxmox.com>

Needs to be rebased for current master.

> ---
>  src/PVE/HA/Rules.pm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/PVE/HA/Rules.pm b/src/PVE/HA/Rules.pm
> index bda0b5d..e756c7d 100644
> --- a/src/PVE/HA/Rules.pm
> +++ b/src/PVE/HA/Rules.pm
> @@ -431,7 +431,7 @@ sub foreach_rule : prototype($$;$) {
>          next if !$rule; # skip invalid rules
>          next if defined($sid) && !defined($rule->{resources}->{$sid});
>          next if defined($type) && $rule->{type} ne $type;
> -        next if $exclude_disabled_rules && exists($rule->{disable});
> +        next if $exclude_disabled_rules && exists($rule->{disable}) && $rule->{disable};

Please drop the exists check, that makes it harder to read and we don't
usually do that when checking if a boolean property is true.

>  
>          $func->($rule, $ruleid);
>      }


I noticed that this doesn't fix setting disabled to false via API, i.e.

[I] root@pve9a1 ~# pvesh set /cluster/ha/rules/ha-rule-foo --disable 0
--type resource-affinity
[I] root@pve9a1 ~# pvesh get /cluster/ha/rules/ha-rule-foo
--output-format json-pretty | grep disable
   "disable" : 1,

Could you take a look at that too?


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

  reply	other threads:[~2025-09-17 12:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-23 15:35 [pve-devel] [PATCH FOLLOW-UP ha-manager/manager v2 0/5] fix rule migration errors and add UI components Michael Köppl
2025-07-23 15:35 ` [pve-devel] [PATCH FOLLOW-UP ha-manager v2 1/4] config: use entire path to groups.cfg path in delete_group_config Michael Köppl
2025-07-23 15:35 ` [pve-devel] [PATCH FOLLOW-UP ha-manager v2 2/4] ha: decode JSON string with version info returned by get_node_kv Michael Köppl
2025-07-23 15:35 ` [pve-devel] [PATCH FOLLOW-UP ha-manager v2 3/4] api: return disable field for rules endpoint Michael Köppl
2025-07-23 15:35 ` [pve-devel] [PATCH FOLLOW-UP ha-manager v2 4/4] ha: check for actual disable value during rule checks Michael Köppl
2025-09-17 12:34   ` Fiona Ebner [this message]
2025-07-23 15:35 ` [pve-devel] [PATCH FOLLOW-UP manager v2 1/1] ui: add overview and edit components for node affinity rules Michael Köppl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5004e2f6-4e7d-4170-9b2a-1f815fc02391@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=m.koeppl@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal