Skip to content

Commit

Permalink
Fix api (#365)
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha authored Sep 21, 2023
1 parent 1608cca commit ac68abc
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 190 deletions.
4 changes: 0 additions & 4 deletions apis/core/fuzzer/fuzzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package fuzzer

import (
"kmodules.xyz/resource-metadata/apis/core/v1alpha1"
v1alpha12 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1"

fuzz "github.com/google/gofuzz"
runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer"
Expand All @@ -31,9 +30,6 @@ var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
func(s *v1alpha1.PodView, c fuzz.Continue) {
c.FuzzNoCustom(s) // fuzz self without calling this function again
},
func(s *v1alpha12.Project, c fuzz.Continue) {
c.FuzzNoCustom(s) // fuzz self without calling this function again
},
func(s *v1alpha1.ResourceSummary, c fuzz.Continue) {
c.FuzzNoCustom(s) // fuzz self without calling this function again
},
Expand Down
3 changes: 3 additions & 0 deletions apis/meta/fuzzer/fuzzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,8 @@ var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
func(s *v1alpha1.ResourceDescriptor, c fuzz.Continue) {
c.FuzzNoCustom(s) // fuzz self without calling this function again
},
func(s *v1alpha1.Project, c fuzz.Continue) {
c.FuzzNoCustom(s) // fuzz self without calling this function again
},
}
}
8 changes: 2 additions & 6 deletions apis/meta/v1alpha1/project_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ limitations under the License.
package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kmapi "kmodules.xyz/client-go/api/v1"
"kmodules.xyz/resource-metadata/apis/core/v1alpha1"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
Expand Down Expand Up @@ -83,7 +83,3 @@ type ProjectList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []Project `json:"items"`
}

func init() {
v1alpha1.SchemeBuilder.Register(&Project{}, &ProjectList{})
}
2 changes: 2 additions & 0 deletions apis/meta/v1alpha1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ func Resource(resource string) schema.GroupResource {
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&ChartPresetQuery{},
&Project{},
&ProjectList{},
&ResourceDescriptor{},
&ResourceDescriptorList{},
&ResourceTableDefinition{},
Expand Down

This file was deleted.

102 changes: 0 additions & 102 deletions crds/core.k8s.appscode.com_projects.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ kind: ResourceDescriptor
metadata:
creationTimestamp: null
labels:
k8s.io/group: core.k8s.appscode.com
k8s.io/group: meta.k8s.appscode.com
k8s.io/kind: Project
k8s.io/resource: projects
k8s.io/version: v1alpha1
name: core.k8s.appscode.com-v1alpha1-projects
name: meta.k8s.appscode.com-v1alpha1-projects
spec:
resource:
group: core.k8s.appscode.com
group: meta.k8s.appscode.com
kind: Project
name: projects
scope: Cluster
Expand Down Expand Up @@ -44,6 +44,39 @@ spec:
spec:
description: ProjectSpec defines the desired state of Project
properties:
monitoring:
properties:
alertmanagerRef:
description: ObjectReference contains enough information to let you inspect or modify the referred object.
properties:
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
namespace:
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
required:
- name
type: object
alertmanagerURL:
type: string
grafanaURL:
type: string
prometheusRef:
description: ObjectReference contains enough information to let you inspect or modify the referred object.
properties:
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
namespace:
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
required:
- name
type: object
prometheusURL:
type: string
type: object
namespaceSelector:
description: A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.
properties:
Expand Down Expand Up @@ -79,6 +112,42 @@ spec:
items:
type: string
type: array
presets:
items:
properties:
ref:
description: ObjectReference contains enough information to let you inspect or modify the referred object.
properties:
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
namespace:
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
required:
- name
type: object
resource:
description: ResourceID identifies a resource
properties:
group:
type: string
kind:
description: Kind is the serialized kind of the resource. It is normally CamelCase and singular.
type: string
name:
description: 'Name is the plural name of the resource to serve. It must match the name of the CustomResourceDefinition-registration too: plural.group and it must be all lowercase.'
type: string
scope:
description: ResourceScope is an enum defining the different scopes available to a custom resource
type: string
version:
type: string
required:
- group
type: object
type: object
type: array
type:
default: User
enum:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ kind: ResourceEditor
metadata:
creationTimestamp: null
labels:
k8s.io/group: core.k8s.appscode.com
k8s.io/group: meta.k8s.appscode.com
k8s.io/kind: Project
k8s.io/resource: projects
k8s.io/version: v1alpha1
name: core.k8s.appscode.com-v1alpha1-projects
name: meta.k8s.appscode.com-v1alpha1-projects
spec:
resource:
group: core.k8s.appscode.com
group: meta.k8s.appscode.com
kind: Project
name: projects
scope: Cluster
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ kind: ResourceTableDefinition
metadata:
creationTimestamp: null
labels:
k8s.io/group: core.k8s.appscode.com
k8s.io/group: meta.k8s.appscode.com
k8s.io/kind: Project
k8s.io/resource: projects
k8s.io/version: v1alpha1
name: core.k8s.appscode.com-v1alpha1-projects
name: meta.k8s.appscode.com-v1alpha1-projects
spec:
defaultView: true
resource:
group: core.k8s.appscode.com
group: meta.k8s.appscode.com
kind: Project
name: projects
scope: Cluster
Expand Down

0 comments on commit ac68abc

Please sign in to comment.