k3s/pkg/crd/crds.go
Brad Davidson 500744bb94 Add new CRD for etcd snapshots
Also adds a hack go script to print the embedded CRDs, for developer use.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-12 15:04:45 -07:00

25 lines
734 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 := v1.Addon{}
etcdSnapshotFile := v1.ETCDSnapshotFile{}
return []crd.CRD{
crd.NamespacedType("Addon.k3s.cattle.io/v1").
WithSchemaFromStruct(addon).
WithColumn("Source", ".spec.source").
WithColumn("Checksum", ".spec.checksum"),
crd.NonNamespacedType("ETCDSnapshotFile.k3s.cattle.io/v1").
WithSchemaFromStruct(etcdSnapshotFile).
WithColumn("SnapshotName", ".spec.snapshotName").
WithColumn("Node", ".spec.nodeName").
WithColumn("Location", ".spec.location").
WithColumn("Size", ".status.size").
WithColumn("CreationTime", ".status.creationTime"),
}
}