Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Option "check_storage" and "check_container_ressources" #249

Merged
merged 5 commits into from
Nov 15, 2024

Conversation

MickLesk
Copy link
Member

@MickLesk MickLesk commented Nov 14, 2024

Description

1. added new function:
check_storage
=> This message already appears in some LXCs and has now been adopted as a basic function in build.func.

image

This can be added in the function update_script() area. (ct/lxc.sh).
It should be added subsequently for all CTs.
https://github.com/MickLesk/Proxmox_DEV/blob/06ad30d94cc82cd793d6ac4cbcf1077a1e2f5994/ct/nextpvr.sh#L57


2. added new function:
check_container_ressources
=> if the ressources are not enough based on ct/script.sh the script exit with an output.
=> This message only appears if the RAM < var_ram or the cores < var_cpu of the CT

image

This can be added in the function update_script() area. (ct/lxc.sh).
It should be added subsequently for all CTs.
https://github.com/MickLesk/Proxmox_DEV/blob/06ad30d94cc82cd793d6ac4cbcf1077a1e2f5994/ct/nextpvr.sh#L58


3. GENERAL:
The ct\lxc.sh scripts should now always look like this in the update area (keyword: harmonization)

function update_script() {
header_info
check_container_storage
check_container_resources

Type of change

Please check the relevant option(s):

  • Bug fix (non-breaking change that resolves an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (a fix or feature that would cause existing functionality to change unexpectedly)
  • New script (a fully functional and thoroughly tested script or set of scripts.)

Prerequisites

The following efforts must be made for the PR to be considered. Please check when completed:

  • Self-review performed (I have reviewed my code, ensuring it follows established patterns and conventions)
  • Testing performed (I have tested my changes, ensuring everything works as expected)
  • Documentation updated (I have updated any relevant documentation)

Based to this issue:
#236

@MickLesk MickLesk requested a review from a team as a code owner November 14, 2024 14:24
@github-actions github-actions bot added the high risk A change that can affect many scripts label Nov 14, 2024
@MickLesk
Copy link
Member Author

And yes, I think the icons are better than the Ascii X and Check-Mark characters. 😄

Every terminal/console has supported them for several years. I will also bring it up to date in the next merges (the rest).

Mellowlynx
Mellowlynx previously approved these changes Nov 14, 2024
havardthom
havardthom previously approved these changes Nov 14, 2024
Copy link
Contributor

@havardthom havardthom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea and nice utility functions, will make scripts much cleaner

misc/build.func Outdated Show resolved Hide resolved
misc/build.func Outdated Show resolved Hide resolved
misc/build.func Outdated Show resolved Hide resolved
misc/build.func Outdated Show resolved Hide resolved
misc/build.func Outdated Show resolved Hide resolved
misc/build.func Outdated Show resolved Hide resolved
Co-authored-by: Håvard Gjøby Thom <[email protected]>
@MickLesk MickLesk dismissed stale reviews from havardthom and Mellowlynx via fecc532 November 14, 2024 19:48
MickLesk and others added 2 commits November 14, 2024 20:48
Co-authored-by: Håvard Gjøby Thom <[email protected]>
Co-authored-by: Håvard Gjøby Thom <[email protected]>
@newzealandpaul
Copy link
Contributor

This is a great improvement.

judeibe
judeibe previously approved these changes Nov 15, 2024
- remove locals
- use var_variables
- show storage in percent
- harmonize some texts
- optimize Prompt (Continue anyway)
@MickLesk
Copy link
Member Author

MickLesk commented Nov 15, 2024

So, now its the final version.

  • remove locals
  • use var_variables
  • show storage in percent
  • harmonize some texts
  • optimize Prompt (Continue anyway)

@community-scripts/contributor check again :-)

Ive testet all options.

image
image

@MickLesk MickLesk mentioned this pull request Nov 15, 2024
7 tasks
@MickLesk MickLesk merged commit a29ed78 into main Nov 15, 2024
4 checks passed
@MickLesk MickLesk deleted the MickLesk-patch-1 branch November 17, 2024 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high risk A change that can affect many scripts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants