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

Guess: Regression for kustomize build with git SSH URLs: no such file or directory #4998

Closed
mbigras opened this issue Jan 25, 2023 · 2 comments · Fixed by #5023
Closed

Guess: Regression for kustomize build with git SSH URLs: no such file or directory #4998

mbigras opened this issue Jan 25, 2023 · 2 comments · Fixed by #5023
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@mbigras
Copy link

mbigras commented Jan 25, 2023

Hi Kustomize team,

Please see the following issue for the kustomize build git@gist.github.com:bc7947cb727d7f9217e7862d961a1ffd.git command for current master branch—commit 279ad3e.

What happened?

I expected a command like kustomize build git@gist.github.com:bc7947cb727d7f9217e7862d961a1ffd.git to work since remoteBuild.md mentions that git SSH URLs work and that command also works for Kustomize 4.5.7—commit 56d82a8; however, that command doesn't work for current master branch—commit 279ad3e. I wonder if a regression happened from 56d82a8 to 279ad3e. After I did a cursory look at the git history with the git log --patch command, I noticed that internal/git/repospec.go file was edited during 8b21844 so I wonder if that's the problematic commit. Edit: I think the regression is somewhere from daf81df to 279ad3e—see #4998 (comment).

Resources

See the following related resources.

  1. For a working session to that illustrates the full command output, see kustomize-working-session.txt public gist.
  2. Also, for the Kustomize configuration that those kustomize build commands target, see kustomization.yaml public gist.

What did you expect to happen?

I expected the kustomize build git@gist.github.com:bc7947cb727d7f9217e7862d961a1ffd.git output to look like the following.

$ kustomize build git@gist.github.com:bc7947cb727d7f9217e7862d961a1ffd.git
apiVersion: v1
data:
  hello: world
kind: ConfigMap
metadata:
  name: hello-dc6fm46dhm

How can we reproduce it (as minimally and precisely as possible)?

To reproduce you can run the following commands—for command output, see https://gist.github.com/mbigras/23aa35cf0f53b6ede2a7f76c517c648e.

kustomize version
kustomize build https://gist.github.com/bc7947cb727d7f9217e7862d961a1ffd.git
kustomize build git@gist.github.com:bc7947cb727d7f9217e7862d961a1ffd.git
cd $(mktemp -d)
git clone git@github.com:kubernetes-sigs/kustomize.git
cd kustomize
git checkout 279ad3e81520491d5795d8e13fd52907da759cfd
mkdir -p build
GOBIN=$PWD/build make kustomize
$PWD/build/kustomize build https://gist.github.com/bc7947cb727d7f9217e7862d961a1ffd.git
$PWD/build/kustomize build git@gist.github.com:bc7947cb727d7f9217e7862d961a1ffd.git
git checkout 56d82a8378dfc8dc3b3b1085e5a6e67b82966bd7
mkdir -p build
GOBIN=$PWD/build make kustomize
$PWD/build/kustomize build https://gist.github.com/bc7947cb727d7f9217e7862d961a1ffd.git
$PWD/build/kustomize build git@gist.github.com:bc7947cb727d7f9217e7862d961a1ffd.git
pbpaste | gh gist create --public --filename kustomize-working-session.txt

Expected output

I expected the kustomize build git@gist.github.com:bc7947cb727d7f9217e7862d961a1ffd.git output to look like the following.

$ kustomize build git@gist.github.com:bc7947cb727d7f9217e7862d961a1ffd.git
apiVersion: v1
data:
  hello: world
kind: ConfigMap
metadata:
  name: hello-dc6fm46dhm

Actual output

The actual output for the 279ad3e commit looks like the following.

$ $PWD/build/kustomize build git@gist.github.com:bc7947cb727d7f9217e7862d961a1ffd.git
Error: must build at directory: not a valid directory: evalsymlink failure on 'git@gist.github.com:bc7947cb727d7f9217e7862d961a1ffd.git' : lstat /private/var/folders/_r/52tr69g54qvbxtg8fx7548tm0000gq/T/tmp.Wm1IZkri/kustomize/git@gist.github.com:bc7947cb727d7f9217e7862d961a1ffd.git: no such file or directory

Kustomize version

279ad3e

Operating system

I'm running macOS—for versions, see sw_vers output.

$ sw_vers
ProductName:		macOS
ProductVersion:		13.1
BuildVersion:		22C65
@mbigras mbigras added the kind/bug Categorizes issue or PR as related to a bug. label Jan 25, 2023
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jan 25, 2023
@mbigras
Copy link
Author

mbigras commented Jan 26, 2023

Update: I think the regression is somewhere from daf81df to 279ad3e.

In my earlier post I guessed there might be a problem with 8b21844; however, I built 8b21844~1 commit and still had the same problem. I'm still not sure which commit introduced the regression; however, I did check daf81df and that worked!

I ran the following commands.

cd $(mktemp -d)
git clone git@github.com:kubernetes-sigs/kustomize.git
cd kustomize
git checkout daf81df437a2d875e92b83d970288db970be377a
mkdir -p build
GOBIN=$PWD/build make clean
GOBIN=$PWD/build make kustomize
$PWD/build/kustomize build git@gist.github.com:bc7947cb727d7f9217e7862d961a1ffd.git
pbpaste | gh gist create --public --filename kustomize-working-session2.txt

And that gave the following expected output.

$ $PWD/build/kustomize build git@gist.github.com:bc7947cb727d7f9217e7862d961a1ffd.git
apiVersion: v1
data:
  hello: world
kind: ConfigMap
metadata:
  name: hello-dc6fm46dhm

For the full command output, see https://gist.github.com/ac303f920c8c9663137411188d353ff5.

For more context, I want to get the #4654 fix and so I tried to build kustomize from master since the Homebrew kustomize is on kustomize/v4.5.7 and #4958 (comment) suggests master has the fix. That's true; but, now it seems like there is a new problem with git SSH URLs—the subject of this #4998 issue.

@KnVerey
Copy link
Contributor

KnVerey commented Feb 2, 2023

Thank you for the detailed report and straightforward reproduction case! I'll admit that TIL gists can be cloned like that. The code that handles remote URLs was in really bad shape and we re-wrote it almost completely for the 5.0 release, and unfortunately introduced this bug in that process. Fortunately it is a straightforward fix: #5023.

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants