SAP-samples / btp-setup-automator

Automate the setup of your SAP BTP account with the SAP BTP CLI and other CLI tools.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Space is being created even though it's not declared

AnatolManikalo opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

Are you using the latest docker image for BTPSA?

  • I'm using the latest docker image for BTPSA.

Which area is mainly impacted

Cloud Foundry setups

Current Behavior

Cloud Foundry space "development" is being created during setup, no "cfspacename" parameter is declared

Expected Behavior

No space should be created if no "cfspacename" parameter is declared

Steps To Reproduce

No response

Logs and configuration files available?

spaceissue.zip

Anything else?

As you can see from parameters.json file, I removed "cfspacename" line. Usecase doesn't have any space-specific services. However, space is being created anyway

Confirm bug, see PR #359

The bug is fixed, and the fix is available in the dev branch. It will be part of the next release. To omit the creation the following setting is necessary. We provide a new parameter in parameters.json to enable this behavior. In case you want to skip the creation of a CF space although you create a CD environment (and an org) you can set the parameter skipcfspacecreation to true.

The default value of the parameter is false, so all existing parameter.json configurations do not need to be adjusted

The issue will be closed once the release is published.

Fix is available in main and in Docker image with release 1.2.1

Hi @lechnerc77

Please re-open this issue. When using "skipcfspacecreation": true parameter, the script fails. For some reason it skips "cf login" command and as a result all the following cf commands (e.g. cf set-org-role) are failing with:
[2022-12-28 11:29:07] ERROR : FAILED
[2022-12-28 11:29:07] ERROR : No API endpoint set. Use 'cf login' or 'cf api' to target an endpoint.

If I remove this parameter, everything works fine.

Please compare the output. Without "skipcfspacecreation": true
noskipspace

With "skipcfspacecreation": true

skipspacecreation
witskipspaceresult

Login to CF is hidden in space creation => should be done always when a Cloud Foundry environment is created

The missing cf login is fixed with PR #381 . This fix is available in the dev branch (incl. corresponding Docker image) and will be available in main with the next release.