Upgrading from: v0.27.0
This version includes a CUE upgrade, which adds some additional requirements to your cue.mod/module.cue
file.
Your CUE module is now required to be domain-qualified, so a module like foo/kinds
must be changed to github.com/example/foo/kinds
or foo.grafana.app/kinds
(or similar).
By default, new projects created with grafana-app-sdk project init
without a domain in their go module will use <module name>.grafana.app
as their domain.
Additionally, the cue.mod/module.cue
file must contain a language: version
section, specifying the CUE language version to use when parsing.
By default in new projects, we now use language: version: "v0.8.2"
, so the simplest update to this is to add that line after your module
section in the file.
An update of an example old cue.mod/module.cue
:
module: "foo/kinds"
Should be transformed to:
module: "foo.grafana.app/kinds"
language: version: "v0.8.2"
Tip
You can create a new project with grafana-app-sdk init <modname>
to see the current valid state of a <kinds dir>/cue.mod/module.cue
file
The various New
functions in the operator
package have been simplified to single NewX
functions with options objects.
If you use simple.App
or simple.Operator
, you shouldn't need to make any changes, but if you are building a custom operator, this will apply to you.
NewKubernetesBasedInformer
andNewKubernetesBasedInformerWithFilters
have been reduced to justNewKubernetesBasedInformer(resource.Kind, ListWatchClient, KubernetesBasedInformerOptions)
NewMemcachedInformer
andNewMemcachedInformerWithFilters
have been reduced to justNewMemcachedInformer(resource.Kind, ListWatchClient, MemcachedInformerOptions)
To migrate your CUE module file, use the following steps:
- If your
module
section is not domain-qualified (does not start with a domain with a.
in it), add a domain to your module, such as changingfoo/kinds
tofoo.grafana.app/kinds
. - Add the line
language: version: "v0.8.2"
below yourmodule
line