Skip to content

Commit

Permalink
Introduce profile api group (#486)
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha authored Sep 25, 2024
1 parent e2ab111 commit 48258fb
Show file tree
Hide file tree
Showing 44 changed files with 21,876 additions and 305 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ COMPRESS ?= no
# CRD_OPTIONS ?= "crd:trivialVersions=true"
CRD_OPTIONS ?= "crd:allowDangerousTypes=true,crdVersions={v1}"
CODE_GENERATOR_IMAGE ?= ghcr.io/appscode/gengo:release-1.29
API_GROUPS ?= core:v1alpha1 identity:v1alpha1 management:v1alpha1 meta:v1alpha1 node:v1alpha1 ui:v1alpha1
API_GROUPS ?= core:v1alpha1 identity:v1alpha1 management:v1alpha1 meta:v1alpha1 node:v1alpha1 profile:v1alpha1 ui:v1alpha1

# Where to push the docker image.
REGISTRY ?= appscode
Expand Down
145 changes: 0 additions & 145 deletions apis/meta/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions apis/meta/v1alpha1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ func Resource(resource string) schema.GroupResource {
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&ChartPresetQuery{},
&ClusterProfile{},
&ClusterProfileList{},
&ClusterStatus{},
&ResourceCalculator{},
&ResourceDescriptor{},
Expand Down
91 changes: 0 additions & 91 deletions apis/meta/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions apis/profile/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
Copyright AppsCode Inc. and Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package meta

const (
GroupName = "profile.k8s.appscode.com"
)
33 changes: 33 additions & 0 deletions apis/profile/fuzzer/fuzzer.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
Copyright AppsCode Inc. and Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package fuzzer

import (
"kmodules.xyz/resource-metadata/apis/profile/v1alpha1"

fuzz "github.com/google/gofuzz"
runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer"
)

// Funcs returns the fuzzer functions for this api group.
var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
return []interface{}{
func(s *v1alpha1.ClusterProfile, c fuzz.Continue) {
c.FuzzNoCustom(s) // fuzz self without calling this function again
},
}
}
30 changes: 30 additions & 0 deletions apis/profile/install/install.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
Copyright AppsCode Inc. and Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package install

import (
"kmodules.xyz/resource-metadata/apis/profile/v1alpha1"

"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
)

// Install registers the API group and adds types to a scheme
func Install(scheme *runtime.Scheme) {
utilruntime.Must(v1alpha1.AddToScheme(scheme))
utilruntime.Must(scheme.SetVersionPriority(v1alpha1.SchemeGroupVersion))
}
Loading

0 comments on commit 48258fb

Please sign in to comment.