mirror of https://github.com/docker/cli.git
testing config/secrets are showing in pretty print
Signed-off-by: Essam A. Hassan <es.hassan187@gmail.com>
This commit is contained in:
parent
2b1f27ea5e
commit
8238644796
|
@ -48,12 +48,18 @@ func formatServiceInspect(t *testing.T, format formatter.Format, now time.Time)
|
||||||
{
|
{
|
||||||
ConfigID: "mtc3i44r1awdoziy2iceg73z8",
|
ConfigID: "mtc3i44r1awdoziy2iceg73z8",
|
||||||
ConfigName: "configtest.conf",
|
ConfigName: "configtest.conf",
|
||||||
|
File: &swarm.ConfigReferenceFileTarget{
|
||||||
|
Name: "/configtest.conf",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Secrets: []*swarm.SecretReference{
|
Secrets: []*swarm.SecretReference{
|
||||||
{
|
{
|
||||||
SecretID: "3hv39ehbbb4hdozo7spod9ftn",
|
SecretID: "3hv39ehbbb4hdozo7spod9ftn",
|
||||||
SecretName: "secrettest.conf",
|
SecretName: "secrettest.conf",
|
||||||
|
File: &swarm.SecretReferenceFileTarget{
|
||||||
|
Name: "/secrettest.conf",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -145,3 +151,10 @@ func TestJSONFormatWithNoUpdateConfig(t *testing.T) {
|
||||||
}
|
}
|
||||||
assert.Check(t, is.DeepEqual(m1, m2))
|
assert.Check(t, is.DeepEqual(m1, m2))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestPrettyPrintWithConfigsAndSecrets(t *testing.T) {
|
||||||
|
s := formatServiceInspect(t, formatter.NewServiceFormat("pretty"), time.Now())
|
||||||
|
|
||||||
|
assert.Check(t, is.Contains(s, "Configs:"), "Pretty print missing configs")
|
||||||
|
assert.Check(t, is.Contains(s, "Secrets:"), "Pretty print missing secrets")
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue