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

Modify efs-utils.conf in-place instead of overwriting #988

Closed

Conversation

adammw
Copy link

@adammw adammw commented May 4, 2023

Is this a bug fix or adding new feature?
New Feature

What is this PR about? / Why do we need it?
Modify efs-utils.conf in-place instead of overwriting.
Expects the /etc/amazon/efs-static-files/efs-utils.conf file to exist and is copied over if the efs-utils.conf does not exist.
Introduces gopkg.in/ini.v1 ini parser to parse and rewrite the config file. Note that the rewritten file may have slightly different formatting but otherwise should be functionally identical.
Allows users to customise efs-utils.conf to enable debug logging or changing other settings without the driver overwriting the entire file.
Fixes #737

What testing is done?
Tested on a fork of release-1.4 in our own clusters.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 4, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @adammw. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 4, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: adammw
Once this PR has been reviewed and has the lgtm label, please assign mskanth972 for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 requested a review from d-nishi May 4, 2023 05:38
@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label May 4, 2023
@adammw adammw force-pushed the adammw/write-efs-config-in-place branch 2 times, most recently from a98e716 to 53fd5b0 Compare May 4, 2023 06:29
@Ashley-wenyizha
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 4, 2023
@Ashley-wenyizha
Copy link
Contributor

/re-test

@adammw
Copy link
Author

adammw commented May 5, 2023

/retest

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 6, 2023
@adammw adammw force-pushed the adammw/write-efs-config-in-place branch from 53fd5b0 to b5bf9f4 Compare May 10, 2023 01:38
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 10, 2023
@adammw adammw force-pushed the adammw/write-efs-config-in-place branch from b5bf9f4 to 5302323 Compare May 10, 2023 01:40
@adammw adammw force-pushed the adammw/write-efs-config-in-place branch from 5302323 to 70087e8 Compare May 10, 2023 01:46
@adammw
Copy link
Author

adammw commented May 11, 2023

Tests passing, ready for review @Ashley-wenyizha

efsCfgTemplate := template.Must(template.New("efs-utils-config").Parse(efsUtilsConfigTemplate))
f, err := os.Create(filepath.Join(w.efsUtilsCfgPath, efsUtilsConfigFileName))
filePath := filepath.Join(w.efsUtilsCfgPath, efsUtilsConfigFileName)
cfg, err := ini.Load(filePath)
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't this throw an error if the file doesn't exist?

@RyanStan
Copy link
Contributor

RyanStan commented May 26, 2023

Allows users to customise efs-utils.conf to enable debug logging or changing other settings without the driver overwriting the entire file.

What about this change allows users to modify efs-utils.conf differently from how they would before? It seems like either way, users would still need to ssh into their containers and directly modify this file. I do not see any functional differences with this PR, but I might be misunderstanding the changes here.

@adammw
Copy link
Author

adammw commented May 29, 2023

What about this change allows users to modify efs-utils.conf differently from how they would before? I

The difference is previously the binary would write out this file every time, making it impossible to customise before the binary has started. In contrast, users wishing to customise the config can now with this change either create a custom Dockerfile or entrypoint that modifies the config, and that modified config will be used rather than overwritten.

Executing into the container and trying to modify the file after the fact doesn't work for mounts that have already been established before modification, therefore this was needed for us to debug issues in one of our persistent EFS mounts.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 10, 2023
@k8s-ci-robot
Copy link
Contributor

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.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/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 Jan 20, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle rotten
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/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 Feb 19, 2024
@k8s-triage-robot
Copy link

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/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was 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-ci-robot
Copy link
Contributor

@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/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was 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

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
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow enabling stunnel_logs_file
5 participants