Skip to content

chore: Add docker and env-no-quotes mount formats#477

Closed
ryan-blunden wants to merge 1 commit intoDopplerHQ:masterfrom
ryan-blunden:rb/docker-mount-format
Closed

chore: Add docker and env-no-quotes mount formats#477
ryan-blunden wants to merge 1 commit intoDopplerHQ:masterfrom
ryan-blunden:rb/docker-mount-format

Conversation

@ryan-blunden
Copy link
Copy Markdown
Contributor

No description provided.

@ryan-blunden ryan-blunden requested a review from a team as a code owner January 17, 2025 04:38
@nmanoogian nmanoogian self-requested a review January 27, 2025 22:40
Copy link
Copy Markdown
Contributor

@nmanoogian nmanoogian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay on the review, @ryan-blunden, and thanks for putting this up! I actually just bumped into this missing mount format on a personal project the other day.

Everything looks good and works well in my testing. Just one small comment on the automated tests.

t.Errorf("Unable to convert secrets to byte array in %s format", format)
}

format = "env"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check/copy-pasta: These look identical to the env tests above. I assume this is supposed to be testing the new formats?

diff --git a/pkg/controllers/secrets_test.go b/pkg/controllers/secrets_test.go
index 23ab1f6..bccb47c 100644
--- a/pkg/controllers/secrets_test.go
+++ b/pkg/controllers/secrets_test.go
@@ -82,15 +82,15 @@ func TestSecretsToBytes(t *testing.T) {
 		t.Errorf("Unable to convert secrets to byte array in %s format", format)
 	}
 
-	format = "env"
+	format = "env-no-quotes"
 	bytes, err = SecretsToBytes(secrets, format, "")
-	if !err.IsNil() || string(bytes) != strings.Join([]string{`S1="foo"`, `SECRET2="bar"`}, "\n") {
+	if !err.IsNil() || string(bytes) != strings.Join([]string{`S1=foo`, `SECRET2=bar`}, "\n") {
 		t.Errorf("Unable to convert secrets to byte array in %s format", format)
 	}
 
-	format = "env"
+	format = "docker"
 	bytes, err = SecretsToBytes(secrets, format, "")
-	if !err.IsNil() || string(bytes) != strings.Join([]string{`S1="foo"`, `SECRET2="bar"`}, "\n") {
+	if !err.IsNil() || string(bytes) != strings.Join([]string{`S1=foo`, `SECRET2=bar`}, "\n") {
 		t.Errorf("Unable to convert secrets to byte array in %s format", format)
 	}
 

(You can apply by copying the patch and doing pbpaste | git apply or pasting manually)

@nmanoogian
Copy link
Copy Markdown
Contributor

We've gotten a few requests for this recently so I'll push the change back up on an internal branch (#481) and merge it. Thanks again for putting this up!

@nmanoogian nmanoogian closed this Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants