cli icon indicating copy to clipboard operation
cli copied to clipboard

Show warning before CLI is changing a resource on SKR cluster

Open tobiscr opened this issue 3 years ago • 1 comments

Description

Customers are often going to use the Kyma CLI to modify an SKR cluster. This is a very dangerous step as the CLI is not aware about the used overrides in SKR. The risk is very high that such a change will break the Kyma runtime.

The CLI has to detec whether it's going to change an SKR Kyma runtime, show a warning message and ask the customer whether he is aware about the risk and whether he wants to proceed.

AC:

  • Check if the Kyma CLI is connected to an SKR cluster
  • If the user calls the deploy, undeploy command, show a warning and ask wether he wants to proceed:
    CAUTION: You are trying to use Kyma CLI to change a managed Kyma runtime (SAP Kyma Runtime). This action may corrupt the Kyma runtime. Proceed at your own risk.
    
    Do you really want to proceed? [N/y]
    
  • The customer has to decide wether he wants to proceed. Per default (e.g. customer just presses enter), the Kyma CLI will not modify the SKR installation.

Reasons

Attachments

tobiscr avatar Aug 29 '22 08:08 tobiscr

Instead of this:

You are going to change a managed Kyma runtime (SAP SKR offering). Applying changes on a managed installation by using the Kyma CLI can lead to a corrupted Kyma runtime and is on your own risk.

Do you really want to proceed? [N/y]

How about this:

CAUTION: You are trying to use Kyma CLI to change a managed Kyma runtime (SAP Kyma Runtime). This action may corrupt your the Kyma runtime. Proceed at your own risk.

Do you really want to proceed? [N/y]

NHingerl avatar Aug 29 '22 09:08 NHingerl

A question about detecting, if "we are connected to the SKR cluster". How should we check that? We can - for example - test if the kyma-system namespace exists. Or perhaps we can re-use the kyma version detection logic?

Tomasz-Smelcerz-SAP avatar Oct 20 '22 07:10 Tomasz-Smelcerz-SAP

Hi @Tomasz-Smelcerz-SAP,

that is exactly the challenge in this task. We need to find a way to reliably know if the cluster we are deploying to is on SKR.

The approaches you mention are unfortunately not going to work because a local dev cluster (any cluster with kyma on it actually) will have a kyma-system namespace and also a version that is indistinguishable from an SKR.

clebs avatar Oct 20 '22 07:10 clebs

@NHingerl @tobiscr FYI: I am taking Nina's version of warning message :)

Tomasz-Smelcerz-SAP avatar Oct 25 '22 11:10 Tomasz-Smelcerz-SAP