Skip to content

Conversation

@thaJeztah
Copy link
Member

relates to moby/moby#33702

Copy link
Contributor

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

LGTM

return types.ConfigCreateResponse{}, errors.Errorf("expected name %q, got %q", name, spec.Name)
}

if !reflect.DeepEqual(spec.Templating.Name, expectedDriver.Name) {
Copy link
Contributor

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 != ?

Copy link
Member Author

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

@thaJeztah thaJeztah force-pushed the templated-configs-secrets branch from 18798e8 to 57abb70 Compare February 21, 2018 19:34
@codecov-io
Copy link

codecov-io commented Feb 21, 2018

Codecov Report

Merging #896 into master will increase coverage by 0.02%.
The diff coverage is 100%.

@@            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

@thaJeztah
Copy link
Member Author

Thinking if templating-driver or template-driver is the best name; let me know if template-driver is a better name

assert.Equal(t, "ID-"+name, strings.TrimSpace(cli.OutBuffer().String()))
}

func TestConfigCreateWithTemplatingDriver(t *testing.T) {
Copy link
Collaborator

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?

Copy link
Member Author

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?

Copy link
Collaborator

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?

Copy link
Contributor

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.

@dnephin
Copy link
Contributor

dnephin commented Feb 21, 2018

I like template-driver

@thaJeztah
Copy link
Member Author

Changed to template-driver

@thaJeztah thaJeztah changed the title Add --templating-driver option for secrets/configs Add --template-driver option for secrets/configs Feb 21, 2018
@thaJeztah
Copy link
Member Author

hmf, secrets side is failing;

Error: expected {Annotations:{Name:foo Labels:map[]} Data:[115 101 99 114 101 116 95 102 111 111 95 98 97 114 10] Driver:<nil> Templating:<nil>}, got {Annotations:{Name:foo Labels:map[]} Data:[115 101 99 114 101 116 95 102 111 111 95 98 97 114 10] Driver:<nil> Templating:<nil>}

But I don't see a different:

{Annotations:{Name:foo Labels:map[]} Data:[115 101 99 114 101 116 95 102 111 111 95 98 97 114 10] Driver:<nil> Templating:<nil>}
{Annotations:{Name:foo Labels:map[]} Data:[115 101 99 114 101 116 95 102 111 111 95 98 97 114 10] Driver:<nil> Templating:<nil>}

Copy link
Collaborator

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

LGTM 🐯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants