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

api version for ingress #97

Open
patriceckhart opened this issue Dec 1, 2021 · 4 comments
Open

api version for ingress #97

patriceckhart opened this issue Dec 1, 2021 · 4 comments

Comments

@patriceckhart
Copy link
Contributor

I want to use the api version networking.k8s.io/v1 for Ingress.

Tried to extend the model and define the api version. But ends in an error:

{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"the API version in the data (networking.k8s.io/v1) does not match the expected API version (networking.k8s.io/v1beta1)","reason":"BadRequest","code":400}

@trylika
Copy link

trylika commented Feb 14, 2022

had same problem, solution was: implement my own Ingresses Collections/Model/Repositories. And use them instead of original ones.
all the same as orginal ones, except two key changes (at first i forgot to change in Repository, that's why i was getting this error):

Ingress.php

class Ingress extends Model
{
    protected string $apiVersion = 'networking.k8s.io/v1';
}

IngressRepository.php

class IngressRepository extends Repository
{
    protected ?string $apiVersion = 'networking.k8s.io/v1';
    ....
}

@maclof i'm not sure what is the plan for 1.20+ Kubernetes support, but i could do PR to accomodate Ingress migration to networking.k8s.io/v1

@trylika
Copy link

trylika commented Feb 14, 2022

to extend my idea of PR, my project unfortunatelly doesn't use anything else from what changed in Kubernetes 1.20+ so i can't test/do changes beyond Ingress.
but, we use ServiceAccounts and i can add that Model if there is need for that

@patriceckhart
Copy link
Contributor Author

patriceckhart commented Jun 11, 2022

@trylika

Doesn't work for me :-( :

IngressRepository::$apiVersion
must not be defined (as in class
Maclof\Kubernetes\Repositories\Repository) in ...

@trylika
Copy link

trylika commented Jun 13, 2022

@patriceckhart not sure about this exact error, but i'm using 0.24 and my changes work, but i can see recently there where some changes regarding Ingress and other changes related to kubernetes new versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants