Giter Site home page Giter Site logo

Comments (12)

ckotzbauer avatar ckotzbauer commented on May 31, 2024

Hi @GDWBaer,
can you please share your config (helm-chart values or deployment.yaml) that I can see the parameter you added?

from sbom-operator.

GDWBaer avatar GDWBaer commented on May 31, 2024

Sorry for replying late. I overlooked the info mail. My values.yaml file looks like:
`image:
tag: "0.17.0"

args:
targets: git
format: cyclonedxjson
git-author-email: ************************************
git-author-name: ""
git-repository: https://@dev.azure.com//
/_git/*************************
git-branch: "sbom-operator"
git-path: aks/sbom
git-fallback-clone:
git-workingtree: /work/sbom
#git-username: "
******"
#git-password: ""
git-access-token: "
"
verbosity: debug

#envVars:

- name: SBOM_GIT_ACCESS_TOKEN

valueFrom:

secretKeyRef:

name: "sbom-operator"

key: "accessToken"`

I played around with setting the access token by parameter and from kubernetes secret...

from sbom-operator.

GDWBaer avatar GDWBaer commented on May 31, 2024

Maybe an image is easier to read here:
grafik

from sbom-operator.

ckotzbauer avatar ckotzbauer commented on May 31, 2024

Thanks, I will have a look at this on the weekend

from sbom-operator.

ckotzbauer avatar ckotzbauer commented on May 31, 2024

I could reproduce the issue: The problem was, that the repo or branch was empty. The operator assumes a fully initialized repository/branch to work on. There's no logic which creates the specified branch if it does not exist. Please commit a README or something else to the branch. I will add this requirement to the docs.

Feel free to reply here, if this doesn't work.

from sbom-operator.

GDWBaer avatar GDWBaer commented on May 31, 2024

Hi Christian, the branch is definitely existing in the origin. Do you see a way of getting the complete error message git is throwing? It seems to be only a stub (1st line?) for me:
time="2022-09-28T07:45:05Z" level=error msg="Open or clone failed" error="'git clone -b sbomtest https://dev.azure.com/******/*****************/_git/******************** /work' failed: Cloning into '/work'..."
When I log into the container I can successfully clone the repo to an empty destination:
grafik
The original destination is not empty anymore because the sbom-operator starts to create sboms even after the clone failed.

from sbom-operator.

ckotzbauer avatar ckotzbauer commented on May 31, 2024

I added the exit-code from the git-command to the error-message in the newest release. The stderr message from the command is logged, so it seems that git doesn't emit an error-message. @GDWBaer

from sbom-operator.

acook8 avatar acook8 commented on May 31, 2024

@GDWBaer I was having the same issue with Azure DevOps. What I did to get it to work was set SBOM_GIT_REPOSITORY to https://{pat}@dev.azure.com/{organization}/{project}/_git/{repo}

from sbom-operator.

GDWBaer avatar GDWBaer commented on May 31, 2024

@GDWBaer I was having the same issue with Azure DevOps. What I did to get it to work was set SBOM_GIT_REPOSITORY to https://{pat}@dev.azure.com/{organization}/{project}/_git/{repo}

Hi, thanks for the hint. Could you give a more complete example? Is this env var the only config you used? Is the {pat} raw or base64 encoded? I tried with a raw token without luck, yet.

from sbom-operator.

acook8 avatar acook8 commented on May 31, 2024

Hi, thanks for the hint. Could you give a more complete example? Is this env var the only config you used? Is the {pat} raw or base64 encoded? I tried with a raw token without luck, yet.

The PAT I used was not encoded. The arguments I have set are:

  • git-author-email
  • git-author-name
  • git-username
  • git-path
  • git-fallback-clone

And I have these environment variables:

  • SBOM_GIT_PASSWORD
  • SBOM_GIT_REPOSITORY

I probably don't need all of those set, but I haven't gone back and cleaned up anything that isn't needed

from sbom-operator.

ckotzbauer avatar ckotzbauer commented on May 31, 2024

Hey @acook8, @GDWBaer,
I just pushed ghcr.io/ckotzbauer/sbom-operator:0.23.0-beta.1 (hopefully 0.23.0 later today) with go-git 5.5.0 built-in. This release added support for multi_ack. I justed tested a private Azure DevOps repo with this release without the --git-fallback-clone flag and it worked. Could you please have a look and give me a quick hint if this works for you?
If yes, I will remove the fallback-clone in the near future.

I tested with this URL-format and username and password (as flags): https://{organization}@dev.azure.com/{organization}/{project}/_git/{repo}

from sbom-operator.

ckotzbauer avatar ckotzbauer commented on May 31, 2024

Closing this for now. Please respond if there are still errors.

from sbom-operator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.