Skip to content

chore: remove undeeded metadata when applying k8s objects#9267

Merged
cdrage merged 1 commit intopodman-desktop:mainfrom
cdrage:fix-apply
Oct 8, 2024
Merged

chore: remove undeeded metadata when applying k8s objects#9267
cdrage merged 1 commit intopodman-desktop:mainfrom
cdrage:fix-apply

Conversation

@cdrage
Copy link
Copy Markdown
Contributor

@cdrage cdrage commented Oct 8, 2024

chore: remove undeeded metadata when applying k8s objects

What does this PR do?

  • Removes undeeded metadata objects which are not applicable / not
    needed when applying a patch. This includes resourceVersion, UID,
    selfLink and creationTimestamp. These are automatically created when
    applying a resource if undefined / blank.
  • This change is needed as Kubernetes javascript client added
    serialization / checks with regards to creationTimestamps as well as
    other metadata objects from PR: Properly parse metadata of custom Kubernetes objects kubernetes-client/javascript#1695

Screenshot / video of UI

Screen.Recording.2024-10-08.at.10.53.57.AM.mov

What issues does this PR fix or reference?

Closes #9260
Closes #9262

How to test this PR?

  • Tests are covering the bug fix or the new feature
  1. Edit any k8s yaml
  2. Press apply
  3. Success
  4. Edit again
  5. Press apply
  6. Success

Signed-off-by: Charlie Drage [email protected]

### What does this PR do?

* Removes undeeded metadata objects which are not applicable / not
  needed when applying a patch. This includes resourceVersion, UID,
  selfLink and creationTimestamp. These are automatically created when
  applying a resource if undefined / blank.
* This change is needed as Kubernetes javascript client added
  serialization / checks with regards to creationTimestamps as well as
  other metadata objects from PR: kubernetes-client/javascript#1695

### Screenshot / video of UI

<!-- If this PR is changing UI, please include
screenshots or screencasts showing the difference -->

### What issues does this PR fix or reference?

<!-- Include any related issues from Podman Desktop
repository (or from another issue tracker). -->

Closes podman-desktop#9260
Closes podman-desktop#9262

### How to test this PR?

<!-- Please explain steps to verify the functionality,
do not forget to provide unit/component tests -->

- [X] Tests are covering the bug fix or the new feature

1. Edit any k8s yaml
2. Press apply
3. Success
4. Edit again
5. Press apply
6. Success

Signed-off-by: Charlie Drage <[email protected]>
@cdrage cdrage requested review from a team and benoitf as code owners October 8, 2024 14:52
@cdrage cdrage requested review from axel7083, gastoner and jeffmaury and removed request for a team October 8, 2024 14:52
Copy link
Copy Markdown
Contributor

@deboer-tim deboer-tim left a comment

Choose a reason for hiding this comment

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

LGTM (and worked well in testing).

Copy link
Copy Markdown
Contributor

@SoniaSandler SoniaSandler left a comment

Choose a reason for hiding this comment

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

LGTM codewise

@cdrage cdrage merged commit 5b19313 into podman-desktop:main Oct 8, 2024
@podman-desktop-bot podman-desktop-bot added this to the 1.13.0 milestone Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants