Skip to content
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

Generate register functions for APIs #2023

Open
wants to merge 1 commit into
base: main
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
4 changes: 0 additions & 4 deletions api/actions/v1alpha1/addclusterinfo_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,3 @@ type AddClusterInfoList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []AddClusterInfo `json:"items"`
}

func init() {
SchemeBuilder.Register(&AddClusterInfo{}, &AddClusterInfoList{})
}
4 changes: 0 additions & 4 deletions api/actions/v1alpha1/deleteattribute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,3 @@ type DeleteAttributeList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []DeleteAttribute `json:"items"`
}

func init() {
SchemeBuilder.Register(&DeleteAttribute{}, &DeleteAttributeList{})
}
5 changes: 5 additions & 0 deletions api/actions/v1alpha1/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// +k8s:deepcopy-gen=package
// +groupName=actions.odigos.io

// Package v1alpha1 is the v1alpha1 version of the API.
package v1alpha1
4 changes: 0 additions & 4 deletions api/actions/v1alpha1/errorsampler_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,3 @@ type ErrorSamplerList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []ErrorSampler `json:"items"`
}

func init() {
SchemeBuilder.Register(&ErrorSampler{}, &ErrorSamplerList{})
}
36 changes: 0 additions & 36 deletions api/actions/v1alpha1/groupversion_info.go

This file was deleted.

4 changes: 0 additions & 4 deletions api/actions/v1alpha1/latencysampler_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,3 @@ type LatencySamplerList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []LatencySampler `json:"items"`
}

func init() {
SchemeBuilder.Register(&LatencySampler{}, &LatencySamplerList{})
}
4 changes: 0 additions & 4 deletions api/actions/v1alpha1/piimasking_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,3 @@ type PiiMaskingList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []PiiMasking `json:"items"`
}

func init() {
SchemeBuilder.Register(&PiiMasking{}, &PiiMaskingList{})
}
4 changes: 0 additions & 4 deletions api/actions/v1alpha1/probabilisticsampler_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,3 @@ type ProbabilisticSamplerList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []ProbabilisticSampler `json:"items"`
}

func init() {
SchemeBuilder.Register(&ProbabilisticSampler{}, &ProbabilisticSamplerList{})
}
4 changes: 0 additions & 4 deletions api/actions/v1alpha1/renameattribute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,3 @@ type RenameAttributeList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []RenameAttribute `json:"items"`
}

func init() {
SchemeBuilder.Register(&RenameAttribute{}, &RenameAttributeList{})
}
81 changes: 81 additions & 0 deletions api/actions/v1alpha1/zz_generated.register.go

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

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

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

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

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

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

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

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

2 changes: 1 addition & 1 deletion api/generated/actions/applyconfiguration/utils.go

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

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

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

2 changes: 1 addition & 1 deletion api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ require (
k8s.io/apimachinery v0.31.0
k8s.io/client-go v0.31.0
k8s.io/code-generator v0.31.0
sigs.k8s.io/controller-runtime v0.19.0
sigs.k8s.io/structured-merge-diff/v4 v4.4.1
)

Expand All @@ -22,6 +21,7 @@ require (
github.com/x448/float16 v0.8.4 // indirect
golang.org/x/sync v0.7.0 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
sigs.k8s.io/controller-runtime v0.19.0 // indirect
)

require (
Expand Down
6 changes: 5 additions & 1 deletion api/hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-

source "${CODEGEN_PKG}/kube_codegen.sh"

THIS_PKG="k8s.io/code-generator/examples"
THIS_PKG="github.com/odigos-io/odigos/api"

kube::codegen::gen_register \
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt" \
"${SCRIPT_ROOT}"

# https://github.com/kubernetes/code-generator/blob/de98b55e3b8c7dca2dfcbf840c0d0a4e6f6b29c9/kube_codegen.sh#L436
kube::codegen::gen_client \
Expand Down
4 changes: 0 additions & 4 deletions api/odigos/v1alpha1/collectorsgroup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,3 @@ type CollectorsGroupList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []CollectorsGroup `json:"items"`
}

func init() {
SchemeBuilder.Register(&CollectorsGroup{}, &CollectorsGroupList{})
}
4 changes: 0 additions & 4 deletions api/odigos/v1alpha1/destination_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ type DestinationList struct {
Items []Destination `json:"items"`
}

func init() {
SchemeBuilder.Register(&Destination{}, &DestinationList{})
}

var _ config.ExporterConfigurer = &Destination{}

/* Implement common.ExporterConfigurer */
Expand Down
36 changes: 0 additions & 36 deletions api/odigos/v1alpha1/groupversion_info.go

This file was deleted.

4 changes: 0 additions & 4 deletions api/odigos/v1alpha1/instrumentationconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,6 @@ type InstrumentationConfigList struct {
Items []InstrumentationConfig `json:"items"`
}

func init() {
SchemeBuilder.Register(&InstrumentationConfig{}, &InstrumentationConfigList{})
}

// Languages returns the set of languages that this configuration applies to
func (ic *InstrumentationConfig) Languages() map[common.ProgrammingLanguage]struct{} {
langs := make(map[common.ProgrammingLanguage]struct{})
Expand Down
4 changes: 0 additions & 4 deletions api/odigos/v1alpha1/instrumentationinstance_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,3 @@ type InstrumentationInstanceList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []InstrumentationInstance `json:"items"`
}

func init() {
SchemeBuilder.Register(&InstrumentationInstance{}, &InstrumentationInstanceList{})
}
4 changes: 0 additions & 4 deletions api/odigos/v1alpha1/instrumentationrule_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,3 @@ type InstrumentationRuleList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []InstrumentationRule `json:"items"`
}

func init() {
SchemeBuilder.Register(&InstrumentationRule{}, &InstrumentationRuleList{})
}
4 changes: 0 additions & 4 deletions api/odigos/v1alpha1/instrumentedapplication_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,3 @@ type InstrumentedApplicationList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []InstrumentedApplication `json:"items"`
}

func init() {
SchemeBuilder.Register(&InstrumentedApplication{}, &InstrumentedApplicationList{})
}
Loading
Loading