mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
ad41fb8c96
Fixes an issue where CRDs were being created without schema, allowing resources with invalid content to be created, later stalling the controller ListWatch event channel when the invalid resources could not be deserialized. This also requires moving Addon GVK tracking from a status field to an annotation, as the GroupVersionKind type has special handling internal to Kubernetes that prevents it from being serialized to the CRD when schema validation is enabled. Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
16 lines
345 B
Go
16 lines
345 B
Go
package crd
|
|
|
|
import (
|
|
v1 "github.com/k3s-io/k3s/pkg/apis/k3s.cattle.io/v1"
|
|
"github.com/rancher/wrangler/pkg/crd"
|
|
)
|
|
|
|
func List() []crd.CRD {
|
|
addon := crd.NamespacedType("Addon.k3s.cattle.io/v1").
|
|
WithSchemaFromStruct(v1.Addon{}).
|
|
WithColumn("Source", ".spec.source").
|
|
WithColumn("Checksum", ".spec.checksum")
|
|
|
|
return []crd.CRD{addon}
|
|
}
|