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

feat(api): add Konnect API group #443

Closed
wants to merge 1 commit into from
Closed
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@
plugins distributed as container images.
[400](https://github.com/Kong/gateway-operator/pull/400)

### Changes
czeslavo marked this conversation as resolved.
Show resolved Hide resolved

- Go API import paths changed. If you've been using the `v1beta1` or `v1alpha` APIs
they have now been moved:
- from `api/v1beta1` to `api/gateway-operator/v1beta1`
- and from `api/v1alpha1` to `api/gateway-operator/v1alpha1`
[#443](https://github.com/Kong/gateway-operator/pull/443)

### Fixed

- Fixed `ControlPlane` cluster wide resources not migrating to new ownership labels
Expand Down
14 changes: 4 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -200,22 +200,16 @@ generate.api: controller-gen
# this will generate the custom typed clients needed for end-users implementing logic in Go to use our API types.
.PHONY: generate.clientsets
generate.clientsets: client-gen
# We create a symlink to the apis/ directory as a hack because currently
# client-gen does not properly support the use of api/ as your API
# directory.
#
# See: https://github.com/kubernetes/code-generator/issues/167
ln -sf api apis
$(CLIENT_GEN) \
--go-header-file ./hack/generators/boilerplate.go.txt \
--clientset-name clientset \
--input-base '' \
--input $(REPO)/apis/v1alpha1 \
--input $(REPO)/apis/v1beta1 \
--input $(REPO)/$(API_DIR)/gateway-operator/v1alpha1 \
--input $(REPO)/$(API_DIR)/gateway-operator/v1beta1 \
--input $(REPO)/$(API_DIR)/konnect/v1alpha1 \
--output-dir pkg/ \
--output-pkg $(REPO)/pkg/
rm apis
find ./pkg/clientset/ -type f -name '*.go' -exec sed -i '' -e 's/github.com\/kong\/gateway-operator\/apis/github.com\/kong\/gateway-operator\/api/gI' {} \; &> /dev/null

.PHONY: generate.rbacs
generate.rbacs: kic-role-generator
$(KIC_ROLE_GENERATOR) --force
Expand Down
10 changes: 5 additions & 5 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,37 @@ resources:
controller: true
group: gateway-operator.konghq.com
kind: ControlPlane
path: github.com/kong/gateway-operator/api/v1beta1
path: github.com/kong/gateway-operator/api/gateway-operator/v1beta1
version: v1beta1
- api:
crdVersion: v1
namespaced: true
controller: true
group: gateway-operator.konghq.com
kind: DataPlane
path: github.com/kong/gateway-operator/api/v1beta1
path: github.com/kong/gateway-operator/api/gateway-operator/v1beta1
version: v1beta1
- api:
crdVersion: v1
namespaced: true
group: gateway-operator.konghq.com
kind: GatewayConfiguration
path: github.com/kong/gateway-operator/api/v1beta1
path: github.com/kong/gateway-operator/api/gateway-operator/v1beta1
version: v1beta1
- api:
crdVersion: v1
namespaced: true
controller: true
group: gateway-operator.konghq.com
kind: AIGateway
path: github.com/kong/gateway-operator/api/v1alpha1
path: github.com/kong/gateway-operator/api/gateway-operator/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
controller: true
group: gateway-operator.konghq.com
kind: DataPlaneMetricsExtension
path: github.com/kong/gateway-operator/api/v1alpha1
path: github.com/kong/gateway-operator/api/gateway-operator/v1alpha1
version: v1alpha1
version: "3"
4 changes: 4 additions & 0 deletions api/gateway-operator/v1alpha1/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package v1alpha1

// +groupName=gateway-operator.konghq.com
// +groupGoName=gatewayoperator
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"

"github.com/kong/gateway-operator/api/v1alpha1"
"github.com/kong/gateway-operator/api/gateway-operator/v1alpha1"
)

// Install is a callback from client-gen to add the scheme to the client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
gatewayv1 "sigs.k8s.io/gateway-api/apis/v1"

"github.com/kong/gateway-operator/api/v1alpha1"
"github.com/kong/gateway-operator/api/gateway-operator/v1alpha1"
)

func init() {
Expand Down
4 changes: 4 additions & 0 deletions api/gateway-operator/v1beta1/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package v1beta1

// +groupName=gateway-operator.konghq.com
// +groupGoName=gatewayoperator
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"

"github.com/kong/gateway-operator/api/v1beta1"
"github.com/kong/gateway-operator/api/gateway-operator/v1beta1"
)

// Install is a callback from client-gen to add the scheme to the client
Expand Down

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

4 changes: 4 additions & 0 deletions api/konnect/v1alpha1/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package v1alpha1

// +groupName=konnect.konghq.com
// +groupGoName=konnect
36 changes: 36 additions & 0 deletions api/konnect/v1alpha1/groupversion_info.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
Copyright 2022 Kong Inc.

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 operator konnect v1alpha1 API group
// +kubebuilder:object:generate=true
// +groupName=konnect.konghq.com
package v1alpha1

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

var (
// SchemeGroupVersion is group version used to register these objects
SchemeGroupVersion = schema.GroupVersion{Group: "konnect.konghq.com", Version: "v1alpha1"}

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

// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
)
5 changes: 5 additions & 0 deletions config/crd/kustomization_all.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ./kustomization.yaml
2 changes: 1 addition & 1 deletion controller/controlplane/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/predicate"
gatewayv1 "sigs.k8s.io/gateway-api/apis/v1"

operatorv1beta1 "github.com/kong/gateway-operator/api/v1beta1"
operatorv1beta1 "github.com/kong/gateway-operator/api/gateway-operator/v1beta1"
"github.com/kong/gateway-operator/controller/pkg/controlplane"
"github.com/kong/gateway-operator/controller/pkg/log"
"github.com/kong/gateway-operator/controller/pkg/op"
Expand Down
2 changes: 1 addition & 1 deletion controller/controlplane/controller_reconciler_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
k8stypes "k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"

operatorv1beta1 "github.com/kong/gateway-operator/api/v1beta1"
operatorv1beta1 "github.com/kong/gateway-operator/api/gateway-operator/v1beta1"
"github.com/kong/gateway-operator/controller/pkg/controlplane"
"github.com/kong/gateway-operator/controller/pkg/log"
"github.com/kong/gateway-operator/controller/pkg/op"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"k8s.io/client-go/kubernetes/scheme"
fakectrlruntimeclient "sigs.k8s.io/controller-runtime/pkg/client/fake"

operatorv1beta1 "github.com/kong/gateway-operator/api/v1beta1"
operatorv1beta1 "github.com/kong/gateway-operator/api/gateway-operator/v1beta1"
"github.com/kong/gateway-operator/controller/pkg/op"
"github.com/kong/gateway-operator/pkg/consts"
"github.com/kong/gateway-operator/pkg/utils/kubernetes/resources"
Expand Down
2 changes: 1 addition & 1 deletion controller/controlplane/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/reconcile"
gatewayv1 "sigs.k8s.io/gateway-api/apis/v1"

operatorv1beta1 "github.com/kong/gateway-operator/api/v1beta1"
operatorv1beta1 "github.com/kong/gateway-operator/api/gateway-operator/v1beta1"
"github.com/kong/gateway-operator/pkg/consts"
k8sutils "github.com/kong/gateway-operator/pkg/utils/kubernetes"
"github.com/kong/gateway-operator/test/helpers"
Expand Down
4 changes: 2 additions & 2 deletions controller/controlplane/controller_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"github.com/stretchr/testify/require"
corev1 "k8s.io/api/core/v1"

operatorv1alpha1 "github.com/kong/gateway-operator/api/v1alpha1"
operatorv1beta1 "github.com/kong/gateway-operator/api/v1beta1"
operatorv1alpha1 "github.com/kong/gateway-operator/api/gateway-operator/v1alpha1"
operatorv1beta1 "github.com/kong/gateway-operator/api/gateway-operator/v1beta1"
"github.com/kong/gateway-operator/controller/pkg/controlplane"
"github.com/kong/gateway-operator/pkg/consts"
k8sutils "github.com/kong/gateway-operator/pkg/utils/kubernetes"
Expand Down
2 changes: 1 addition & 1 deletion controller/controlplane/controller_watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/reconcile"

operatorv1beta1 "github.com/kong/gateway-operator/api/v1beta1"
operatorv1beta1 "github.com/kong/gateway-operator/api/gateway-operator/v1beta1"
operatorerrors "github.com/kong/gateway-operator/internal/errors"
"github.com/kong/gateway-operator/internal/utils/index"
"github.com/kong/gateway-operator/pkg/consts"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
controllerruntimeclient "sigs.k8s.io/controller-runtime/pkg/client"
fakectrlruntimeclient "sigs.k8s.io/controller-runtime/pkg/client/fake"

operatorv1beta1 "github.com/kong/gateway-operator/api/v1beta1"
operatorv1beta1 "github.com/kong/gateway-operator/api/gateway-operator/v1beta1"
"github.com/kong/gateway-operator/pkg/consts"
k8sutils "github.com/kong/gateway-operator/pkg/utils/kubernetes"
k8sresources "github.com/kong/gateway-operator/pkg/utils/kubernetes/resources"
Expand Down
2 changes: 1 addition & 1 deletion controller/controlplane/status_conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package controlplane
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

operatorv1beta1 "github.com/kong/gateway-operator/api/v1beta1"
operatorv1beta1 "github.com/kong/gateway-operator/api/gateway-operator/v1beta1"
k8sutils "github.com/kong/gateway-operator/pkg/utils/kubernetes"
)

Expand Down
2 changes: 1 addition & 1 deletion controller/controlplane/status_conditions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/require"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

operatorv1beta1 "github.com/kong/gateway-operator/api/v1beta1"
operatorv1beta1 "github.com/kong/gateway-operator/api/gateway-operator/v1beta1"
"github.com/kong/gateway-operator/pkg/consts"
k8sutils "github.com/kong/gateway-operator/pkg/utils/kubernetes"
)
Expand Down
2 changes: 1 addition & 1 deletion controller/dataplane/bluegreen_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/reconcile"

operatorv1beta1 "github.com/kong/gateway-operator/api/v1beta1"
operatorv1beta1 "github.com/kong/gateway-operator/api/gateway-operator/v1beta1"
"github.com/kong/gateway-operator/controller/pkg/address"
"github.com/kong/gateway-operator/controller/pkg/ctxinjector"
"github.com/kong/gateway-operator/controller/pkg/dataplane"
Expand Down
2 changes: 1 addition & 1 deletion controller/dataplane/bluegreen_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
fakectrlruntimeclient "sigs.k8s.io/controller-runtime/pkg/client/fake"
"sigs.k8s.io/controller-runtime/pkg/reconcile"

operatorv1beta1 "github.com/kong/gateway-operator/api/v1beta1"
operatorv1beta1 "github.com/kong/gateway-operator/api/gateway-operator/v1beta1"
"github.com/kong/gateway-operator/controller/pkg/builder"
"github.com/kong/gateway-operator/controller/pkg/dataplane"
"github.com/kong/gateway-operator/controller/pkg/op"
Expand Down
2 changes: 1 addition & 1 deletion controller/dataplane/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"

operatorv1beta1 "github.com/kong/gateway-operator/api/v1beta1"
operatorv1beta1 "github.com/kong/gateway-operator/api/gateway-operator/v1beta1"
"github.com/kong/gateway-operator/controller/pkg/ctxinjector"
"github.com/kong/gateway-operator/controller/pkg/log"
"github.com/kong/gateway-operator/controller/pkg/op"
Expand Down
2 changes: 1 addition & 1 deletion controller/dataplane/controller_reconciler_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"

operatorv1beta1 "github.com/kong/gateway-operator/api/v1beta1"
operatorv1beta1 "github.com/kong/gateway-operator/api/gateway-operator/v1beta1"
"github.com/kong/gateway-operator/controller/pkg/address"
"github.com/kong/gateway-operator/controller/pkg/log"
"github.com/kong/gateway-operator/pkg/consts"
Expand Down
4 changes: 2 additions & 2 deletions controller/dataplane/controller_reconciler_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
fakectrlruntimeclient "sigs.k8s.io/controller-runtime/pkg/client/fake"
gatewayv1 "sigs.k8s.io/gateway-api/apis/v1"

operatorv1alpha1 "github.com/kong/gateway-operator/api/v1alpha1"
operatorv1beta1 "github.com/kong/gateway-operator/api/v1beta1"
operatorv1alpha1 "github.com/kong/gateway-operator/api/gateway-operator/v1alpha1"
operatorv1beta1 "github.com/kong/gateway-operator/api/gateway-operator/v1beta1"
"github.com/kong/gateway-operator/controller/pkg/op"
"github.com/kong/gateway-operator/internal/versions"
"github.com/kong/gateway-operator/pkg/consts"
Expand Down
4 changes: 2 additions & 2 deletions controller/dataplane/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"sigs.k8s.io/controller-runtime/pkg/reconcile"
gatewayv1 "sigs.k8s.io/gateway-api/apis/v1"

operatorv1alpha1 "github.com/kong/gateway-operator/api/v1alpha1"
operatorv1beta1 "github.com/kong/gateway-operator/api/v1beta1"
operatorv1alpha1 "github.com/kong/gateway-operator/api/gateway-operator/v1alpha1"
operatorv1beta1 "github.com/kong/gateway-operator/api/gateway-operator/v1beta1"
"github.com/kong/gateway-operator/internal/validation/dataplane"
"github.com/kong/gateway-operator/pkg/consts"
k8sutils "github.com/kong/gateway-operator/pkg/utils/kubernetes"
Expand Down
2 changes: 1 addition & 1 deletion controller/dataplane/controller_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"

operatorv1beta1 "github.com/kong/gateway-operator/api/v1beta1"
operatorv1beta1 "github.com/kong/gateway-operator/api/gateway-operator/v1beta1"
"github.com/kong/gateway-operator/controller/pkg/log"
"github.com/kong/gateway-operator/internal/versions"
"github.com/kong/gateway-operator/pkg/consts"
Expand Down
2 changes: 1 addition & 1 deletion controller/dataplane/controller_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/reconcile"
gatewayv1 "sigs.k8s.io/gateway-api/apis/v1"

operatorv1beta1 "github.com/kong/gateway-operator/api/v1beta1"
operatorv1beta1 "github.com/kong/gateway-operator/api/gateway-operator/v1beta1"
"github.com/kong/gateway-operator/pkg/consts"
k8sutils "github.com/kong/gateway-operator/pkg/utils/kubernetes"
)
Expand Down
2 changes: 1 addition & 1 deletion controller/dataplane/dynamic.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"sigs.k8s.io/controller-runtime/pkg/client"

operatorv1beta1 "github.com/kong/gateway-operator/api/v1beta1"
operatorv1beta1 "github.com/kong/gateway-operator/api/gateway-operator/v1beta1"
)

// DataPlaneCallbacks holds callback managers for the DataPlane controller.
Expand Down
2 changes: 1 addition & 1 deletion controller/dataplane/dynamic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
controllerruntimeclient "sigs.k8s.io/controller-runtime/pkg/client"
fakectrlruntimeclient "sigs.k8s.io/controller-runtime/pkg/client/fake"

operatorv1beta1 "github.com/kong/gateway-operator/api/v1beta1"
operatorv1beta1 "github.com/kong/gateway-operator/api/gateway-operator/v1beta1"
"github.com/kong/gateway-operator/modules/manager/scheme"
"github.com/kong/gateway-operator/pkg/consts"
k8sutils "github.com/kong/gateway-operator/pkg/utils/kubernetes"
Expand Down
2 changes: 1 addition & 1 deletion controller/dataplane/owned_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"k8s.io/apimachinery/pkg/labels"
"sigs.k8s.io/controller-runtime/pkg/client"

operatorv1beta1 "github.com/kong/gateway-operator/api/v1beta1"
operatorv1beta1 "github.com/kong/gateway-operator/api/gateway-operator/v1beta1"
dataplanepkg "github.com/kong/gateway-operator/controller/pkg/dataplane"
"github.com/kong/gateway-operator/controller/pkg/log"
"github.com/kong/gateway-operator/controller/pkg/op"
Expand Down
2 changes: 1 addition & 1 deletion controller/dataplane/owned_finalizer_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
k8slog "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/predicate"

operatorv1beta1 "github.com/kong/gateway-operator/api/v1beta1"
operatorv1beta1 "github.com/kong/gateway-operator/api/gateway-operator/v1beta1"
"github.com/kong/gateway-operator/controller/pkg/log"
"github.com/kong/gateway-operator/pkg/consts"
k8sutils "github.com/kong/gateway-operator/pkg/utils/kubernetes"
Expand Down
2 changes: 1 addition & 1 deletion controller/dataplane/owned_finalizer_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client/fake"

operatorv1beta1 "github.com/kong/gateway-operator/api/v1beta1"
operatorv1beta1 "github.com/kong/gateway-operator/api/gateway-operator/v1beta1"
)

func TestRequestsForDataPlaneOwnedObjects(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion controller/dataplane/owned_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"

operatorv1beta1 "github.com/kong/gateway-operator/api/v1beta1"
operatorv1beta1 "github.com/kong/gateway-operator/api/gateway-operator/v1beta1"
"github.com/kong/gateway-operator/controller/pkg/dataplane"
"github.com/kong/gateway-operator/controller/pkg/op"
"github.com/kong/gateway-operator/controller/pkg/patch"
Expand Down
Loading
Loading