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

Update Kubernetes Model to v1.21.0 #2979

Merged
merged 5 commits into from
Apr 16, 2021

Conversation

rohanKanojia
Copy link
Member

@rohanKanojia rohanKanojia commented Apr 9, 2021

Description

  • Update Kubernetes Model Schema as per Kubernetes v1.21.0

https://kubernetes.io/blog/2021/04/08/kubernetes-1-21-release-announcement/

DSL Changes:
  • client.batch().jobs() deprecated
  • client.batch().cronjobs() deprecated
  • client.policy().podSecurityPolicies() deprecated
  • client.policy().podDisruptionBudget() deprecated
Model Changes:
  • Classes in io.fabric8.kubernetes.api.model.batch have been moved to io.fabric8.kubernetes.api.model.batch.v1 and io.fabric8.kubernetes.api.model.batch.v1beta1
  • Classes in io.fabric8.kubernetes.api.model.policy have been moved to io.fabric8.kubernetes.api.model.policy.v1 and io.fabric8.kubernetes.api.model.policy.v1beta1
  • Added io.fabric8.kubernetes.api.model.discovery.v1 EndpointSlice

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change
  • Chore (non-breaking change which doesn't affect codebase;
    test, version modification, documentation, etc.)

Checklist

  • Code contributed by me aligns with current project license: Apache 2.0
  • I Added CHANGELOG entry regarding this change
  • I have implemented unit tests to cover my changes
  • I have added/updated the javadocs and other documentation accordingly
  • No new bugs, code smells, etc. in SonarCloud report
  • I tested my code in Kubernetes
  • I tested my code in OpenShift

@rohanKanojia rohanKanojia marked this pull request as ready for review April 9, 2021 10:37
@rohanKanojia rohanKanojia requested a review from manusa April 9, 2021 10:52
@rohanKanojia rohanKanojia force-pushed the kubernetes-model-1-21-1 branch 4 times, most recently from 73e8fda to 74e8d9f Compare April 12, 2021 15:13
Comment on lines 41 to 47
public MixedOperation<Job, JobList, ScalableResource<Job>> jobs() {
return new JobOperationsImpl(httpClient, getConfiguration());
public V1BatchAPIGroupDSL v1() {
return adapt(V1BatchAPIGroupClient.class);
}

@Override
public MixedOperation<CronJob, CronJobList, Resource<CronJob>> cronjobs() {
return new CronJobOperationsImpl(httpClient, getConfiguration());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we keep this as @Deprecated+@deprecated and point to the old V1beta1BatchAPIGroupClient cronjobs and jobs?

This way changes won't be that breaking.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how you reverted these changes, but you reverted the examples too (not sure if that was on purpose).

I do think that examples should use the new non-deprecated APIs

public MixedOperation<PodDisruptionBudget, PodDisruptionBudgetList, Resource<PodDisruptionBudget>> podDisruptionBudget() {
return new PodDisruptionBudgetOperationsImpl(httpClient, getConfiguration());
public V1beta1PolicyAPIGroupDSL v1beta1() {
return adapt(V1beta1PolicyAPIGroupClient.class);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rohanKanojia rohanKanojia removed the wip label Apr 14, 2021
@rohanKanojia rohanKanojia force-pushed the kubernetes-model-1-21-1 branch 2 times, most recently from 420e0cc to 926ba43 Compare April 14, 2021 12:29
+ Update Kubernetes Model Schema as per Kubernetes v1.21.0
+ Added `client.batch().v1()` and `client.batch().v1beta1()` DSL
+ Added `client.policy().v1()` and `client.policy().v1beta1()` DSL
+ Added `client.discovery.v1()` DSL
This commit reverts removal of the following DSLs:
- `client.batch().jobs()`
- `client.batch().cronjobs()`
- `client.policy().podSecurityPolicies()`
- `client.policy().podDisruptionBudget()`
@rohanKanojia rohanKanojia force-pushed the kubernetes-model-1-21-1 branch from 926ba43 to 9e50cf4 Compare April 16, 2021 09:40
@sonarqubecloud
Copy link

@manusa manusa self-requested a review April 16, 2021 10:22
Copy link
Member

@manusa manusa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thx!

@manusa manusa merged commit b91fd7e into fabric8io:master Apr 16, 2021
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

Successfully merging this pull request may close these issues.

3 participants