mirror of
https://github.com/genuinetools/reg.git
synced 2024-08-21 06:10:23 -04:00
48 lines
1.5 KiB
Go
48 lines
1.5 KiB
Go
![]() |
package v1beta1
|
||
|
|
||
|
import (
|
||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||
|
"k8s.io/apimachinery/pkg/runtime"
|
||
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||
|
)
|
||
|
|
||
|
// GroupName is the group name used to register these objects
|
||
|
const GroupName = "compose.docker.com"
|
||
|
|
||
|
// SchemeGroupVersion is group version used to register these objects
|
||
|
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"}
|
||
|
|
||
|
var (
|
||
|
// SchemeBuilder collects functions that add things to a scheme. It's to allow
|
||
|
// code to compile without explicitly referencing generated types. You should
|
||
|
// declare one in each package that will have generated deep copy or conversion
|
||
|
// functions.
|
||
|
SchemeBuilder runtime.SchemeBuilder
|
||
|
localSchemeBuilder = &SchemeBuilder
|
||
|
|
||
|
// AddToScheme applies all the stored functions to the scheme. A non-nil error
|
||
|
// indicates that one function failed and the attempt was abandoned.
|
||
|
AddToScheme = localSchemeBuilder.AddToScheme
|
||
|
)
|
||
|
|
||
|
func init() {
|
||
|
localSchemeBuilder.Register(addKnownTypes)
|
||
|
}
|
||
|
|
||
|
// Adds the list of known types to api.Scheme.
|
||
|
func addKnownTypes(scheme *runtime.Scheme) error {
|
||
|
scheme.AddKnownTypes(SchemeGroupVersion,
|
||
|
&Stack{},
|
||
|
&StackList{},
|
||
|
&Owner{},
|
||
|
&OwnerList{},
|
||
|
)
|
||
|
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
||
|
func Resource(resource string) schema.GroupResource {
|
||
|
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||
|
}
|