Skip to content

Commit 6925b14

Browse files
committed
chore(registry): remove registry_secret_prefix
1 parent 5986b60 commit 6925b14

5 files changed

Lines changed: 9 additions & 12 deletions

File tree

charts/builder/templates/builder-deployment.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ spec:
5555
value: "{{ .Values.global.storage }}"
5656
- name: "DRYCC_REGISTRY_LOCATION"
5757
value: "{{ .Values.global.registry_location }}"
58-
- name: "DRYCC_REGISTRY_SECRET_PREFIX"
59-
value: "{{ .Values.global.registry_secret_prefix }}"
6058
# Set GIT_LOCK_TIMEOUT to number of minutes you want to wait to git push again to the same repository
6159
- name: "GIT_LOCK_TIMEOUT"
6260
value: "10"

pkg/gitreceive/build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ func build(
169169
registryLocation := conf.RegistryLocation
170170
registryEnv := make(map[string]string)
171171
if registryLocation != "on-cluster" {
172-
registryEnv, err = getRegistryDetails(kubeClient, &image, registryLocation, conf.PodNamespace, conf.RegistrySecretPrefix)
172+
registryEnv, err = getRegistryDetails(kubeClient, &image, registryLocation, conf.PodNamespace)
173173
if err != nil {
174174
return fmt.Errorf("error getting private registry details %s", err)
175175
}

pkg/gitreceive/config.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@ const (
1414
// builder's git-receive hook.
1515
type Config struct {
1616
// k8s service discovery env vars
17-
ControllerHost string `envconfig:"DRYCC_CONTROLLER_SERVICE_HOST" required:"true"`
18-
ControllerPort string `envconfig:"DRYCC_CONTROLLER_SERVICE_PORT" required:"true"`
19-
RegistryHost string `envconfig:"DRYCC_REGISTRY_PROXY_HOST" required:"true"`
20-
RegistryPort string `envconfig:"DRYCC_REGISTRY_PROXY_PORT" required:"true"`
21-
RegistryLocation string `envconfig:"DRYCC_REGISTRY_LOCATION" default:"on-cluster"`
22-
RegistrySecretPrefix string `envconfig:"DRYCC_REGISTRY_SECRET_PREFIX" default:"private-registry"`
17+
ControllerHost string `envconfig:"DRYCC_CONTROLLER_SERVICE_HOST" required:"true"`
18+
ControllerPort string `envconfig:"DRYCC_CONTROLLER_SERVICE_PORT" required:"true"`
19+
RegistryHost string `envconfig:"DRYCC_REGISTRY_PROXY_HOST" required:"true"`
20+
RegistryPort string `envconfig:"DRYCC_REGISTRY_PROXY_PORT" required:"true"`
21+
RegistryLocation string `envconfig:"DRYCC_REGISTRY_LOCATION" default:"on-cluster"`
2322

2423
GitHome string `envconfig:"GIT_HOME" required:"true"`
2524
SSHConnection string `envconfig:"SSH_CONNECTION" required:"true"`

pkg/gitreceive/registry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func getDetailsFromRegistrySecret(secretGetter client.SecretsInterface, secret s
2222
return regDetails, nil
2323
}
2424

25-
func getRegistryDetails(kubeClient client.SecretsNamespacer, image *string, registryLocation, namespace, registrySecretPrefix string) (map[string]string, error) {
25+
func getRegistryDetails(kubeClient client.SecretsNamespacer, image *string, registryLocation, namespace string) (map[string]string, error) {
2626
privateRegistrySecretInterface := kubeClient.Secrets(namespace)
2727
registryEnv := make(map[string]string)
2828
var regSecretData map[string]string

pkg/gitreceive/registry_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func TestGetRegistryDetailsOffclusterErr(t *testing.T) {
5454
},
5555
}
5656
image := "test-image"
57-
_, err := getRegistryDetails(kubeClient, &image, "off-cluster", dryccNamespace, "private-registry")
57+
_, err := getRegistryDetails(kubeClient, &image, "off-cluster", dryccNamespace)
5858
assert.Err(t, err, expectedErr)
5959
}
6060

@@ -75,7 +75,7 @@ func TestGetRegistryDetailsOffclusterSuccess(t *testing.T) {
7575
},
7676
}
7777
image := "test-image"
78-
regDetails, err := getRegistryDetails(kubeClient, &image, "off-cluster", dryccNamespace, "private-registry")
78+
regDetails, err := getRegistryDetails(kubeClient, &image, "off-cluster", dryccNamespace)
7979
assert.NoErr(t, err)
8080
assert.Equal(t, expectedData, regDetails, "registry details")
8181
assert.Equal(t, expectedImage, image, "image")

0 commit comments

Comments
 (0)