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

boskos: changing type of a static resource in config doesn't update storage #16047

Closed
ixdy opened this issue Jan 28, 2020 · 7 comments
Closed
Labels
area/boskos Issues or PRs related to code in /boskos kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@ixdy
Copy link
Member

ixdy commented Jan 28, 2020

What happened:
We renamed the type of some of our static resources to work around a bug in the janitor.
(That bug: we had a group of projects that didn't end in -project, and thus the janitor was passing the wrong flag:

func format(rtype string) string {
splits := strings.Split(rtype, "-")
return splits[len(splits)-1]
}
// Clean by janitor script
func janitorClean(resource *common.Resource, flags []string) error {
args := append([]string{fmt.Sprintf("--%s=%s", format(resource.Type), resource.Name)}, flags...)

)

After applying the config, the old type still remained in storage (in the Kubernetes objects).

What you expected to happen:
Boskos would update storage (in the Kubernetes objects) reflecting the new type.

How to reproduce it (as minimally and precisely as possible):
I wrote a simple unit test that reproduces this failure: ixdy@d6714a6

It looks like when updating static resources, we just check to see whether the resources specified in the config exist in storage and vice-versa, only looking at the resource names. We do not consider that other metadata (such as type) may have changed.

Our planned workaround is to delete the resources from the config, then re-add them.

/area boskos

@ixdy ixdy added the kind/bug Categorizes issue or PR as related to a bug. label Jan 28, 2020
@k8s-ci-robot k8s-ci-robot added the area/boskos Issues or PRs related to code in /boskos label Jan 28, 2020
@ixdy
Copy link
Member Author

ixdy commented Jan 28, 2020

Our planned workaround is to delete the resources from the config, then re-add them.

This doesn't entirely work. If you just apply a config with the resources deleted, Boskos won't delete any that are in-use. To remove them, you'd need to explicitly delete them using kubectl.

@stevekuznetsov
Copy link
Contributor

There are quite a lot of config renames/edits that do not get appropriately reflected in cluster state. Notably reducing the size of a dynamic resource used to not remove the CRDs? I think we might need to revisit how that code works.

@ixdy
Copy link
Member Author

ixdy commented Jan 28, 2020

I think the issues with dynamic resources are described in #15906 (and hopefully fixed by #16021), but none of that touches static resources.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 28, 2020
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels May 28, 2020
@ixdy
Copy link
Member Author

ixdy commented May 29, 2020

Moving to kubernetes-sigs/boskos#18.
/close

@k8s-ci-robot
Copy link
Contributor

@ixdy: Closing this issue.

In response to this:

Moving to kubernetes-sigs/boskos#18.
/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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/boskos Issues or PRs related to code in /boskos kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

4 participants