Skip to content

Commit

Permalink
dissociate apis in different packages
Browse files Browse the repository at this point in the history
  • Loading branch information
jotak committed Dec 14, 2023
1 parent 2424516 commit f27db3e
Show file tree
Hide file tree
Showing 75 changed files with 326 additions and 239 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ COPY go.mod go.mod
COPY go.sum go.sum
COPY vendor/ vendor/
COPY main.go main.go
COPY api/ api/
COPY apis/ apis/
COPY controllers/ controllers/
COPY pkg/ pkg/

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,10 @@ doc: crdoc ## Generate markdown documentation
$(CRDOC) --resources config/crd/bases/flows.netobserv.io_flowcollectors.yaml --output docs/FlowCollector.md

generate-go-conversions: $(CONVERSION_GEN) ## Run all generate-go-conversions
$(MAKE) clean-generated-conversions SRC_DIRS="./api/v1alpha1,./api/v1beta1"
$(MAKE) clean-generated-conversions SRC_DIRS="./apis/flowcollector/v1alpha1,./apis/flowcollector/v1beta1"
$(CONVERSION_GEN) \
--input-dirs=./api/v1alpha1 \
--input-dirs=./api/v1beta1 \
--input-dirs=./apis/flowcollector/v1alpha1 \
--input-dirs=./apis/flowcollector/v1beta1 \
--build-tag=ignore_autogenerated_core \
--output-file-base=zz_generated.conversion \
$(CONVERSION_GEN_OUTPUT_BASE) \
Expand Down
4 changes: 2 additions & 2 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ resources:
domain: netobserv.io
group: flows
kind: FlowCollector
path: github.com/netobserv/network-observability-operator/api/v1beta2
path: github.com/netobserv/network-observability-operator/apis/flowcollector/v1beta2
version: v1beta2
webhooks:
conversion: true
Expand All @@ -28,6 +28,6 @@ resources:
domain: netobserv.io
group: flows
kind: FlowMetric
path: github.com/netobserv/network-observability-operator/api/v1alpha1
path: github.com/netobserv/network-observability-operator/apis/flowcollector/v1alpha1
version: v1alpha1
version: "3"
File renamed without changes.
18 changes: 18 additions & 0 deletions apis/flowcollector/v1alpha1/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
Copyright 2022 The Kubernetes Authors.
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 v1aplha1 contains the v1alpha1 API implementation.
// +k8s:conversion-gen=github.com/netobserv/network-observability-operator/apis/flowcollector/v1beta2
//
// Deprecated: This package will be removed in one of the next releases.
package v1alpha1
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package v1alpha1
import (
"fmt"

"github.com/netobserv/network-observability-operator/api/v1beta2"
"github.com/netobserv/network-observability-operator/apis/flowcollector/v1beta2"
utilconversion "github.com/netobserv/network-observability-operator/pkg/conversion"
"github.com/netobserv/network-observability-operator/pkg/helper"
"github.com/netobserv/network-observability-operator/pkg/metrics"
Expand Down
File renamed without changes.

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/v1beta1/doc.go → apis/flowcollector/v1beta1/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ limitations under the License.
*/

// Package v1beta1 contains the v1beta1 API implementation.
// +k8s:conversion-gen=github.com/netobserv/network-observability-operator/api/v1beta2
// +k8s:conversion-gen=github.com/netobserv/network-observability-operator/apis/flowcollector/v1beta2
package v1beta1
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package v1beta1
import (
"fmt"

"github.com/netobserv/network-observability-operator/api/v1beta2"
"github.com/netobserv/network-observability-operator/apis/flowcollector/v1beta2"
utilconversion "github.com/netobserv/network-observability-operator/pkg/conversion"
"github.com/netobserv/network-observability-operator/pkg/helper"
"github.com/netobserv/network-observability-operator/pkg/metrics"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package v1beta1
import (
"testing"

"github.com/netobserv/network-observability-operator/api/v1beta2"
"github.com/netobserv/network-observability-operator/apis/flowcollector/v1beta2"
"github.com/stretchr/testify/assert"
"k8s.io/utils/ptr"
)
Expand Down
File renamed without changes.

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

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion api/v1alpha1/doc.go → apis/flowmetrics/v1alpha1/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ limitations under the License.
*/

// Package v1aplha1 contains the v1alpha1 API implementation.
// +k8s:conversion-gen=github.com/netobserv/network-observability-operator/api/v1beta2
package v1alpha1
File renamed without changes.
36 changes: 36 additions & 0 deletions apis/flowmetrics/v1alpha1/groupversion_info.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
Copyright 2021.
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 v1alpha1 contains API Schema definitions for the flows v1alpha1 API group
// +kubebuilder:object:generate=true
// +groupName=flows.netobserv.io
package v1alpha1

import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "flows.netobserv.io", Version: "v1alpha1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
)
Loading

0 comments on commit f27db3e

Please sign in to comment.