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

kbld does not work with git error messages set to a different language #213

Open
Rock981119 opened this issue Jan 22, 2022 · 3 comments
Open
Labels
bug This issue describes a defect or unexpected behavior carvel accepted This issue should be considered for future work and that the triage process has been completed priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.

Comments

@Rock981119
Copy link

I use brew install kbld, Version 0.32.0.

Here is my input Yaml file:
Deploy.yaml

#@ scaling_factor = 2
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: go-http-svr
  labels:
    app: http-svr
spec:
  replicas: #@ scaling_factor
  selector:
    matchLabels:
      app: http-svr
  template:
    metadata:
      labels:
        app: http-svr
    spec:
      containers:
      - name: go-http-svr
        image: rock981119/go-http:gitlabv1
        ports:
        - containerPort: 9000

kbld.yaml

---
apiVersion: kbld.k14s.io/v1alpha1
kind: Sources
sources:
- image: rock981119/go-http:gitlabv1
  path: .

---
apiVersion: kbld.k14s.io/v1alpha1
kind: ImageDestinations
destinations:
- image: rock981119/go-http:gitlabv1
  newImage: rock981119/go-http

command line execution:

kbld -f kbld.yaml -f Deploy.yaml

error message:

kbld: Error:
- Resolving image 'rock981119/go-http:gitlabv1': Getting details from git for directory '/Users/zangr/Desktop/Temp/Linux/demo-go-ci': Checking HEAD tags: exit status 128 (stderr 'fatal: 没有发现名称,无法描述任何东西。
')

Chinese part is 'No name found, can't describe anything'

At the same time, I did the same test in the Linux (PhotonOS) environment and it was successful.

My MacOS Version: 11.6.2

@Rock981119 Rock981119 added the carvel triage This issue has not yet been reviewed for validity label Jan 22, 2022
@visomar
Copy link

visomar commented Jan 24, 2022

Hi @Rock981119. I was about to create an issue about this same error, but I know why this is happening, so I may be able to help you:
Your local GIT is using a language different than english. If you check the source of https://github.com/vmware-tanzu/carvel-kbld/blob/develop/pkg/kbld/image/git.go, you'll see there are some checks done with contains trying to match some strings, and if git is answering in a different language, it won't match any of those.

You might be able to make it work by executing this before your kbld command:

> export LC_ALL=en_US.UTF-8

NOTE: This will only change the language for your terminal session. If you want to persist it, you need to do some extra step, like adding it to your .bashrc or .zshrc file.

I have my GIT working in spanish, and kbld doesn't work for me either, so can you change the title of this issue to something like kbld doesn't work properly if GIT is configured in a language different than English, and point to the file I shared above these lines?

@Rock981119
Copy link
Author

@visomar
Cool, thanks a lot, it worked.

@github-actions github-actions bot removed the carvel triage This issue has not yet been reviewed for validity label Jan 24, 2022
@joaopapereira
Copy link
Member

@Rock981119 thanks for opening this issue.

@visomar Thanks for helping out with this debug

Going to reopen this issue as a bug because it looks like something that kbld should try to address instead of forcing the users to add an extra command-line variable for it to work.

@joaopapereira joaopapereira reopened this Jan 24, 2022
@github-actions github-actions bot added the carvel triage This issue has not yet been reviewed for validity label Jan 24, 2022
@joaopapereira joaopapereira added bug This issue describes a defect or unexpected behavior carvel accepted This issue should be considered for future work and that the triage process has been completed priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. and removed carvel triage This issue has not yet been reviewed for validity labels Jan 24, 2022
@cppforlife cppforlife changed the title kbld doesn't work properly in MacOS kbld does not work with git error messages set to a different language Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes a defect or unexpected behavior carvel accepted This issue should be considered for future work and that the triage process has been completed priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Projects
Status: To Triage
Development

No branches or pull requests

3 participants