Skip to content

Commit

Permalink
Merge pull request #65 from containerish/fix-oci-conformance-github-a…
Browse files Browse the repository at this point in the history
…ction

Fix: Failing github action for OCI Conformanve
  • Loading branch information
guacamole authored Nov 20, 2021
2 parents fac9ffb + 247719f commit d814435
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
echo "OCI_ROOT_URL=http://$IP:5000" >> $GITHUB_ENV
DISTRIBUTION_REF="local-distribution:v$(date +%Y%m%d%H%M%S)"
docker build -f ./Dockerfile -t "${DISTRIBUTION_REF}" .
sed -in "s/OPEN_REGISTRY_ENVIRONMENT=local/OPEN_REGISTRY_ENVIRONMENT=ci/g" env-vars.example
echo CI_SYS_ADDR=$IP:5000 >> env-vars.example
docker run --rm -p 5000:5000 --env-file ./env-vars.example -e REGISTRY_STORAGE_DELETE_ENABLED=true -d "${DISTRIBUTION_REF}"
sleep 5
curl -XPOST -d ${{ secrets.OPENREGISTRY_SIGNUP_PAYLOAD }} "http://${IP}:5000/auth/signup"
Expand Down
11 changes: 10 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package config

import (
"fmt"
"log"
"os"
"strings"

Expand Down Expand Up @@ -102,8 +103,15 @@ func (r *RegistryConfig) Endpoint() string {
return fmt.Sprintf("http://%s:%d", r.Host, r.Port)
case Prod, Stage:
return fmt.Sprintf("https://%s", r.DNSAddress)
case CI:
ciSysAddr := os.Getenv("CI_SYS_ADDR")
if ciSysAddr == "" {
log.Fatalln("missing required environment variable: CI_SYS_ADDR")
}

return fmt.Sprintf("http://%s", ciSysAddr)
default:
return fmt.Sprintf("http://%s:%d", r.Host, r.Port)
return fmt.Sprintf("https://%s:%d", r.Host, r.Port)
}
}

Expand All @@ -112,4 +120,5 @@ const (
Stage = "stage"
Dev = "development"
Local = "local"
CI = "ci"
)

0 comments on commit d814435

Please sign in to comment.