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

capi 1.97.0 breaking change: "cf set-label service-instance" swallows service instance status and message #1847

Closed
gberche-orange opened this issue Sep 15, 2020 · 3 comments
Labels

Comments

@gberche-orange
Copy link
Contributor

Issue

As a cf-user

  • in order to manage service instances with labels and annotations
  • I need the service instance status and message to not be altered after metadata are assigned

Rationale: labels and annotations can be assigned to service instances by different personas such as automated tooling (for use cases such as recharging, alarming, etc...) which should be independent of the service instance resource lifecycle (which is kept in sync with the vision exposed by the associated service broker)

Context

Support for attaching metadata has been around for a while now, and enable users and tooling to attach metadata to cloudfoundry resources, including service instances.

Starting with recent capi version (likely 1.93.0) with work on service instances in v3 api, the equivalent of a cf set-label service-instance has the side effect of resetting the service instance status and message fields.

Steps to Reproduce

cf cs overview-service small gberche3
Creating service instance gberche3 in org osb-cmdb-services-acceptance-tests / space development as gberche...
OK

Create in progress. Use 'cf services' or 'cf service gberche3' to check operation status.
guillaume@guillaume-dev-box:~/code/sec-group-broker-filter$ (master) cf service gberche3
Showing info of service gberche3 in org osb-cmdb-services-acceptance-tests / space development as gberche...

name:             gberche3
service:          overview-service
tags:             
plan:             small
description:      Provides an overview of any service instances and bindings that have been created by a platform.
documentation:    
dashboard:        https://overview-broker.redacted-domain.org/dashboard?time=2020-09-14T15:06:12.514Z
service broker:   overview-broker

Showing status of last operation from service gberche3...

status:    create failed
message:   Operation failed
started:   2020-09-14T15:06:12Z
updated:   2020-09-14T15:06:16Z

There are no bound apps for this service.

There is no upgrade available for this service.

then update metadata for this service

CF_TRACE=true cf curl -X PATCH /v3/service_instances/$(cf service gberche3 --guid) -d '{
    "metadata": {
      "annotations": {
        "note": "detailed information"
      },
      "labels": {
        "key": "value"
      }
    }
  }'

Expected result

The service instance should still remain on the failed state

Current result

The service instance is unexpectedly observed to be in the success state and its associated message got lost

cf service gberche3
Showing info of service gberche6 in org osb-cmdb-services-acceptance-tests / space development as gberche...

name:             gberche3
service:          overview-service
tags:             
plan:             small
description:      Provides an overview of any service instances and bindings that have been created by a platform.
documentation:    
dashboard:        https://overview-broker.redacted-domain.org/dashboard?time=2020-09-15T14:08:15.105Z
service broker:   overview-broker

Showing status of last operation from service gberche3...

status:    update succeeded
message:   
started:   2020-09-15T15:37:34Z
updated:   2020-09-15T15:37:34Z

There are no bound apps for this service.

There is no upgrade available for this service.

Possible Fix

Likely related to https://github.com/cloudfoundry/capi-release/issues/183 distinguish metadata-only update on a service instance (which should not lead to locking or status update), from a general service instance update which should indeed trigger locking and status update.

name of issue screenshot

[if relevant, include a screenshot]

@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/174825537

The labels on this github issue will be updated when the story is started.

@kirederik
Copy link

This issue is now fixed and will be included in the next capi-release. We'll close the issue once it's released.

Thanks for bringing it to our attention @gberche-orange !

@kirederik
Copy link

CAPI 1.99.0 is out 🚀

Closing this issue as it should be fixed. Please re-open if that's not the case!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants