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 JSON circular dependency in ASG / WarmPool #17321

Merged
merged 2 commits into from
Mar 27, 2025

Conversation

justinsb
Copy link
Member

@justinsb justinsb commented Mar 23, 2025

  • Add a test that catches the problem
    * Implement CompareWithID on WarmPool (not technically needed here) removed for safer cherry-picking
  • Mark WarmPool as not-serialized in JSON on ASG

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 23, 2025
@k8s-ci-robot k8s-ci-robot requested review from hakman and zetaab March 23, 2025 01:34
@justinsb justinsb changed the title tests: verify that we can marshal tasks to json WIP: tests: verify that we can marshal tasks to json Mar 23, 2025
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 23, 2025
@justinsb
Copy link
Member Author

WIP because we need to verify this fails first, then we can fix it!

@k8s-ci-robot k8s-ci-robot added area/provider/aws Issues or PRs related to aws provider size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 23, 2025
@justinsb justinsb force-pushed the verify_can_marshal branch from f4b66bc to b755098 Compare March 23, 2025 11:41
@justinsb justinsb changed the title WIP: tests: verify that we can marshal tasks to json Fix JSON circular dependency in ASG / WarmPool Mar 23, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 23, 2025
@justinsb
Copy link
Member Author

So I added a test here that we can render to JSON (that is the problem that rendering was hitting), in the first commit, and that detected this problem (good)

I then removed the circular dependency from the ASG -> WarmPool, by putting a json:"-" tag on it to ignore it during json marshalling. A bit hacky, but I think basically equivalent to making the field private and creating getters and setters, which would have been more disruptive.

@justinsb justinsb force-pushed the verify_can_marshal branch from b755098 to 0e4de09 Compare March 23, 2025 11:46
@justinsb
Copy link
Member Author

Actually I changed my mind and removed the CompareWithID commit from this PR as I don't think it's strictly needed, and we might want to cherry-pick this fix back to earlier kOps versions. I'll send it separately.

@justinsb
Copy link
Member Author

/retest

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 27, 2025
justinsb and others added 2 commits March 27, 2025 08:03
This avoids a circular dependency.

I previously considered making the field private,
but this is roughly equivalent and less disruptive.

Co-authored-by: Peter Rifel <[email protected]>
@justinsb justinsb force-pushed the verify_can_marshal branch from 49c139e to 7dc29d2 Compare March 27, 2025 12:03
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 27, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rifelpet

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 27, 2025
@k8s-ci-robot k8s-ci-robot merged commit 5537bb6 into kubernetes:master Mar 27, 2025
25 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.32 milestone Mar 27, 2025
k8s-ci-robot added a commit that referenced this pull request Mar 27, 2025
…-upstream-release-1.32

Automated cherry pick of #17321: tests: verify that we can marshal tasks to json
k8s-ci-robot added a commit that referenced this pull request Mar 27, 2025
…-upstream-release-1.30

Automated cherry pick of #17321: tests: verify that we can marshal tasks to json
k8s-ci-robot added a commit that referenced this pull request Mar 27, 2025
…-upstream-release-1.31

Automated cherry pick of #17321: tests: verify that we can marshal tasks to json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/provider/aws Issues or PRs related to aws provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants