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

KRV-1678 : Enhance and test install.sh script to upgrade operator and crd via cli (without OLM) in K8s and OCP environments #31

Merged
merged 6 commits into from
Feb 17, 2022

Conversation

karthikk92
Copy link
Collaborator

@karthikk92 karthikk92 commented Feb 15, 2022

Description

Enhance and test install.sh script to upgrade operator and crd via cli (without OLM) in K8s and OCP environments

GitHub Issues

List the GitHub issues impacted by this PR:

GitHub Issue #
dell/csm#159

Checklist:

  • I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 90% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have maintained backward compatibility

How Has This Been Tested?

  1. Install without operator present already

image (1)

  1. Install with operator present already

image

  1. Upgrade without operator present already

image

  1. Upgrade with operator present already

image (2)

  1. Minimum version of k8s check

min_supported_k8s

  1. Maximum version of k8s check

max_k8s_version

@@ -14,6 +14,8 @@ function usage() {
echo
echo "Usage: $PROG options..."
echo "Options:"
echo " Optional"
echo " --upgrade Perform an upgrade of the specified driver, default is false"
Copy link
Contributor

Choose a reason for hiding this comment

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

Perform an upgrade of the specified driver.. -> Perform an upgrade of the operator...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Taken care

echo "Attempting to upgrade the Operator as --upgrade option was specified"
else
log step_failure
log error "Operator is not found in dell-csm-operator namespace to upgrade.Install the operator without the upgrade option."
Copy link
Contributor

Choose a reason for hiding this comment

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

use '$NAMESPACE' instead of dell-csm-operator

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Taken care

rensyct
rensyct previously approved these changes Feb 15, 2022
if [ "$operator_in_namespace" = true ]; then
log step_failure
log warning "Found existing installation of dell-csm-operator in '$NAMESPACE' namespace"
log error "Remove the existing installation manually or use uninstall.sh script, and then proceed with installation"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we use error message like "Remove the existing installation using uninstall.sh script, or use the --upgrade option to upgrade the Operator" to let customer know they can use upgrade as well ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Taken care

main.go Outdated
k8sPath = fmt.Sprintf("/driverconfig/common/default.yaml")
} else if currentVersion > maxVersion {
log.Info(fmt.Sprintf("Installed k8s version %s is greater than the maximum supported k8s version %f , hence using the latest available configurations", kubeVersion, maxVersion))
log.Info(fmt.Sprintf("Installed k8s version %s is greater than the maximum supported k8s version %s , hence using the latest available configurations", kubeVersion, K8sMaximumSupportedVersion))
Copy link
Contributor

Choose a reason for hiding this comment

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

use new logger log.Infof works same as Printf

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

taken care

@rensyct rensyct merged commit 94a1be8 into main Feb 17, 2022
@rensyct rensyct deleted the upgrade_sript branch March 21, 2022 09:20
ChristianAtDell added a commit that referenced this pull request Oct 15, 2024
… crd via cli (without OLM) in K8s and OCP environments (#31)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants