Uploaded image for project: 'Openshift sandboxed containers'
  1. Openshift sandboxed containers
  2. KATA-3130

dev builds are failing to build attestation-agent: osbs removes .git folder

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: High High
    • None
    • OSC 1.7.0
    • CPaaS
    • None
    • False
    • None
    • False
    • 5
    • 0
    • 0

      During the build process, attestation-agent uses `.git` folder to check the git commit hash:

      https://github.com/confidential-containers/guest-components/blob/main/attestation-agent/attestation-agent/build.rs#L68

      Since OSBS is removing .git folder the attestation-agent build will fail with:

      ```
      2024-06-18 23:55:53,020 - atomic_reactor.tasks.binary_container_build - INFO - — stderr
      2024-06-18 23:55:53,020 - atomic_reactor.tasks.binary_container_build - INFO - thread 'main' panicked at attestation-agent/attestation-agent/build.rs:71:14:
      2024-06-18 23:55:53,024 - atomic_reactor.tasks.binary_container_build - INFO - called `Result::unwrap()` on an `Err` value: Os

      { code: 2, kind: NotFound, message: "No such file or directory" }

      ```

      We need to fix that. A few solutions I could think at the moment:

      1. Adapt upstream code to query environment variables in case .git does not exist. (And use CI_<REPO_NAME>_UPSTREAM_COMMIT in Dockerfile template)
      2. Investigate if OSBS could preserve .git folder
      3. Create a fake git repo (ugly?)

              beraldoleal Beraldo Leal
              beraldoleal Beraldo Leal
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: