Upgrading from: v0.14.x
This version contains major upgrades to how kinds are structured, mostly centered around the resource.Object
interface and introduction of
resource.Kind
. Marshal and Unmarshal logic was removed from resource.Object
and moved into wire-encoding specific resource.Codec
implementations
contained in the newly-introduced resource.Kind
(which also implements and embeds resource.Schema
). resource.Object
was further updated
to explicitly implement kubernetes interfaces runtime.Object
, meta/v1.Object
, and schema.ObjectKind
, making it fully compatible with all
kubernetes go libraries. resource.List
was also similarly updated.
Pre-built generic and typed implementations of resource.Object
were replaced with resource.UntypedObject
, resource.TypedObject
, resource.TypedSpecObject
, and resource.TypedSpecStatusObject
. The various stores have been updated to work with these objects where appropriate.
Other packages, such as operator
and simple
have minor changes to work with resource.Kind
instead of resource.Schema
where codec information is required.
Most of the migration is handled by the codegen, as the bulk of the changes are to the resource.Object
interface and introduction of resource.Kind
. Go through the following steps to ensure your project will build and run with v0.15
:
- Download, install, or build the v0.15.x version of the grafana-app-sdk CLI
- Run
grafana-app-sdk generate
(with any appropriate flags for your project) to generate new kinds - Run
go get github.com/grafana/[email protected]
(or later patch versions) to update the version you use in your project - Any place in your code that uses
<kindversionpackage>.Object
, replace it with<kindversionpackage>.<kind name>
- Any place in your code that uses
<kindversionpackage>.Schema()
, update to use<kindversionpackage>.Kind()
. Some places will not require this change, butresource.Kind
(produced byKind()
) implementsresource.Schema
(produced bySchema()
), so this will still work for functions that consumeresource.Schema
. - Any place that uses
resource.SimpleObject[T]
, replace it withresource.TypedSpecObject[T]
- Any place that uses
resource.SimpleList[T]
, replace it withresource.TypedList[T]
- Any places that uses
resource.SimpleStoreResource[T]
(this is for values returned byresource.SimpleStore
), replace it withresource.TypedObject[T, resource.MapSubresourceCatalog]
(this is the new type returned byresource.SimpleStore
).