cli-utils
cli-utils copied to clipboard
[WIP] chore: Store inventory objs in TaskContext
This is not ready for review. Will probably need to be split into multiple PRs.
- Replace InventoryInfo interface with simple struct (ObjectRef + ID)
- Rename multiple objects & methods in the inventory package to reduce stuttering/repetition
- InventoryInfo -> Info (new API)
- InventoryClient -> Client (new API)
- InventoryClientFactory -> ClientFactory
- ClusterInventoryClient -> ConfigMapClient (specific to ConfigMap impl)
- ClusterInventoryClientFactory -> ConfigMapClientFactory (specific to ConfigMap impl)
- FakeInventoryClient -> FakeClient
- FakeInventoryClientFactory -> FakeClientFactory
- Redesign inventory.Client interface to use the Inventory object struct as input/output
- Merge/Replace -> Store
- Move InvClient.ApplyInventoryNamespace into InvAddTask (not specific to client impl)
- Replace inventory.Storage with Converter interface to make the ClusterClient easier to implement.
- Update e2e tests to the the Converter instead of different InventoryConfig funcs.
- Modify inventory tasks to use the Inventory in the TaskContext
- Modify Inventory to satisfy client.Object
- Use metav1.TypeMeta & metav1.ObjectMeta to satisfy runtime.Object
- Move Inventory to /pkg/apis/actuation/ to make it easier to run deepcopy-gen
- Add deepcopy-gen to generate DeepCopy methods on the Inventory objects, so it satisfies client.Object
- Add conversion-gen to generate version conversion methods in case we want to version the Inventory resource API
- Add run-in-gopath.sh required to run deepcopy-gen/conversion-gen from outside GOPATH
- Rename inventory.AddInventoryIDAnnotation -> SetOwningInventoryAnnotation
- Replace Pruner.GetPruneObjs with inventory.ObjectManager.GetSpecObjects for use in applier/destroyer for both apply & prune.
- Remove duplicate sorting from applier/destroyer (only the solver needs to sort)
- Change verbose logs with YAML to level 7
- Use testutil.AssertEqual in Pruner tests to aid debugging failures
- Add logs to aid debugging
- Add inventory.InMemoryClient for testing that doesn't need to fake out REST calls
BREAKING CHANGE: Removed InventoryStrategy (only uses name now) BREAKING CHANGE: Redesigned inventory Client, Factory, Info, & Storage BREAKING CHANGE: Move inventory.Inventory to actuation.Inventory (under pkg/apis/)
TODO:
- Extract Inventory API change: https://github.com/kubernetes-sigs/cli-utils/pull/542
- Undo KubectlPrinterAdapter changes
- Update inventory.Client to enable SSA/CSA (can punt, the current impl doesn't have it)
- Remove InventoryStrategy remnants
- Remove extra code in DeleteInvTask & replace with a InvSetTask (to fix https://github.com/kubernetes-sigs/cli-utils/issues/536)
- Fix TestDeleteInvTask to use inventory.FakeClient
- Replace InvSetTask logic with Inventory.Spec.Object changes in other Tasks.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: karlkfi
To complete the pull request process, please assign liujingfang1 after the PR has been reviewed.
You can assign the PR to them by writing /assign @liujingfang1 in a comment when ready.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
@karlkfi: PR needs rebase.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
@karlkfi: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:
| Test name | Commit | Details | Required | Rerun command |
|---|---|---|---|---|
| cli-utils-presubmit-master-stress | 0bb5dd3dc5bba6495f2a0b9748c5dfaf03b2418a | link | true | /test cli-utils-presubmit-master-stress |
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale - Mark this issue or PR as rotten with
/lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
/remove-lifecycle rotten
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale - Mark this issue or PR as rotten with
/lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the PR is closed
You can:
- Reopen this PR with
/reopen - Mark this PR as fresh with
/remove-lifecycle rotten - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/close
@k8s-triage-robot: Closed this PR.
In response to this:
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied- After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied- After 30d of inactivity since
lifecycle/rottenwas applied, the PR is closedYou can:
- Reopen this PR with
/reopen- Mark this PR as fresh with
/remove-lifecycle rotten- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.