-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Add --template-driver option for secrets/configs #896
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
cli/command/config/create_test.go
Outdated
return types.ConfigCreateResponse{}, errors.Errorf("expected name %q, got %q", name, spec.Name) | ||
} | ||
|
||
if !reflect.DeepEqual(spec.Templating.Name, expectedDriver.Name) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this just a comparing a string? so it could use !=
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, yes, copy-pasta'd from TestSecretCreateWithDriver
. Let me update
18798e8
to
57abb70
Compare
Codecov Report
@@ Coverage Diff @@
## master #896 +/- ##
==========================================
+ Coverage 53.23% 53.25% +0.02%
==========================================
Files 258 258
Lines 16347 16357 +10
==========================================
+ Hits 8702 8711 +9
- Misses 7081 7082 +1
Partials 564 564 |
Thinking if |
cli/command/config/create_test.go
Outdated
@@ -105,3 +105,32 @@ func TestConfigCreateWithLabels(t *testing.T) { | |||
assert.NoError(t, cmd.Execute()) | |||
assert.Equal(t, "ID-"+name, strings.TrimSpace(cli.OutBuffer().String())) | |||
} | |||
|
|||
func TestConfigCreateWithTemplatingDriver(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test for config create without driver?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a test above that doesn't have a driver, is that what you meant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should check and make sure Templating is nil in that case, I think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be done already if the test used DeepEqual
on the entire spec instead of looking at specific fields. Maybe we should do that here as well.
I like |
57abb70
to
c4b596b
Compare
Changed to |
hmf, secrets side is failing;
But I don't see a different:
|
Signed-off-by: Sebastiaan van Stijn <[email protected]>
e34df9f
to
d11b5cc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🐯
relates to moby/moby#33702