DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 55TBoWA42292739
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 55TBoWA42292739
Authentication-Results: delorie.com;
	dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=pc0c1JLG
X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EEBD6385E027
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1751197831;
	bh=Q7hVTdj4XDbH+grTsNqZ4Apkp6Fc5pUVcNiERzV5YzI=;
	h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
	 From;
	b=pc0c1JLGQKqkoYQ6XcrogkMT0R8FkVgUcUE75k5JxWgjc2yCxLl3A6LcemSdysPwQ
	 6G3nSmj+kV1igu3SUVB8eN+nJQ1kPP4/wdehfzQP8GPTCGttaXTfG7TiwV12B57Wod
	 bEDzEdJwWjvZ5SiGyuOImJ66eLkJr7QrGGR/wKg4=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2A596385DDDC
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2A596385DDDC
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1751197804; cv=none;
 b=Q1M325rbQeEMYwPyf8UFdxIsP8B5mV1F9+4lwiJgwH27i9aFdoaCx7V9sbqPmfQk9d2q0ObF/Y01KW5wvYdyPyVW0jtucSxrVZG1j5K4Cicutb28Dd0Wia++eX2Vmp0zIIMSEYAWuTrZhYqOKvNKdoSXLUPt+lhW+T8s3dsaOzU=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
 t=1751197804; c=relaxed/simple;
 bh=6HBhOsfL5bCtQr3289N7v+sXPIRL5KHAtrg5MrcV/3s=;
 h=DKIM-Signature:Date:From:Message-ID:To:Subject:MIME-Version;
 b=rTbHdkPRV8GEQnE2nprdupoR9nv9pfpQKMUHmauf79jwmy8CjKHZ6nuddSGnzsti7MUpN3iggM4J/+6Txd4coxw7NOYeVCai2FQ64o1+DpijgBfaMFDbxwTskFi/iAQjaGNTMpZ3NVId4QvL7G7T1QPVJoZIUJbk0ZMMy9p/XJI=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A596385DDDC
X-Yandex-Fwd: 1
Date: Sun, 29 Jun 2025 14:39:22 +0300
X-Mailer: The Bat! (v9.3.4) Professional
Message-ID: <656898966.20250629143922@yandex.ru>
To: "KARR, DAVID" <dk068x@att.com>, cygwin@cygwin.com
Subject: Re: Why does "kubectl" in a cygwin shell ignore KUBECONFIG,
 but Go apps using same api work fine?
In-Reply-To: <DS0PR02MB10782A9D612B0C2F0C28AAA579D44A@DS0PR02MB10782.namprd02.prod.outlook.com>
References: <DS0PR02MB1078242EE7B1058B28E2CE4F19D7AA@DS0PR02MB10782.namprd02.prod.outlook.com>
 <2094251202.168988.1751050048376@mail.yahoo.com>
 <DS0PR02MB10782A9D612B0C2F0C28AAA579D44A@DS0PR02MB10782.namprd02.prod.outlook.com>
MIME-Version: 1.0
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.30
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Andrey Repin via Cygwin <cygwin@cygwin.com>
Reply-To: cygwin@cygwin.com
Cc: Andrey Repin <anrdaemon@yandex.ru>
Content-Type: text/plain; charset="utf-8"
Errors-To: cygwin-bounces~archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie.com@cygwin.com>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 55TBoWA42292739

Greetings, KARR, DAVID!

> Ok, well, I looked at these ideas and eliminated a few and looked at the
> $HOME problem. I already dealt with this with Eclipse, as the egit plugin
> gets confused by the Cygwin HOME. As I long ago implemented a little
> “pathsearch” tool that lets me find the NEXT occurrence of an executable in
> the PATH, creating that “kubectl” wrapper to override HOME was simple, and it works.

There's no need for it, if you are ready to trade some headache for
convenience.
Just use your profile as your Cygwin $HOME.

> It’s really odd that kubectl works fine if it is just getting the single
> “config” file, which is in a subdirectory of my Windows HOME, so somehow it
> still finds that. It only breaks when that file doesn’t exist and it has to
> read the KUBECONFIG var, which is in Windows format.

> The other curious clue is the error message I get when it wasn’t finding the config file, which is:

>     error: CreateFile C:\cygwin64\home\<userid>\.kube\config: The file cannot be accessed by the system.

> That path is my CYGWIN home, where in that directory I have this:

>     % ls -lt .kube
>     lrwxrwxrwx 1 <userid> Domain Users 22 Aug  8  2024 .kube -> /c/users/<userid>/.kube//

The question stands, WHAT is that symlink?

>>      cmd /C dir .kube

> So the kubectl exe, which is a Windows application, seems like it is
> interpreting my Cygwin HOME, and the symlink, to determine that the default file doesn’t exist.

Generally, it is a bad idea to use two tools of different origin for the same
purpose. I suggest you write a simple wrapper to use windows one in Cygwin.

Smth. along the lines of

>> #!/bin/sh
>>
>> (
>>     _cmd=
>>     if [ "$1" ] && [ -f "${_cmd:="$( cygpath -aml -- "$1" )"}" ]; then
>>         shift
>>         set -- "$_cmd" "$@"
>>     fi
>>     unset _cmd
>>
>>     eval "PATH='/proc/cygdrive/C/Program Files/nodejs:$PATH'" export PATH
>>     "/proc/cygdrive/C/Program Files/nodejs/npm.cmd" "$@"
>> )

> Not sure if I’ll ever figure out what’s really happening here, but at least I have a solution. Thanks.


-- 
With best regards,
Andrey Repin
Sunday, June 29, 2025 14:01:42

Sorry for my terrible english...

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

