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

Rename whitelist to allowlist #2338

Merged
merged 2 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions deploy/openshift-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ echo "jvm build service jvm cache image:"
echo ${JVM_BUILD_SERVICE_CACHE_IMAGE}
echo "jvm build service jvm reqprocessor image:"
echo ${JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE}
echo "jvm build service jvm domain proxy image:"
echo ${JVM_BUILD_SERVICE_DOMAIN_PROXY_IMAGE}

function waitFor() {
endTime=$(( $(date +%s) + 600 ))
Expand Down
8 changes: 4 additions & 4 deletions deploy/tasks/buildah-oci-ta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ spec:
description: The idle timeout in milliseconds to use for the domain proxy.
type: string
default: 30000
- name: DOMAIN_PROXY_TARGET_WHITELIST
description: Comma separated whitelist of target hosts for the domain proxy.
- name: DOMAIN_PROXY_TARGET_ALLOWLIST
description: Comma separated list of allowed target hosts for the domain proxy.
type: string
default: ""
- name: DOMAIN_PROXY_ENABLE_INTERNAL_PROXY
Expand Down Expand Up @@ -303,8 +303,8 @@ spec:
value: $(params.DOMAIN_PROXY_CONNECTION_TIMEOUT)
- name: DOMAIN_PROXY_IDLE_TIMEOUT
value: $(params.DOMAIN_PROXY_IDLE_TIMEOUT)
- name: DOMAIN_PROXY_TARGET_WHITELIST
value: $(params.DOMAIN_PROXY_TARGET_WHITELIST)
- name: DOMAIN_PROXY_TARGET_ALLOWLIST
value: $(params.DOMAIN_PROXY_TARGET_ALLOWLIST)
- name: DOMAIN_PROXY_ENABLE_INTERNAL_PROXY
value: $(params.DOMAIN_PROXY_ENABLE_INTERNAL_PROXY)
- name: DOMAIN_PROXY_INTERNAL_PROXY_HOST
Expand Down
1 change: 1 addition & 0 deletions docs/development.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ export QUAY_USERNAME=<your-quay-io-account-username>
export JVM_BUILD_SERVICE_IMAGE=
export JVM_BUILD_SERVICE_CACHE_IMAGE=
export JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE=
export JVM_BUILD_SERVICE_DOMAIN_PROXY_IMAGE=
./deploy/openshift-ci.sh
make openshift-e2e
----
21 changes: 16 additions & 5 deletions pkg/reconciler/dependencybuild/buildrecipeyaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/go-logr/logr"
v12 "k8s.io/apimachinery/pkg/apis/meta/v1"
"net/url"
"os"
"regexp"
"strconv"
"strings"
Expand All @@ -30,6 +31,8 @@ const (
BuildTaskName = "build"
PostBuildTaskName = "post-build"
DeployTaskName = "deploy"

DomainProxyImage = "quay.io/redhat-user-workloads/konflux-jbs-pnc-tenant/domain-proxy:latest"
)

//go:embed scripts/maven-build.sh
Expand Down Expand Up @@ -481,7 +484,7 @@ func createPipelineSpec(log logr.Logger, tool string, commitTime int64, jbsConfi
},
}

whitelistUrl, err := url.Parse(cacheUrl)
allowlistUrl, err := url.Parse(cacheUrl)
if err != nil {
return nil, "", err
}
Expand Down Expand Up @@ -542,7 +545,7 @@ func createPipelineSpec(log logr.Logger, tool string, commitTime int64, jbsConfi
Name: "BUILD_IMAGE",
Value: tektonpipeline.ParamValue{
Type: tektonpipeline.ParamTypeString,
StringVal: DomainProxyImage,
StringVal: domainProxyImage(),
},
},
{
Expand All @@ -553,10 +556,10 @@ func createPipelineSpec(log logr.Logger, tool string, commitTime int64, jbsConfi
},
},
{
Name: "DOMAIN_PROXY_TARGET_WHITELIST",
Name: "DOMAIN_PROXY_TARGET_ALLOWLIST",
Value: tektonpipeline.ParamValue{
Type: tektonpipeline.ParamTypeString,
StringVal: whitelistUrl.Host + ",localhost,cdn-ubi.redhat.com,repo1.maven.org,repo.scala-sbt.org,scala.jfrog.io,repo.typesafe.com,jfrog-prod-usw2-shared-oregon-main.s3.amazonaws.com",
StringVal: allowlistUrl.Host + ",localhost,cdn-ubi.redhat.com,repo1.maven.org,repo.scala-sbt.org,scala.jfrog.io,repo.typesafe.com,jfrog-prod-usw2-shared-oregon-main.s3.amazonaws.com",
},
},
{
Expand Down Expand Up @@ -591,7 +594,7 @@ func createPipelineSpec(log logr.Logger, tool string, commitTime int64, jbsConfi
Name: "DOMAIN_PROXY_INTERNAL_NON_PROXY_HOSTS",
Value: tektonpipeline.ParamValue{
Type: tektonpipeline.ParamTypeString,
StringVal: whitelistUrl.Host + ",localhost",
StringVal: allowlistUrl.Host + ",localhost",
},
},
},
Expand Down Expand Up @@ -991,3 +994,11 @@ func settingOrDefault(setting, def string) string {
}
return setting
}

func domainProxyImage() string {
domainProxyImage := os.Getenv("JVM_BUILD_SERVICE_DOMAIN_PROXY_IMAGE")
if len(domainProxyImage) == 0 {
domainProxyImage = DomainProxyImage
}
return domainProxyImage
}
2 changes: 0 additions & 2 deletions pkg/reconciler/dependencybuild/dependencybuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ const (

PipelineRunFinalizer = "jvmbuildservice.io/finalizer"
DeploySuffix = "-deploy"

DomainProxyImage = "quay.io/redhat-user-workloads/konflux-jbs-pnc-tenant/domain-proxy:latest"
)

type ReconcileDependencyBuild struct {
Expand Down
Loading