Skip to content

Support for CRDs #1

@wozniakjan

Description

@wozniakjan

This currently has no support for CRDs, but I suspect adding CRDs to the scheme should be sufficient.

// TODO allow adding CRDs to the scheme
codecs := serializer.NewCodecFactory(scheme.Scheme)
obj, _, err := codecs.UniversalDeserializer().Decode(data, nil, nil)
checkFatal(err)
return obj

The plan is to look for these patterns from apimachinery and/or controller-runtime

import (
     "k8s.io/apimachinery/pkg/runtime/schema"
     "sigs.k8s.io/controller-runtime/pkg/scheme"
)
 
var (
    // GroupVersion is group version used to register these objects
    GroupVersion = schema.GroupVersion{Group: "group.k8s", Version: "v1beta1"}

    // SchemeBuilder is used to add go types to the GroupVersionKind scheme
    SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

    // AddToScheme adds the types in this group-version to the given scheme.
    AddToScheme = SchemeBuilder.AddToScheme
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions