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

feat: Add Scripts to Automate Tasks in KLM #2061

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

amritanshusikdar
Copy link
Contributor

Related issue(s)
Resolves #1802

@kyma-bot kyma-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cla: yes Indicates the PR's author has signed the CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 26, 2024
@kyma-bot kyma-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 2, 2024
@amritanshusikdar amritanshusikdar marked this pull request as ready for review December 2, 2024 08:24
@amritanshusikdar amritanshusikdar requested a review from a team as a code owner December 2, 2024 08:24
@kyma-bot kyma-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 2, 2024
@@ -1,177 +1,171 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

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

why are the changes here?

@@ -0,0 +1,6 @@
#!/bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

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

May be rename the file to clusters_cleanup.

@@ -0,0 +1,6 @@
#!/bin/bash

Copy link
Contributor

Choose a reason for hiding this comment

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

since this is a script now, we can reference it in the tasks.json as well as the Delete Test Clusters.run.xml instead of running the command there.
and the same applies for the other scripts.

Copy link
Contributor

Choose a reason for hiding this comment

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

When I try to run this script (and the new ones), I get permission denied. I think you need to run chmod +x <script_name> for each

#!/bin/bash

# TODO: where to extract the latest version of the tools from?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you should move this to the tests folder as well


echo "Enter the KLM Image Tag (e.g., latest):"
read KLM_IMAGE_TAG
while [[ "$#" -gt 0 ]]; do
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to throw some error or indicate that these fields are required because otherwise the image name and tag will be applied in a wrong way

exit 1 ;;
esac
shift
done
Copy link
Contributor

Choose a reason for hiding this comment

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

you also need to cd to the project root

@@ -0,0 +1,17 @@
#!/bin/bash

Copy link
Contributor

Choose a reason for hiding this comment

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

there is no need for this script since we will be removing the module templates in the e2e folder anyway

@@ -3,9 +3,15 @@
# Change to the directory where the script is located
cd "$(dirname "$0")"

./../version.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO this should be optional, may be add a new argument to the script to have the option to validate the version or not.

fi

# Versions installed on current system
KUBECTL_VERSION_INSTALLED=$(kubectl version --client | head -n1 | awk '{print $3}' | sed 's/v//')
Copy link
Contributor

Choose a reason for hiding this comment

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

I am getting

WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Invalid kubectl version: ersion.Info{Major:"1",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Indicates the PR's author has signed the CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automate Local Test Setup Script for Lifecycle-Manager
3 participants