Uploaded image for project: 'Couchbase Kubernetes'
  1. Couchbase Kubernetes
  2. K8S-2946

Support unmarshalling with annotations

    XMLWordPrintable

Details

    • New Feature
    • Resolution: Fixed
    • Major
    • 2.4.1
    • None
    • operator
    • None
    • 9 - Krakend, 10 - Krackeverlasting, 1 - Levianthanning, 2 - LeVIAthan or LeviaTHAN
    • 5

    Description

      We should have the ability to unmarshal types and use annotations to set values.

      Requirements:

      1) A tag may optionally be placed on any field of any crd Type called "annotation_url" that will specify which annotation can set that field's value.

      2) A custom unmarshal method will be created that can recursively check all fields for matching annotation_url tags to map.

      See https://replit.com/@JustinAshworth2/SuperbImmaculateDigits#main.go for an example. 

      3) The unmarshal method needs to set fields for primatives only (bool, string, int, duration).  It should only recurse on structs

      4) There needs to be unit tests for the following:

      a.  Bool, int, string, duration fields on the root of the object that has annotations

      b. Bool, int, string, duration inside the spec of the root object

      c.  Bool, int, string, duration nested inside a struct within the spec of the root object

      d. Bool, int, string, duration nested inside a struct, within a struct, within the spec of the root object

      e.   Unit tests where the passed fields are not pointers (This should error, as you cannot use reflection to set non-pointer types)

       

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              Alex.emery Alex Emery (Inactive)
              justin.ashworth Justin Ashworth
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty