cloudfoundry / cloudfoundry/cloud_controller_ng

System Metadata Proposal

Open
#3,853 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
207
Forks
373
Avg merge
2d 12h
Merged PRs (30d)
56

Description

System Metadata

Authors: @beyhan

Reviewers: @stephanme

Feature goals

System metadata will allow CF admin users to set metadata from type label or annotations to CF resources. The system metadata will be updatable only by CF admin users. This feature can be used by CF itself or CF operators to add extra metadata to CF resources which can be used later for resource selection or resource statistics.

How to Use It

CF admin users will update a CF resource metadata via the existing CF V3 APIs for resource patching. E.g. a CF organization could be updated via the existing organization update API PATCH /v3/organizations/:org-guid with the following body content:

{
  "metadata": {
    "systemLabels": {  "systemLabel": “true” },
    "systemAnnotations": {  "systemAnnotation": "true" },
    "labels": {},
    "annotations": {}
  }
}

None CF admin users having authorizations to list a CF resource will be able to view the system metadata with read-only permissions. E.g. a CF user who has the org manager role will be able to see the system metadata assigned to a org via organization list APIs GET /v3/organizations/:org-guid. Example response:

HTTP/1.1 200 OK
Content-Type: application/json
 
{
  ... 
  "metadata": {
    "systemLabels": {  "systemLabel": “true” },
    "systemAnnotations": {  "systemAnnotation": "true" },
    "labels": {},
    "annotations": {}
  }
}

Technical Details

This feature suggests extending the metadata object with system metadata for labels and annotations. This suggestion is backwards compatible because it does not suggest changing existing metadata types. The system metadata will have the same constraints as the none system ones documented in the CF APIs. When a none admin user tries to update system metadata the request should fail and not change anything. In CF APIs we have already today APIs which can require multiple roles e.g. create domain.

Possible Future Enhancements

CF CLI can be extended to support system metadata. The scope of the current proposal is to extend the CF APIs only but, in the future, this can be supported via the CLI also. E.g. a new command cf set-system-label could be implemented.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing CF V3 resource patching APIs and the documented labels and annotations constraints linked in the proposal. The work is done when system labels and annotations are supported across the intended resource APIs, admin-only updates are enforced without partial changes, and authorized non-admin users can read them.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.