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

Refactored resource to store all previous names and namespaces #3525

Merged

Conversation

natasha41575
Copy link
Contributor

Some resource refactoring to store intermediate names. Reference to #3493 and #3455. A future PR will refactor name reference transformer to remove more of the prefix/suffix logic from the resource code.

Removed:

Resource

  • getOriginalName/Ns
  • setOriginalName/Ns
  • GetOutermostNamePrefix
  • GetOutermostNameSuffix
  • OutermostPrefixSuffixEquals

Resmap

  • GetMatchingResourcesByOriginalId
  • GetByOriginalId

Added:
Resource

  • StorePreviousId
  • PrevIds
  • setOriginalNamespaceAndName

Resmap

  • GetMatchingResourceByAnyId

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 2, 2021
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Feb 2, 2021
Copy link
Contributor

@monopole monopole left a comment

Choose a reason for hiding this comment

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

Thanks so much, i really like this PR.
Some minor nits.

Also, I'd appreciate it if you could lgtm #3528 first, and merge that into this.
It's sensitive to name and namespace stuff. It works - i added more tests
before the refactor, and it's all passing.
So if you can merge it before this change i'd appreciate it.
Then i'll take this, and add a fix for #3489 on top of it.

api/resmap/resmap.go Show resolved Hide resolved
api/resmap/reswrangler.go Outdated Show resolved Hide resolved
api/resmap/reswrangler.go Show resolved Hide resolved
api/resmap/reswrangler.go Show resolved Hide resolved
api/resmap/reswrangler.go Show resolved Hide resolved
api/resource/resource.go Outdated Show resolved Hide resolved
api/resource/resource.go Outdated Show resolved Hide resolved
api/resource/resource.go Outdated Show resolved Hide resolved
api/resource/resource.go Outdated Show resolved Hide resolved
api/resource/resource_test.go Show resolved Hide resolved
@natasha41575 natasha41575 mentioned this pull request Feb 3, 2021
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 3, 2021
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 3, 2021
Copy link
Contributor

@monopole monopole left a comment

Choose a reason for hiding this comment

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

/lgtm

thanks!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 4, 2021
@monopole monopole merged commit 1ee16d9 into kubernetes-sigs:master Feb 4, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: monopole, natasha41575

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 Feb 4, 2021
@natasha41575 natasha41575 deleted the RefactorNameTransformers branch February 19, 2021 19:37
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. 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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants