Giter Club home page Giter Club logo

service-manager-cli's People

Contributors

alexwo avatar cohenorian avatar danielforsap avatar dimitarpetrov avatar dotchev avatar dpanayotov avatar dzahariev avatar einavle avatar epsilontal avatar evyaffe avatar eyalnathan avatar i500866 avatar idobergerfroind avatar joy-n-craft avatar kirilkabakchiev avatar michalyaros avatar nickymateev avatar nyordanoff avatar oleg-yudovich avatar pankrator avatar pavelmaliy avatar rafikt1992 avatar sigalmaya avatar thwiegan avatar yaelimon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

service-manager-cli's Issues

Homebrew tap / formula

It would be useful to be able to simply do a brew install smctl and get the cli setup and ready to use

Error

I'm getting an error when trying to register the service broker using the smctl tool:

$ smctl register-broker my-broker-i812662 https://my-broker-i812662-proud-camel-zy.cfapps.sap.hana.ondemand.com -b broker-user:broker-password
Error: request GET https://service-manager.cfapps.sap.hana.ondemand.com/v1/service_brokers?async=false failed: StatusCode: 200 Body: {"num_items":0,"items":[]} 

I'm running on a Mac and a colleagues is running on windows (same version of smctl), and we both have the same problem.

smctl version  
Service Manager Client v1.10.4 (b7476e0fafff00d2505751ddb29fc9a04cc8b255)

Can some help to identify the issue?
Best regards,
Roberto Falk

SMCTL cannot be installed

Issue Template

Step 1: Is this issue for here?

yes.

Step 2: Describe the problem (very short text description):

*I'm trying to install the CLI as described:
Approach 1: Manual installation
Download CLI
go get github.com/Peripli/service-manager-cli

Install CLI
go install github.com/Peripli/service-manager-cli/smctl

Step 3: Describe the problem (steps):

go get github.com/Peripli/service-manager-cli
go install github.com/Peripli/service-manager-cli/smctl

Steps to reproduce:

  1. go get github.com/Peripli/service-manager-cli
  2. go install github.com/Peripli/service-manager-cli/smctl

Observed Results:

go install github.com/Peripli/service-manager-cli/smctl
can't load package: package github.com/Peripli/service-manager-cli/smctl: cannot find package "github.com/Peripli/service-manager-cli/smctl" in any of:
/usr/local/go/src/github.com/Peripli/service-manager-cli/smctl (from $GOROOT)
/Users/d036795/go/src/github.com/Peripli/service-manager-cli/smctl (from $GOPATH)

Expected Results:

  • SMCTL shall be installed successfully

Relevant Code Snippet:

NA

Login not working

image
like a good SAP product, it lacks initial documentation.

where does this url come from? where does this region come from?

I took what I had found in the BTP, and it gave this meaningless error.

I need to remove kyma services in a trial account

Upgrade golang version in smctl to 1.22

Issue Template

Step 1: Is this issue for here?

Yes.

Step 2: Describe the problem (very short text description):

Golang version 1.17.1 in this repo is out of date and has lots of security vulnerabilities. Please upgrade it to 1.22.4.

Unable to delete binding when instance name isn't unique

Issue Template

Step 1: Is this issue for here?

The issue is indeed for the cli.

Step 2: Describe the problem (very short text description):

Trying to delete binding fails if it belongs to an instance with a non-unique name (i.e. there are additional instances with the same name)

Step 3: Describe the problem (steps):

Steps to reproduce:

  1. Create an instance with name 'abc' and binding
  2. Create a second instance with the same name
  3. Use the cli 'unbind' to delete the first binding

Observed Results:

Error message that the deletion failed since the instance name isn't unique:
Error: more than one service instance with name logging-bnr-standard found. Use --id flag to specify id of the binding to be deleted

Expected Results:

Being able to delete the binding

Relevant Code Snippet:

For unbind I can't supply an id for the instance. Only the name is used. I believe the problem is in https://github.com/Peripli/service-manager-cli/blob/master/internal/cmd/binding/unbind.go#L90

unable to get asynchronous operation's status

smctl status /v1/service_instances/edb87ed5-a36d-4628-9245-6be44809edf8/operations/fcad4183-aec7-4b95-85be-ed11b3e24b6b returns the status of an operation before.

Unfortunately I must know all the ID's in the command. Is there any way to get all operation status without knowing the ids?

smctl list-instances contains all successfull created instances, but I'm unable to get all the failed.

Get released Versions signed to avoid error message on Mac OS

Steps to reproduce:

I've downloaded the current release (smctl-1.12.1-darwin-arm64.tar.gz) to my Apple M2 Max MacBook Pro. There I've extracted the file and moved the executable to /usr/local/bin/smctl. But now I get the following error message:

Screenshot 2023-11-08 at 08 49 10

“smctl” can’t be opened because Apple cannot check it for malicious software.
This software needs to be updated. Contact the developer for more information.
Chrome downloaded this file today at 08:42.

I can now go to System Settings -> Privacy and Security and click the "Allow Anyway" button:

Screenshot 2023-11-08 at 08 50 46

Expected Results:

I would expect that a tool that should also be used in corporate environments should get signed with an Apple developer certificate.

smctl info returns user information even after `smctl logout`

If I login in with smctl login.... the user context is set correct and I can get them with smctl info

>> smctl info
Service Manager URL: https://service-manager.cfapps.sap.hana.ondemand.com
User: [email protected]

But this information is still present after smctl logout , which seems to be wrong.

>> smctl logout
You have successfully logged out.
>> smctl info  
Service Manager URL: https://service-manager.cfapps.sap.hana.ondemand.com
User: [email protected]

Is there any way to the get the context (user/subaccount domain) in which I'm logged in?

the help output of the smctl return, that smctl info should return the information of the logged user....but I'm logged out.

  help                Help about any command
  info                Prints information for logged user
  label               Label resource
 

smctl command not recognized in windows

Issue Template

Step 1: Is this issue for here?

smctl related issue.

Step 2: Describe the problem (very short text description):

I am trying to install service-manager-cli

Step 3: Describe the problem (steps):

Steps to reproduce:

  1. I was installing smctl for windows 64 bit.
  2. I have downloaded smactl_windows64.exe and added exe to the path.

Observed Results:

  • But the "smctl" command was not recognized.

Expected Results:

  • "smctl" should have been recognized.

After a long debugging, I understood that the smctl_windows64.exe has to be renamed to smctl.exe .
Please update your readme with this point.

OpenID unauthorized jwt malformed error

Issue Template

Step 1: Is this issue for here?

Most likely this issue is related to the cli, but could be also a combination of cli and service-manager api.

Step 2: Describe the problem (very short text description):

After login the used token seem not to comply with JWS standards. Client returns:

Error: request GET https://***/v1/platforms failed: StatusCode: 401 Body: {"error":"Unauthorized","description":"No authenticated user found: Cause: oidc: malformed jwt: square/go-jose: compact JWS format must have three parts"}

"***": is in reality the correct uri of the service-manager

Step 3: Describe the problem (steps):

The entire test is based on a fresh and empty docker installation of the service-manager.

After integrating with a openid connect provider (community gitlab and turning on the openid feature) a login is executed successfully (client-id and user credential based), but as soon as I use any other command it returns the error message. The Bearer token is stored in local configuration file, but not in the required JWS format.

Executed commands

  • Login
smctl_win64.exe login --auth-flow client-credentials --client-id foo --client-secret bar --config config-client.json --url https://*** 

(works and returns proper error messages as expected if something is wrong with credentials or settings in openid provider)

  • Command
smctl_win64.exe list-platforms --config config-client.json

Turning on verbose does not reveal much more info besides: component=util/client.go:87

Same happens with a simple mocked openid provider service based on a node-oidc-provider.

Observed Results:

Error: request GET https://***/v1/platforms failed: StatusCode: 401 Body: {"error":"Unauthorized","description":"No authenticated user found: Cause: oidc: malformed jwt: square/go-jose: compact JWS format must have three parts"}

Used versions

  • smctl_win64.exe (v1.10.6)
  • service-manager (quay.io docker container "latest" and 0.13.4)

Fix installation Guide in Readme: cannot find package "github.com/hashicorp/hcl/hcl/printer"

Issue Template

Step 1: Is this issue for here?

yes

Step 2: Describe the problem (very short text description):

go install github.com/Peripli/service-manager-cli fails with cannot find package "github.com/hashicorp/hcl/hcl/printer"

I PROVIDE A MITIGATION AT THE END OF THIS DESCRIPTION

Step 3: Describe the problem (steps):

Steps to reproduce:

$ go get github.com/Peripli/service-manager-cli
$ go install github.com/Peripli/service-manager-cli
../src/github.com/spf13/viper/viper.go:40:2: cannot find package "github.com/hashicorp/hcl/hcl/printer" in any of:
	/usr/local/go/src/github.com/hashicorp/hcl/hcl/printer (from $GOROOT)
	/home/a1/go/src/github.com/hashicorp/hcl/hcl/printer (from $GOPATH)

Observed Results:

../src/github.com/spf13/viper/viper.go:40:2: cannot find package "github.com/hashicorp/hcl/hcl/printer" in any of:
	/usr/local/go/src/github.com/hashicorp/hcl/hcl/printer (from $GOROOT)
	/home/a1/go/src/github.com/hashicorp/hcl/hcl/printer (from $GOPATH)

Expected Results:

$ go install github.com/Peripli/service-manager-cli
go: finding github.com/Peripli/service-manager-cli v1.11.7
go: downloading github.com/Peripli/service-manager-cli v1.11.7
go: extracting github.com/Peripli/service-manager-cli v1.11.7

MITIGATION

Run
export GO111MODULE=on
prior to installation.

Solution has been described e.g., here: spf13/viper#1076 (comment)

Unable to test automation if `smctl provision ...` has success

The smctl provision CLI tool returns always 0 even if the command fails. Normaly CLI tools returns
1 or any value greater zero on error. This makes it possible to test if the command has success.
( echo $? shows the status of last execute shell command )

Instead the provision command returns a human readable text and tells how to check if the command has success or not.

smctl provision sm-instance service-manager service-operator-access -o yaml
Service Instance sm-instance successfully scheduled for provisioning. To see status of the operation use:
smctl status /v1/service_instances/3c496c0c-d89d-4753-af6f-e3c979203b8a/operations/6e9ff2c0-f5e4-4f15-804f-b5d122c53fda

But this output is pretty useless in an test/automation environment. The smctl list-instances do not return failed instances nor do we have any other chances to retrieved failed provision commands.

Any idea how to automate/test the instance provision command?

one solution could be to support -o json as argument in the provision command as well. In this case we can fetch the test command easy from the output instead of parse human readable output.

Release SMCTL for for linux_arm64.

Hi

as now smctl is now available on M1. It is beneficial to have the cli compiled for linux_arm64 as well not just darwin. This is useful for users using the cli in their developing containers.

Thank you

Smctl register-broker URL validation

Issue Template

Step 1: Is this issue for here?

most likely

Step 2: Describe the problem (very short text description)

Calling smctl register-broker passing url ending with a / results in error as the resulting call to the service broker contains the extra slash

call received by service broker:

GET //v2/catalog HTTP/1.1" 400

Step 3: Describe the problem (steps):

smctl register-broker BROKER_NAME https://*/ -b ****:****

Observed Results:

Error: request POST .... failed: Status code: 400 Body: {"error":"ServiceBrokerErr","description":"error fetching catalog for broker with name *****: broker responded with 400 Bad Request"}

"error occurred while fetching openid configuration: unexpected status code"

Issue Template

Step 1: Is this issue for here?

Yes

Step 2: Describe the problem (very short text description):

Running smctl login fails saying
Error: Could not build authenticator Reason: error occurred while fetching openid configuration: unexpected status code

Step 3: Describe the problem (steps):

  1. Run smctl login -a https://service-manager.cfapps.sap.hana.ondemand.com --auth-flow=client-credentials --client-id='...' --client-secret='...' --param subdomain=...

Observed Results:

The error listed above

Expected Results:

Success in login

Note:
Running the same on one sub account works while it fails on a second sub account (I've double check that the client id, client secret and sub domain are correct)

smctl lb returns no brokers

smctl lb returns no brokers

Description

When smctl lb is executed no brokers are returned (even though there are some in the service manager). When smctl curl /v1/brokers is executed a non-empty result is returned.

Steps to reproduce

  1. Register a valid broker in SM (smctl rb ...)
  2. Execute smctl lb

Observed Results

No brokers are displayed.

Expected Results:

At least the registered broker is returned.

Known affected versions:

pre1.4.1

Additional remarks

This seems to be a regression as old versions work as expected (tested with v1.0.0)

CLI Documentation

CLI Documentation

Every widely used CLI provides a public reference documentation. One should be made for the SM CLI.

`smctl status` returns Object instead of Array of the entity errors

we are working on an simple automation for our setup and we found a simple issue with the
smctl status output. The entity errors is an object instead of an array but the name of the attribute
is in plural which assumes that the entity can contain more than one entry.

Maybe the kind of the attribute should change to an array or the naming should be singular instead of plural.

If errorsis an array we can test on success very easy with jq and lenghtof the errors array...which is currently not possible.

 smctl status /v1/service_instances/69a5e6c1-555c-4f88-8925-5558eee12bab/operations/70407abc-9684-40e9-8b17-e6135355e5b6 -o json
{
  "id": "70407abc-9684-40e9-8b17-e6135355e5b6",
  "type": "create",
  "state": "failed",
  "resource_id": "69a5e6c1-555c-4f88-8925-5558eee12bab",
  "resource_type": "/v1/service_instances",
  "errors": {
    "error": "Conflict",
    "description": "instance with same name exists for the current tenant"
  },
  "created_at": "2021-08-15T09:37:41.609766Z",
  "updated_at": "2021-08-15T09:37:41.692213Z",
  "labels": {
    "subaccount_id": [
      "bfcdee60-9ef8-43a7-8dbe-71b7e98e87dc"
    ]
  }
}
 

smctl update-broker example not working

Issue Template

Step 2: Describe the problem (very short text description):

The example for smctl update-broker uses broker-url as a parameter, but the update actually only works with broker_url.

Step 3: Describe the problem (steps):

Steps to reproduce:

  1. Register a broker with URL A
  2. Try to update the broker with a new URL B using the example with broker-url

Observed Results:

  • CLI outputs 404 not found as the old URL A is not available anymore, but the new URL B is not used

Expected Results:

  • CLI should use the new URL and update the broker registration accordingly

SM CLI refers to older version of Service Manager

The SM CLI will fail on installation due to referring to an older package name for the class LabelChanges.

The pull request from Service Manager which made these changes is here: Peripli/service-manager#444

It seems like SM CLI should update the coding to reflect these changes, otherwise the installation of the tool will not work.

Allow self-signed certs

smctl should have the option to trust self-signed certs. Like cf cli's "--skip-ssl-validation" smctl should have "--insecure" for example

How to install CLI in Mac OS using the downloaded file

Step 1: Is this issue for here?

The issue is related to the installation of CLI in Mac OS.

Step 2: Describe the problem (very short text description):

The downloaded for Mac OS does not have any extension like pkg and I am not sure how to make use of it to install the tool.

Unable to unbind existing binding

Issue Template

Step 1: Is this issue for here?

probably

Step 2: Describe the problem (very short text description):

I'm unable to unbind existing bindings.

Step 3: Describe the problem (steps):

smctl shows binding but when I try to call unbind, smctl displays 404 and fails to unbind

Steps to reproduce:

  1. create service binding
This was done through the UI of service catalog, but the service catalog resource no longer exists
  1. list service bindings
$ smctl list-bindings
One service binding.
ID                                    Name                                  Instance Name                 Credentials  Created                      Updated                      Ready  Labels
------------------------------------  ------------------------------------  ----------------------------  -----------  ---------------------------  ---------------------------  -----  --------------------------------------------------
a42a5dde-8bd8-4491-9cca-6a6343e97158  a42a5dde-8bd8-4491-9cca-6a6343e97158  service-catalog-auditlog-api               2021-06-22T08:04:25.998875Z  2021-06-22T08:04:25.998875Z  true   subaccount_id=121ebe4e-08ec-48d6-bc87-b49f9327fe82
  1. unbind service binding
$ smctl unbind service-catalog-auditlog-api a42a5dde-8bd8-4491-9cca-6a6343e97158
Do you really want to delete binding with name [a42a5dde-8bd8-4491-9cca-6a6343e97158] for instance with name service-catalog-auditlog-api (Y/n): y
Could not delete service binding. Reason: Error: request DELETE https://service-manager.cfapps.sap.hana.ondemand.com/v1/service_bindings/a42a5dde-8bd8-4491-9cca-6a6343e97158?async=true failed: StatusCode: 404 Body: {"error":"NotFound","description":"could not find such /v1/service_bindings"}

Observed Results:

404 failure to unbind

Expected Results:

successfully unbind the bindings

Relevant Code Snippet:

smctl delete-broker exits with code zero even if it fails

Issue Template

Step 1: Is this issue for here?

  • Since the Service Manager is comprised of multiple components (Service Manager, Service Broker Proxies, Service Manager CLI, etc.) you should make sure that this is the right repository for your issue. Only issues related to the Service Manager CLI will be addressed here. All other issues should be created in the appropriate repositories in the Peripli organization.
  • For general technical questions, send an email with your question on [email protected]

Step 2: Describe the problem (very short text description):

smctl delete-broker exits with code zero even if it fails

Step 3: Describe the problem (steps):

Steps to reproduce:

  1. Try to delete a non-existing broker

Observed Results:

$ smctl delete-broker bb
Could not delete broker bb. Reason: URL: https://sm-host/v1/service_brokers/e6c67516-f7b9-44c1-a2a6-64d3decc333e, Status: 403; ErrorMessage: Forbidden; Description: Cause: Required scope "service_manager.broker.deregister" is missing from user token scopes [service_manager.broker.read service_manager.readBroker service_manager.readServiceCatalog service_manager.servicecatalog.read service_manager.broker.register service_manager.registerBroker]. Cause: Client id "service_manager_broker_admin" from user token is not trusted
Error: Broker with name: bb was not found

$ echo $?
0
$ smctl delete-broker none
Service Broker(s) not found

$ echo $?
0

Expected Results:

non-zero exit code

Relevant Code Snippet:

smctl should allow skipping ssl validation

When service-manager is deployed with a self-signed certificate the smctl will fail to make requests as it will validate the signature.

smctl should provide an option like cf cli --skip-ssl-validation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.