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

Environment variables containing colon not allowed #53201

Closed
MortenChristiansen opened this issue Sep 28, 2017 · 48 comments · Fixed by #123385
Closed

Environment variables containing colon not allowed #53201

MortenChristiansen opened this issue Sep 28, 2017 · 48 comments · Fixed by #123385
Assignees
Labels
area/api Indicates an issue on api area. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/windows Categorizes an issue or PR as relevant to SIG Windows.
Projects

Comments

@MortenChristiansen
Copy link

MortenChristiansen commented Sep 28, 2017

Is this a BUG REPORT or FEATURE REQUEST?:

/kind feature

Problem:
Kubernetes does not support : in environment variables. I can see that the subject has recently been discussed in PR #48986. .NET Core uses : to replace config variables as mentioned in this comment. The limitation in kubernetes requires me to perform some ugly hacks to override the config values.

Proposed Solution:
I'm in favor of the sentiment that kubernetes should not censor environment variables at all, but specifically I would like : to be allowed.

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 28, 2017
@k8s-github-robot k8s-github-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Sep 28, 2017
@resouer resouer added the area/api Indicates an issue on api area. label Sep 28, 2017
@MortenChristiansen
Copy link
Author

@kubernetes/sig-apps-feature-requests

@k8s-ci-robot k8s-ci-robot added sig/apps Categorizes an issue or PR as relevant to SIG Apps. kind/feature Categorizes issue or PR as related to a new feature. labels Sep 28, 2017
@k8s-ci-robot
Copy link
Contributor

@MortenChristiansen: Reiterating the mentions to trigger a notification:
@kubernetes/sig-apps-feature-requests

In response to this:

@kubernetes/sig-apps-feature-requests

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-github-robot k8s-github-robot removed the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Sep 28, 2017
@mattfarina
Copy link
Contributor

Is the ask here to just support : or all characters allowed in Windows Environment Variables?

I ask because if I read the docs right I can do...

C:\>set _(){}[]$*+-\/"#',;.@!?=xyz

C:\>echo %_(){}[]$*+-\/"#',;.@!?%
xyz

@MortenChristiansen
Copy link
Author

MortenChristiansen commented Oct 3, 2017

For my specific use case I need :. However, my opinion is that Kubernetes should not in any way limit which environment variable names you can use, since it cannot know what an application might need. Since people cannot always choose their own variable names, it can be blocking for Kubernetes adoption. Whether I hit a new character I need "unlocked" tomorrow I do not know, but today the : will allow me to work with .NET application settings as they are intended. Of course there may be any number of important concerns of which I am unaware so I leave the choice to greater minds than my own :)

@ryan-peachey-seon
Copy link

Hi, I have encountered this limitation as well. Our apps were initially developed on windows, and use asp.net core for running them in linux now. But the asp.net libraries create environment variables that include :.

@alahijani
Copy link

alahijani commented Jan 15, 2018

For .Net Core, the current (ugly) workaround is to use double underscores, like Logging__LogLevel__Default instead of Logging:LogLevel:Default.

It's documented here.

@mattfarina
Copy link
Contributor

/sig windows

@k8s-ci-robot k8s-ci-robot added the sig/windows Categorizes an issue or PR as relevant to SIG Windows. label Jan 23, 2018
@michmike
Copy link
Contributor

michmike commented Feb 2, 2018

/assign @bsteciuk

@k8s-ci-robot
Copy link
Contributor

@michmike: GitHub didn't allow me to assign the following users: bsteciuk.

Note that only kubernetes members and repo collaborators can be assigned.

In response to this:

/assign @bsteciuk

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.

@bsteciuk
Copy link
Contributor

bsteciuk commented Feb 7, 2018

FYI, I've started work on this issue, limited to just allowing the ':' character in environment variables for now.

@kow3ns
Copy link
Member

kow3ns commented Feb 27, 2018

I don't think we should do this. In Linux ":" is a path separator and completely invalid to use in an POSIX environment variable name. In .NET Core you use "__" in place of ":" in order get the desired configuration functionality to work as documented. I don't see why we should support non-portable naming. This will allow for manifests that only work in windows.

@michmike
Copy link
Contributor

michmike commented Mar 6, 2018

Given that we will not implement this issue, @bsteciuk please update the getting started guide for windows to include this workaround for environment variables. thanks!

@michmike
Copy link
Contributor

michmike commented Mar 6, 2018

/close

Workloads automation moved this from Backlog to Done Mar 6, 2018
@bgrant0607
Copy link
Member

@thockin
Copy link
Member

thockin commented Nov 1, 2018

ACTUALLY, : is a valid character in POSIX. All It says about env variables names (AFAICT) is:

names shall not contain the character '='

It specifies the names that POSIX tools can use, but does not restrict non-POSIX names at all.

Most shells do not support all of the punctuation characters, but C setenv() does:

#include <stdio.h>
#include <stdlib.h>

int main() {
        int r = setenv("foo:bar", "value", 1);
        if (r != 0) {
                printf("failed to setenv\n");
                exit(1);
        }
        char *s = getenv("foo:bar");
        printf("getenv = %s\n", s);
}

(BTW, it took me a long time to make that compile because my fingers are used to Go now :)

tpluscode added a commit to wikibus/sources.wikibus.org that referenced this issue Apr 27, 2019
@marosset marosset removed this from Backlog (issues) in SIG-Windows Sep 21, 2022
@k8s-triage-robot
Copy link

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

This bot triages issues and 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 issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or 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 Nov 9, 2022
@k8s-triage-robot
Copy link

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

This bot triages issues and 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 issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or 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 Dec 9, 2022
@mohag
Copy link

mohag commented Dec 9, 2022

/remove-lifecycle rotten

Pandering to the robotic overlords

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Dec 9, 2022
@k8s-triage-robot
Copy link

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

This bot triages un-triaged issues 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 issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue 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 Mar 9, 2023
@k8s-triage-robot
Copy link

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

This bot triages un-triaged issues 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 issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue 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 Apr 8, 2023
@mohag
Copy link

mohag commented Apr 9, 2023

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Apr 9, 2023
@thockin
Copy link
Member

thockin commented Apr 10, 2023

#53201 (comment) is the latest status.

If someone wants to do this, which I support, that's your roadmap. This warrants a KEP, albeit a small one. I wish I had the time to tackle all of these myself, but I just don't.

This should not be a very hard one.

@marosset
Copy link
Contributor

/help

@k8s-ci-robot
Copy link
Contributor

@marosset:
This request has been marked as needing help from a contributor.

Guidelines

Please ensure that the issue body includes answers to the following questions:

  • Why are we solving this issue?
  • To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
  • Does this issue have zero to low barrier of entry?
  • How can the assignee reach out to you for help?

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

/help

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 help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Apr 10, 2023
@alculquicondor
Copy link
Member

/remove-sig apps
/sig node
?

@k8s-ci-robot k8s-ci-robot added sig/node Categorizes an issue or PR as relevant to SIG Node. and removed sig/apps Categorizes an issue or PR as relevant to SIG Apps. labels Apr 11, 2023
@HirazawaUi
Copy link
Contributor

/assign
I will provide a mini KEP for it if no one is working on it yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Indicates an issue on api area. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/windows Categorizes an issue or PR as relevant to SIG Windows.
Projects
Workloads
  
Done
Status: Done