Skip to content

CCXDEV-14850: align insights DataGather with config #2248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion insights/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"

insightsv1alpha1 "github.com/openshift/api/insights/v1alpha1"
insightsv1alpha2 "github.com/openshift/api/insights/v1alpha2"
)

const (
GroupName = "insights.openshift.io"
)

var (
schemeBuilder = runtime.NewSchemeBuilder(insightsv1alpha1.Install)
schemeBuilder = runtime.NewSchemeBuilder(insightsv1alpha1.Install, insightsv1alpha2.Install)
// Install is a function which adds every version of this group to a scheme
Install = schemeBuilder.AddToScheme
)
Expand Down
3 changes: 3 additions & 0 deletions insights/v1alpha2/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.PHONY: test
test:
make -C ../../tests test GINKGO_EXTRA_ARGS=--focus="insights.openshift.io/v1alpha2"
7 changes: 7 additions & 0 deletions insights/v1alpha2/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// +k8s:deepcopy-gen=package,register
// +k8s:defaulter-gen=TypeMeta
// +k8s:openapi-gen=true

// +groupName=insights.openshift.io
// Package v1alpha2 is the v1alpha2 version of the API.
package v1alpha2
38 changes: 38 additions & 0 deletions insights/v1alpha2/register.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package v1alpha2

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)

var (
GroupName = "insights.openshift.io"
GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha2"}
schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
// Install is a function which adds this version to a scheme
Install = schemeBuilder.AddToScheme

// SchemeGroupVersion generated code relies on this name
// Deprecated
SchemeGroupVersion = GroupVersion
// AddToScheme exists solely to keep the old generators creating valid code
// DEPRECATED
AddToScheme = schemeBuilder.AddToScheme
)

// Resource generated code relies on this being here, but it logically belongs to the group
// DEPRECATED
func Resource(resource string) schema.GroupResource {
return schema.GroupResource{Group: GroupName, Resource: resource}
}

// Adds the list of known types to api.Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(GroupVersion,
&DataGather{},
&DataGatherList{},
)
metav1.AddToGroupVersion(scheme, GroupVersion)
return nil
}
Loading