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

Refactor internalLabels #1537

Merged
merged 3 commits into from
Nov 23, 2022
Merged

Conversation

minuk-dev
Copy link
Contributor

related #1411 especially, #1411 (comment), #1411 (review)

Changes

  • Simplify withInternalLabels() in cmd/nerdctl/run.go
  • Delete setPlatformContainerOptions()

Details

Simplify withInternalLabels() in cmd/nerdctl/run.go

  • Problem : As the features of nerdctl expands in the future, the number of internalLabel will continue to increase, but processing by increasing the parameter creates resistance to writing code that increases internalLabel.
  • Solution : Abstract and unite internalLabels as a structure.

Delete setPlatformContainerOptions():

  • Problem:
    • setPlatformContainerOptions() be created by processing an internalLabel (PIDContainer supporting --pid=container:<name or id>) for linux. But as the structure for internalLabel is created, it is not needed.
    • Due to a structural problem in the code, setPlatformContainerOptions() and setPlatformOptions() query the container twice.
  • Solution : Delete setPlatformContainerOptions() and pass a new parameter into setPlatformOptions() for platform specific labels.

Signed-off-by: Min Uk Lee <minuk.dev@gmail.com>
- Delete setPlatformContainerOptions()
- Refactor `--pid=container:<name or id>`

Signed-off-by: Min Uk Lee <minuk.dev@gmail.com>
Signed-off-by: Min Uk Lee <minuk.dev@gmail.com>
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Thanks

@AkihiroSuda AkihiroSuda merged commit 806fea7 into containerd:main Nov 23, 2022
@AkihiroSuda AkihiroSuda added this to the v1.1.0 milestone Nov 23, 2022
@minuk-dev minuk-dev deleted the refactor/internalLabels branch November 6, 2023 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants