Skip to content

Commit

Permalink
Use only sap version in manifest (#92)
Browse files Browse the repository at this point in the history
* Use only SAP version in buildpack dependency

* Rename dependency to sap-opa

* Hardcode binary name
  • Loading branch information
f-blass authored Aug 12, 2024
1 parent b71d352 commit c35c640
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions manifest.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
language: opa
default_versions:
- name: opa
version: "0.60.0-sap-0.3.7"
- name: sap-opa
version: "0.3.7"
dependency_deprecation_dates:
dependencies:
- name: opa
- name: sap-opa
# 0 patch versions don't work here, see https://github.com/cloudfoundry/libbuildpack/issues/181
version: "0.60.0-sap-0.3.7"
version: "0.3.7" # Using the full version causes a warning like "**WARNING** You are using the pre-release version 0.60.0-sap-0.3.7 of opa"
file: "resources/opa.tar.gz"
sha256: 74fdf4736efb7d9e204e9c0d972026cd18c8d083809a22c59c42207a73214034
uri: https://github.com/SAP/cloud-authorization-buildpack/raw/main/resources/opa.tar.gz
Expand Down
4 changes: 2 additions & 2 deletions pkg/supply/supply.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,15 +251,15 @@ func (s *Supplier) writeLaunchConfig(cfg env.Config) error {
}

func (s *Supplier) supplyOPABinary() error {
opaDep, err := s.Manifest.DefaultVersion("opa")
opaDep, err := s.Manifest.DefaultVersion("sap-opa")
if err != nil {
return err
}
if err = s.Installer.InstallDependency(opaDep, s.Stager.DepDir()); err != nil {
return fmt.Errorf("couldn't install OPA dependency: %w", err)
}
// The packager overwrites the permissions, so we need to make it executable again
return os.Chmod(path.Join(s.Stager.DepDir(), opaDep.Name), 0755)
return os.Chmod(path.Join(s.Stager.DepDir(), "opa"), 0755)
}

func (s *Supplier) supplyCertCopier() error {
Expand Down
2 changes: 1 addition & 1 deletion pkg/uploader/archiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func CreateArchive(log *libbuildpack.Logger, root string) (*bytes.Buffer, error)
return nil, err
}

log.Debug("uploaded tar: %s", base64.StdEncoding.EncodeToString(buf.Bytes()))
log.Debug("built tar: %s", base64.StdEncoding.EncodeToString(buf.Bytes()))
return &buf, nil
}

Expand Down

0 comments on commit c35c640

Please sign in to comment.