Skip to content

Commit

Permalink
Always set type meta for GenericResource
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha committed Feb 7, 2022
1 parent 9300292 commit a121b8c
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ require (
k8s.io/component-base v0.21.1 // indirect
k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e // indirect
k8s.io/utils v0.0.0-20210802155522-efc7438f0176 // indirect
kmodules.xyz/resource-metadata v0.9.0 // indirect
kmodules.xyz/resource-metadata v0.9.1 // indirect
kmodules.xyz/resource-metrics v0.0.8 // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15 // indirect
sigs.k8s.io/cli-utils v0.26.1 // indirect
Expand Down
3 changes: 2 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1257,8 +1257,9 @@ kmodules.xyz/openshift v0.0.0-20210618001443-f2507caa512f h1:V1lapZtGG7GntoUsOuE
kmodules.xyz/openshift v0.0.0-20210618001443-f2507caa512f/go.mod h1:8E5ckbd1KMNmR4hc7ScvmQnGfx1ULUUp+UTmoDdxRkc=
kmodules.xyz/prober v0.0.0-20210618020259-5836fb959027 h1:rtSPsruEkoBOLcbJkxMQjnPafpv8/vJnfWlTIj9yRBg=
kmodules.xyz/prober v0.0.0-20210618020259-5836fb959027/go.mod h1:H4NcvS1RQxeXtQONALbU6r9OT3Xa7cMhfamX/k9t9wo=
kmodules.xyz/resource-metadata v0.9.0 h1:kRY126ccnqHI3JTpZNocD2n+OY4zk1G8jczl7fp2BJk=
kmodules.xyz/resource-metadata v0.9.0/go.mod h1:GsaythrHLBLKhEy8/l+ioJC0mFmJmZR0FRXpkyxztt8=
kmodules.xyz/resource-metadata v0.9.1 h1:YQAeAnVKK7jULbV4HTcY2JJrtVsh9B64V6wn2FZEZm8=
kmodules.xyz/resource-metadata v0.9.1/go.mod h1:GsaythrHLBLKhEy8/l+ioJC0mFmJmZR0FRXpkyxztt8=
kmodules.xyz/resource-metrics v0.0.6/go.mod h1:M7rWuo2qh3BpHhogiEVPnvGY9Xx4Pfygqn1Rex8YbgM=
kmodules.xyz/resource-metrics v0.0.8 h1:4WHV7vKGfoxpZquu/Jowq4pgoMEithyMjFfJIg68Nq8=
kmodules.xyz/resource-metrics v0.0.8/go.mod h1:M7rWuo2qh3BpHhogiEVPnvGY9Xx4Pfygqn1Rex8YbgM=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ func ToGenericResource(item client.Object, apiType *kmapi.ResourceID, cmeta *kma
}

genres := GenericResource{
// TypeMeta: metav1.TypeMeta{},
TypeMeta: metav1.TypeMeta{
APIVersion: GroupVersion.String(),
Kind: ResourceKindGenericResource,
},
ObjectMeta: metav1.ObjectMeta{
Name: GetGenericResourceName(item),
GenerateName: item.GetGenerateName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ type GenericResource struct {
type GenericResourceSpec struct {
Cluster kmapi.ClusterMetadata `json:"cluster,omitempty"`
APIType kmapi.ResourceID `json:"apiType"`
Name string `json:"name,omitempty"`
Name string `json:"name"`
Version string `json:"version,omitempty"`
Replicas int64 `json:"replicas,omitempty"`
RoleReplicas api.ReplicaList `json:"roleReplicas,omitempty"`
Mode string `json:"mode,omitempty"`
TotalResource core.ResourceRequirements `json:"totalResource"`
AppResource core.ResourceRequirements `json:"appResource"`
TotalResource core.ResourceRequirements `json:"totalResource,omitempty"`
AppResource core.ResourceRequirements `json:"appResource,omitempty"`
RoleResourceLimits map[api.PodRole]core.ResourceList `json:"roleResourceLimits,omitempty"`
RoleResourceRequests map[api.PodRole]core.ResourceList `json:"roleResourceRequests,omitempty"`
Status GenericResourceStatus `json:"status"`
Expand Down

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

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,7 @@ kmodules.xyz/prober/probe
kmodules.xyz/prober/probe/exec
kmodules.xyz/prober/probe/http
kmodules.xyz/prober/probe/tcp
# kmodules.xyz/resource-metadata v0.9.0
# kmodules.xyz/resource-metadata v0.9.1
## explicit; go 1.17
kmodules.xyz/resource-metadata/apis/core/v1alpha1
# kmodules.xyz/resource-metrics v0.0.8
Expand Down

0 comments on commit a121b8c

Please sign in to comment.