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

fix #3334: adding basic support for server side apply #3937

Merged
merged 5 commits into from
Mar 12, 2022

Conversation

shawkins
Copy link
Contributor

@shawkins shawkins commented Mar 5, 2022

Description

Adds basic support for server side apply via the additional patch type requested with #3334 - any higher level support for apply will be addressed under the other apply / createOrReplace issues.

This does ensure the fieldManager is set (fabric8 by default) and that the managedFields are cleared.

ServerSideIT shows the usage - typically all creates/updates would be done as server side apply. If you don't create the resource with server side apply any subsequent usage of server side apply will throw an exception - which you can workaround by including the force flag.

We may want to consider defaulting the user agent to fabric8 - if you create a resource using create, it will set the fieldManager to okhttp.

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

@shawkins shawkins linked an issue Mar 6, 2022 that may be closed by this pull request
@shawkins
Copy link
Contributor Author

shawkins commented Mar 8, 2022

On the UserAgent. It looks like we are looking for a property key of "fabric8-kubernetes-client/" + Version.clientVersion() - that seems more like it should be the default value if not set in the Config.

@manusa
Copy link
Member

manusa commented Mar 8, 2022

We may want to consider defaulting the user agent to fabric8 - if you create a resource using create, it will set the fieldManager to okhttp.

It looks like we are looking for a property key of "fabric8-kubernetes-client/" + Version.clientVersion() - that seems more like it should be the default value if not set in the Config.

Agree on the second, configurable value with default to fabric8-kubernetes-client/v$version

shawkins added 2 commits March 8, 2022 08:52
# Conflicts:
#	kubernetes-client-api/src/main/java/io/fabric8/kubernetes/client/Config.java
@shawkins
Copy link
Contributor Author

shawkins commented Mar 8, 2022

Agree on the second, configurable value with default to fabric8-kubernetes-client/v$version

Applied that change as part of this pr - fabric8-kubernetes-client/$version

@rohanKanojia
Copy link
Member

Thanks, please add some doc about this in CHEATSHEET as well. This has been requested multiple times

also making updates for client building and generics
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

42.1% 42.1% Coverage
0.0% 0.0% Duplication

@shawkins
Copy link
Contributor Author

Thanks, please add some doc about this in CHEATSHEET as well. This has been requested multiple times

Sure. Also updated some other cheatsheet information related to creating clients and generic types.

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.

Add support for Server Side Apply
4 participants