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

[ENHANCEMENT] Add config processing and fix hostmode (#477, @konradmalik) #477

Merged
merged 6 commits into from
Feb 9, 2021

Conversation

konradmalik
Copy link
Contributor

Hi, this turned out to be larger than I though but let me know what you think.
I fixed the issue with api port mentioned here: #471, now the k3s value is mapped.

While doing that I noticed it is not so straightforward to find a place to make such a fix, as config is modified, transformed merged etc. and later those values are propagated as labels on containers. It can easily become a hack that would be inconsistent with the rest of the configurations, not an actual fix.

What I propose here is to add another step right after transforming the config: ProcessClusterConfig, that would be responsible only for such "last step" config modifications like all the stuff for the "host" network: fixing api port, disabling docker host ip injection (my previous PR) or disabling load balancer. I already moved this stuff there. I guess the processing won't stop at that and soon more needed modifications for config will be found that can be put there for easier maintenance.

Let me know if this is a good idea.

Copy link
Member

@iwilltry42 iwilltry42 left a comment

Choose a reason for hiding this comment

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

Looks good already 👍

pkg/config/process.go Outdated Show resolved Hide resolved
Copy link
Member

@iwilltry42 iwilltry42 left a comment

Choose a reason for hiding this comment

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

Looks pretty good and I like the way this is going :)
I'll test it a bit and then merge it, if everything's ok 👍

pkg/config/process.go Outdated Show resolved Hide resolved
@iwilltry42 iwilltry42 changed the title [FIX] Fix api port host + propose a new processing step to the config [ENHANCEMENT] Add config processing and fix hostmode (#477, @konradmalik) Feb 9, 2021
@iwilltry42 iwilltry42 merged commit df9859e into k3d-io:main Feb 9, 2021
rancherio-gh-m pushed a commit that referenced this pull request Feb 9, 2021
Author: Konrad Malik <[email protected]>
Date:   Tue Feb 9 15:17:58 2021 +0100

    [ENHANCEMENT] Add config processing and fix hostmode (#477, @konradmalik)
@konradmalik konradmalik deleted the fix-api-port-host branch February 10, 2021 18:37
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.

2 participants