[PR #5677] [MERGED] Update Iptag #5993

Closed
opened 2025-11-20 07:08:33 -05:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE/pull/5677
Author: @DesertGamer
Created: 7/3/2025
Status: Merged
Merged: 7/4/2025
Merged by: @tremor021

Base: mainHead: main


📝 Commits (2)

📊 Changes

1 file changed (+983 additions, -491 deletions)

View changed files

📝 tools/pve/add-iptag.sh (+983 -491)

📄 Description

✍️ Description

  • Performance:
    • Extreme optimization for LXC: direct config parsing, batch status preloading, aggressive parallelism, and minimal external calls.
    • Parallel processing for both LXC and VM, with configurable limits and batch sizes.
    • All potentially slow or blocking operations (like lxc-attach/pct exec) are isolated and protected by timeouts and forced kill.
  • Caching:
    • Smart status caching for LXC and VM to avoid redundant system calls.
    • (Now disabled) LXC IP cache was implemented for performance, but can be toggled for real-time accuracy.
    • Periodic and on-demand cache cleanup to prevent stale data.
  • Reliability:
    • The script is fully resilient to container/VM hangs: no operation can block the main process for more than 10 seconds.
    • Fallback logic: if fast methods fail, the script tries deeper inspection and external commands with timeouts.
    • Never removes tags if IP is temporarily unavailable (prevents accidental tag loss).
  • Logging & Debug:
    • All logs, warnings, and debug output are in English and much more informative.
    • Extended debug mode for troubleshooting edge cases.
  • Systemd Integration:
    • The script now runs as a one-shot service, with systemd handling restarts and intervals (Restart=always, RestartSec=1).
    • No more infinite loops inside the script: all scheduling is external.
  • Other:
    • Improved tag formatting, CIDR checks, and configuration flexibility.

Link: #5357 #5574

Prerequisites (X in brackets)

  • Self-review completed – Code follows project standards.
  • Tested thoroughly – Changes work as expected.
  • No security risks – No hardcoded secrets, unnecessary privilege escalations, or permission issues.

🛠️ Type of Change (X in brackets)

  • 🐞 Bug fix – Resolves an issue without breaking functionality.
  • New feature – Adds new, non-breaking functionality.
  • 💥 Breaking change – Alters existing functionality in a way that may require updates.
  • 🆕 New script – A fully functional and tested script or script set.
  • 🌍 Website update – Changes to website-related JSON files or metadata.
  • 🔧 Refactoring / Code Cleanup – Improves readability or maintainability without changing functionality.
  • 📝 Documentation update – Changes to README, AppName.md, CONTRIBUTING.md, or other docs.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/community-scripts/ProxmoxVE/pull/5677 **Author:** [@DesertGamer](https://github.com/DesertGamer) **Created:** 7/3/2025 **Status:** ✅ Merged **Merged:** 7/4/2025 **Merged by:** [@tremor021](https://github.com/tremor021) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (2) - [`62dbb2d`](https://github.com/community-scripts/ProxmoxVE/commit/62dbb2dcb68e0669285f51ae68a2936feb11c393) Update Iptag - [`d0e6656`](https://github.com/community-scripts/ProxmoxVE/commit/d0e66561801f534aee0a92032e14e8dde34cbdf3) Deleting an inactive link ### 📊 Changes **1 file changed** (+983 additions, -491 deletions) <details> <summary>View changed files</summary> 📝 `tools/pve/add-iptag.sh` (+983 -491) </details> ### 📄 Description <!--🛑 New scripts must be submitted to [ProxmoxVED](https://github.com/community-scripts/ProxmoxVED) for testing. PRs without prior testing will be closed. --> ## ✍️ Description - **Performance:** - Extreme optimization for LXC: direct config parsing, batch status preloading, aggressive parallelism, and minimal external calls. - Parallel processing for both LXC and VM, with configurable limits and batch sizes. - All potentially slow or blocking operations (like lxc-attach/pct exec) are isolated and protected by timeouts and forced kill. - **Caching:** - Smart status caching for LXC and VM to avoid redundant system calls. - (Now disabled) LXC IP cache was implemented for performance, but can be toggled for real-time accuracy. - Periodic and on-demand cache cleanup to prevent stale data. - **Reliability:** - The script is fully resilient to container/VM hangs: no operation can block the main process for more than 10 seconds. - Fallback logic: if fast methods fail, the script tries deeper inspection and external commands with timeouts. - Never removes tags if IP is temporarily unavailable (prevents accidental tag loss). - **Logging & Debug:** - All logs, warnings, and debug output are in English and much more informative. - Extended debug mode for troubleshooting edge cases. - **Systemd Integration:** - The script now runs as a one-shot service, with systemd handling restarts and intervals (`Restart=always`, `RestartSec=1`). - No more infinite loops inside the script: all scheduling is external. - **Other:** - Improved tag formatting, CIDR checks, and configuration flexibility. ## 🔗 Related PR / Issue Link: #5357 #5574 ## ✅ Prerequisites (**X** in brackets) - [x] **Self-review completed** – Code follows project standards. - [x] **Tested thoroughly** – Changes work as expected. - [x] **No security risks** – No hardcoded secrets, unnecessary privilege escalations, or permission issues. --- ## 🛠️ Type of Change (**X** in brackets) - [x] 🐞 **Bug fix** – Resolves an issue without breaking functionality. - [ ] ✨ **New feature** – Adds new, non-breaking functionality. - [x] 💥 **Breaking change** – Alters existing functionality in a way that may require updates. - [ ] 🆕 **New script** – A fully functional and tested script or script set. - [ ] 🌍 **Website update** – Changes to website-related JSON files or metadata. - [x] 🔧 **Refactoring / Code Cleanup** – Improves readability or maintainability without changing functionality. - [ ] 📝 **Documentation update** – Changes to `README`, `AppName.md`, `CONTRIBUTING.md`, or other docs. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2025-11-20 07:08:33 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/ProxmoxVE#5993