* Update dashboard app to use app SDK v0.35.0
What
This change updates dashboard app to use app SDK v0.35.0 and adds new
Makefile target for running codegen for all apps, in opt-in manner.
Currently only dashboards app is opted in.
Additionally, this changes dashboard app Makefile to properly install
and update app SDK versions when generating code, with app SDK version
pinned in the Makefile itself.
Why
The upgrade addresses issues with `DeepCopy` methods, while the Makefile
targets ensure that codegen is easy to run and uses reproducible
environments.
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
* Run make update-workspace
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
* Fix deepcopy methods
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
* Re-run CUE codegen to satisfy the CI
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
* Run make update-workspace
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
* Update to v0.35.1
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
---------
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
# Remove auto-generated DeepCopy and DeepCopyInto methods for Spec for v0alpha1.
@sed -e '/\/\/ DeepCopy creates a full deep copy of Spec/,+5d' ./pkg/apis/dashboard/v0alpha1/dashboard_object_gen.go > ./pkg/apis/dashboard/v0alpha1/dashboard_object_gen.go.tmp
@sed -e '/\/\/ DeepCopyInto deep copies Spec into another Spec object/,+3d' ./pkg/apis/dashboard/v0alpha1/dashboard_object_gen.go.tmp > ./pkg/apis/dashboard/v0alpha1/dashboard_object_gen.go.tmp2
# Remove auto-generated DeepCopy and DeepCopyInto methods for Spec for v1alpha1.
@sed -e '/\/\/ DeepCopy creates a full deep copy of Spec/,+5d' ./pkg/apis/dashboard/v1alpha1/dashboard_object_gen.go > ./pkg/apis/dashboard/v1alpha1/dashboard_object_gen.go.tmp
@sed -e '/\/\/ DeepCopyInto deep copies Spec into another Spec object/,+3d' ./pkg/apis/dashboard/v1alpha1/dashboard_object_gen.go.tmp > ./pkg/apis/dashboard/v1alpha1/dashboard_object_gen.go.tmp2
@ -219,8 +219,21 @@ func (o *Dashboard) Copy() resource.Object {
}
func(o*Dashboard)DeepCopyObject()runtime.Object{
// This really should be deep copy. If the generator tries to change it to o.Copy() it needs to be manually changed back to o.DeepCopy() and this comment added back.
returno.DeepCopy()
returno.Copy()
}
func(o*Dashboard)DeepCopy()*Dashboard{
cpy:=&Dashboard{}
o.DeepCopyInto(cpy)
returncpy
}
func(o*Dashboard)DeepCopyInto(dst*Dashboard){
dst.TypeMeta.APIVersion=o.TypeMeta.APIVersion
dst.TypeMeta.Kind=o.TypeMeta.Kind
o.ObjectMeta.DeepCopyInto(&dst.ObjectMeta)
o.Spec.DeepCopyInto(&dst.Spec)
o.Status.DeepCopyInto(&dst.Status)
}
// Interface compliance compile-time check
@ -266,5 +279,31 @@ func (o *DashboardList) SetItems(items []resource.Object) {
@ -219,8 +219,21 @@ func (o *Dashboard) Copy() resource.Object {
}
func(o*Dashboard)DeepCopyObject()runtime.Object{
// This really should be deep copy. If the generator tries to change it to o.Copy() it needs to be manually changed back to o.DeepCopy() and this comment added back.
returno.DeepCopy()
returno.Copy()
}
func(o*Dashboard)DeepCopy()*Dashboard{
cpy:=&Dashboard{}
o.DeepCopyInto(cpy)
returncpy
}
func(o*Dashboard)DeepCopyInto(dst*Dashboard){
dst.TypeMeta.APIVersion=o.TypeMeta.APIVersion
dst.TypeMeta.Kind=o.TypeMeta.Kind
o.ObjectMeta.DeepCopyInto(&dst.ObjectMeta)
o.Spec.DeepCopyInto(&dst.Spec)
o.Status.DeepCopyInto(&dst.Status)
}
// Interface compliance compile-time check
@ -266,5 +279,31 @@ func (o *DashboardList) SetItems(items []resource.Object) {
@ -219,8 +219,21 @@ func (o *Dashboard) Copy() resource.Object {
}
func(o*Dashboard)DeepCopyObject()runtime.Object{
// This really should be deep copy. If the generator tries to change it to o.Copy() it needs to be manually changed back to o.DeepCopy() and this comment added back.
returno.DeepCopy()
returno.Copy()
}
func(o*Dashboard)DeepCopy()*Dashboard{
cpy:=&Dashboard{}
o.DeepCopyInto(cpy)
returncpy
}
func(o*Dashboard)DeepCopyInto(dst*Dashboard){
dst.TypeMeta.APIVersion=o.TypeMeta.APIVersion
dst.TypeMeta.Kind=o.TypeMeta.Kind
o.ObjectMeta.DeepCopyInto(&dst.ObjectMeta)
o.Spec.DeepCopyInto(&dst.Spec)
o.Status.DeepCopyInto(&dst.Status)
}
// Interface compliance compile-time check
@ -266,5 +279,41 @@ func (o *DashboardList) SetItems(items []resource.Object) {
// `value`: Maps text values to a color or different display text and color. For example, you can configure a value mapping so that all instances of the value 10 appear as Perfection! rather than the number.
// `range`: Maps numerical ranges to a display text and color. For example, if a value is within a certain range, you can configure a range value mapping to display Low or High rather than the number.
// `regex`: Maps regular expressions to replacement text and a color. For example, if a value is www.example.com, you can configure a regex value mapping so that Grafana displays www and truncates the domain.
// `special`: Maps special values like Null, NaN (not a number), and boolean values like true and false to a display text and color. See SpecialValueMatch to see the list of special values. For example, you can configure a special value mapping so that null values appear as N/A.
// `value`: Maps text values to a color or different display text and color. For example, you can configure a value mapping so that all instances of the value 10 appear as Perfection! rather than the number.
// `range`: Maps numerical ranges to a display text and color. For example, if a value is within a certain range, you can configure a range value mapping to display Low or High rather than the number.
// `regex`: Maps regular expressions to replacement text and a color. For example, if a value is www.example.com, you can configure a regex value mapping so that Grafana displays www and truncates the domain.
// `special`: Maps special values like Null, NaN (not a number), and boolean values like true and false to a display text and color. See SpecialValueMatch to see the list of special values. For example, you can configure a special value mapping so that null values appear as N/A.
// `value`: Maps text values to a color or different display text and color. For example, you can configure a value mapping so that all instances of the value 10 appear as Perfection! rather than the number.
// `range`: Maps numerical ranges to a display text and color. For example, if a value is within a certain range, you can configure a range value mapping to display Low or High rather than the number.
// `regex`: Maps regular expressions to replacement text and a color. For example, if a value is www.example.com, you can configure a regex value mapping so that Grafana displays www and truncates the domain.
// `special`: Maps special values like Null, NaN (not a number), and boolean values like true and false to a display text and color. See SpecialValueMatch to see the list of special values. For example, you can configure a special value mapping so that null values appear as N/A.
typeMappingTypestring
const(
MappingTypeValueToTextMappingType="value"
MappingTypeRangeToTextMappingType="range"
MappingTypeRegexToTextMappingType="regex"
MappingTypeSpecialValueMappingType="special"
)
// Result used as replacement with text and color when the value matches
// `value`: Maps text values to a color or different display text and color. For example, you can configure a value mapping so that all instances of the value 10 appear as Perfection! rather than the number.
// `range`: Maps numerical ranges to a display text and color. For example, if a value is within a certain range, you can configure a range value mapping to display Low or High rather than the number.
// `regex`: Maps regular expressions to replacement text and a color. For example, if a value is www.example.com, you can configure a regex value mapping so that Grafana displays www and truncates the domain.
// `special`: Maps special values like Null, NaN (not a number), and boolean values like true and false to a display text and color. See SpecialValueMatch to see the list of special values. For example, you can configure a special value mapping so that null values appear as N/A.