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/k8s-1.25 #142

Merged
merged 5 commits into from
Oct 7, 2022
Merged
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
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ endif


deploy-cert-manager: ## Deployes cert-manager in the K8s cluster specified in ~/.kube/config.
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.1.0/cert-manager.yaml
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.7.3/cert-manager.yaml
while [[ $$(kubectl -n cert-manager get deployment cert-manager-webhook -o 'jsonpath={.status.readyReplicas}') != "1" ]]; \
do echo "waiting for cert-manager webhook" && sleep 3; \
done
Expand All @@ -289,7 +289,7 @@ catalog-push: ## Push a catalog image.

kind-create: export KUBECONFIG = $(PWD)/kubeconfig
kind-create: tmp docker-build kind ## Runs a k8s kind cluster with a local registry in "localhost:5000" and ports 1080 and 1443 exposed to the host
$(KIND) create cluster --wait 5m --config test/kind.yaml
$(KIND) create cluster --wait 5m --config test/kind.yaml --image kindest/node:v1.25.2
$(MAKE) deploy-cert-manager
$(KIND) load docker-image quay.io/3scale/marin3r:test --name kind

Expand All @@ -312,7 +312,7 @@ kind-delete: kind
.PHONY: kind
KIND = $(shell pwd)/bin/kind
kind: ## Download kind locally if necessary
$(call go-get-tool,$(KIND),sigs.k8s.io/kind@v0.11.1)
$(call go-get-tool,$(KIND),sigs.k8s.io/kind@v0.16.0)

##@ Release

Expand Down Expand Up @@ -407,3 +407,6 @@ tmp: ## Create project tmp directory
gen-pkg-image: export TARGET_PATH = $(PWD)/bin
gen-pkg-image: ## builds the gen-pkg-image binary
cd generators/pkg-image && go build -o $${TARGET_PATH}/gen-pkg-image main.go

clean: ## Clean project directory
rm -rf tmp bin kubeconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.1
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
name: envoyconfigrevisions.marin3r.3scale.net
spec:
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/marin3r.3scale.net_envoyconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.1
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
name: envoyconfigs.marin3r.3scale.net
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.1
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
name: discoveryservicecertificates.operator.marin3r.3scale.net
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.1
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
name: discoveryservices.operator.marin3r.3scale.net
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.1
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
name: envoydeployments.operator.marin3r.3scale.net
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
appsv1 "k8s.io/api/apps/v1"
autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2"
corev1 "k8s.io/api/core/v1"
policyv1beta1 "k8s.io/api/policy/v1beta1"
policyv1 "k8s.io/api/policy/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/intstr"
Expand Down Expand Up @@ -182,7 +182,7 @@ var _ = Describe("EnvoyDeployment controller", func() {

By("waiting for the envoy PDB to be created")
{
pdb := &policyv1beta1.PodDisruptionBudget{}
pdb := &policyv1.PodDisruptionBudget{}
key := types.NamespacedName{Name: "marin3r-envoydeployment-instance", Namespace: namespace}
Eventually(func() error {
return k8sClient.Get(context.Background(), key, pdb)
Expand Down
10 changes: 5 additions & 5 deletions pkg/reconcilers/operator/envoydeployment/generators/pdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package generators

import (
"github.com/3scale-ops/marin3r/pkg/reconcilers/lockedresources"
policyv1beta1 "k8s.io/api/policy/v1beta1"
policyv1 "k8s.io/api/policy/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
)
Expand All @@ -11,18 +11,18 @@ func (cfg *GeneratorOptions) PDB() lockedresources.GeneratorFunction {

return func() client.Object {

return &policyv1beta1.PodDisruptionBudget{
return &policyv1.PodDisruptionBudget{
TypeMeta: metav1.TypeMeta{
Kind: "PodDisruptionBudget",
APIVersion: policyv1beta1.SchemeGroupVersion.String(),
APIVersion: policyv1.SchemeGroupVersion.String(),
},
ObjectMeta: metav1.ObjectMeta{
Name: cfg.resourceName(),
Namespace: cfg.Namespace,
Labels: cfg.labels(),
},
Spec: func() policyv1beta1.PodDisruptionBudgetSpec {
spec := policyv1beta1.PodDisruptionBudgetSpec{
Spec: func() policyv1.PodDisruptionBudgetSpec {
spec := policyv1.PodDisruptionBudgetSpec{
Selector: &metav1.LabelSelector{
MatchLabels: cfg.labels(),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"

operatorv1alpha1 "github.com/3scale-ops/marin3r/apis/operator.marin3r/v1alpha1"
policyv1beta1 "k8s.io/api/policy/v1beta1"
policyv1 "k8s.io/api/policy/v1"
"k8s.io/apimachinery/pkg/api/equality"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
Expand All @@ -26,10 +26,10 @@ func TestGeneratorOptions_PDB(t *testing.T) {
MinAvailable: &intstr.IntOrString{Type: intstr.Int, IntVal: 1},
},
},
want: &policyv1beta1.PodDisruptionBudget{
want: &policyv1.PodDisruptionBudget{
TypeMeta: metav1.TypeMeta{
Kind: "PodDisruptionBudget",
APIVersion: policyv1beta1.SchemeGroupVersion.String(),
APIVersion: policyv1.SchemeGroupVersion.String(),
},
ObjectMeta: metav1.ObjectMeta{
Name: "marin3r-envoydeployment-instance",
Expand All @@ -41,7 +41,7 @@ func TestGeneratorOptions_PDB(t *testing.T) {
"app.kubernetes.io/instance": "instance",
},
},
Spec: policyv1beta1.PodDisruptionBudgetSpec{
Spec: policyv1.PodDisruptionBudgetSpec{
MinAvailable: &intstr.IntOrString{Type: intstr.Int, IntVal: 1},
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{
Expand Down