mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 19:05:42 +03:00
Fix WorkloadIdentity.TTL handling, jobspec2 testing, and hcl1 vs 2 parsing (#19024)
* make the little dots consistent * don't trim delimiter as that over matches * test jobspec2 package * copy api/WorkloadIdentity.TTL -> structs * test ttl parsing * fix hcl1 v 2 parsing mismatch * make jobspec(1) tests match jobspec2 tests
This commit is contained in:
@@ -1645,6 +1645,7 @@ func apiWorkloadIdentityToStructs(in *api.WorkloadIdentity) *structs.WorkloadIde
|
||||
Env: in.Env,
|
||||
File: in.File,
|
||||
ServiceName: in.ServiceName,
|
||||
TTL: in.TTL,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4250,7 +4250,9 @@ func TestConversion_ApiConsulConnectToStructs(t *testing.T) {
|
||||
|
||||
func Test_apiWorkloadIdentityToStructs(t *testing.T) {
|
||||
ci.Parallel(t)
|
||||
|
||||
must.Nil(t, apiWorkloadIdentityToStructs(nil))
|
||||
|
||||
must.Eq(t, &structs.WorkloadIdentity{
|
||||
Name: "consul/test",
|
||||
Audience: []string{"consul.io"},
|
||||
@@ -4264,6 +4266,7 @@ func Test_apiWorkloadIdentityToStructs(t *testing.T) {
|
||||
File: false,
|
||||
ServiceName: "web",
|
||||
}))
|
||||
|
||||
must.Eq(t, &structs.WorkloadIdentity{
|
||||
Name: "aws",
|
||||
Audience: []string{"s3"},
|
||||
@@ -4271,6 +4274,7 @@ func Test_apiWorkloadIdentityToStructs(t *testing.T) {
|
||||
File: true,
|
||||
ChangeMode: "signal",
|
||||
ChangeSignal: "SIGHUP",
|
||||
TTL: 2 * time.Hour,
|
||||
}, apiWorkloadIdentityToStructs(&api.WorkloadIdentity{
|
||||
Name: "aws",
|
||||
Audience: []string{"s3"},
|
||||
@@ -4278,5 +4282,6 @@ func Test_apiWorkloadIdentityToStructs(t *testing.T) {
|
||||
File: true,
|
||||
ChangeMode: "signal",
|
||||
ChangeSignal: "SIGHUP",
|
||||
TTL: 2 * time.Hour,
|
||||
}))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user