Skip to content

Commit

Permalink
Merge branch 'master' into opensearch_as_service
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyrremann committed Mar 2, 2022
2 parents b7acdcf + 968bf68 commit 457f867
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/config/environment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestKafkaEnvironmentConfigGenerated(t *testing.T) {
err := WriteKafkaEnvConfigToFile(test.SetupSecret(envKeys), tmpDest)
assert.NoError(t, err)

result, err := ioutil.ReadFile(filepath.Join(tmpDest, KafkaSchemaRegistryEnvName))
result, err := ioutil.ReadFile(filepath.Join(tmpDest, KafkaEnvName))
assert.NoError(t, err)

assert.True(t, strings.Contains(string(result), consts.KafkaClientTruststoreJksFile))
Expand Down
6 changes: 3 additions & 3 deletions pkg/config/java.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

const (
JavaConfigName = "kafka.properties"
KafkaJavaConfigName = "kafka.properties"

KeyPassProp = "ssl.key.password"
KeyStorePassProp = "ssl.keystore.password"
Expand All @@ -30,7 +30,7 @@ ssl.truststore.type=JKS

func NewJavaConfig(secret *v1.Secret, destinationPath string) error {
properties := fmt.Sprintf("# nais-cli %s\n", time.Now().Truncate(time.Minute))
properties += fmt.Sprintf(FileHeader, secret.Namespace, secret.Data[consts.KafkaBrokersKey], filepath.Join(destinationPath, JavaConfigName))
properties += fmt.Sprintf(FileHeader, secret.Namespace, secret.Data[consts.KafkaBrokersKey], filepath.Join(destinationPath, KafkaJavaConfigName))

envsToFile := map[string]string{
KeyPassProp: string(secret.Data[consts.KafkaCredStorePasswordKey]),
Expand All @@ -44,7 +44,7 @@ func NewJavaConfig(secret *v1.Secret, destinationPath string) error {
properties += fmt.Sprintf("%s=%s\n", key, value)
}

if err := common.WriteToFile(destinationPath, JavaConfigName, []byte(properties)); err != nil {
if err := common.WriteToFile(destinationPath, KafkaJavaConfigName, []byte(properties)); err != nil {
return fmt.Errorf("write envs to file: %s", err)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/config/java_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestJavaConfigGenerated(t *testing.T) {
err := NewJavaConfig(test.SetupSecret(envKeys), tmpDest)
assert.NoError(t, err)

result, err := ioutil.ReadFile(filepath.Join(tmpDest, JavaConfigName))
result, err := ioutil.ReadFile(filepath.Join(tmpDest, KafkaJavaConfigName))
assert.NoError(t, err)

assert.True(t, strings.Contains(string(result), consts.KafkaClientTruststoreJksFile))
Expand Down

0 comments on commit 457f867

Please sign in to comment.