cc6f4719f1
Add `identity` jobspec block to expose workload identity tokens to tasks. --------- Co-authored-by: Anders <mail@anars.dk> Co-authored-by: Tim Gross <tgross@hashicorp.com> Co-authored-by: Michael Schurter <mschurter@hashicorp.com>
33 lines
517 B
Go
33 lines
517 B
Go
package structs
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/hashicorp/nomad/ci"
|
|
"github.com/shoenig/test/must"
|
|
)
|
|
|
|
func TestWorkloadIdentity_Equal(t *testing.T) {
|
|
ci.Parallel(t)
|
|
|
|
var orig *WorkloadIdentity
|
|
|
|
newWI := orig.Copy()
|
|
must.Equal(t, orig, newWI)
|
|
|
|
orig = &WorkloadIdentity{}
|
|
must.NotEqual(t, orig, newWI)
|
|
|
|
newWI = &WorkloadIdentity{}
|
|
must.Equal(t, orig, newWI)
|
|
|
|
orig.Env = true
|
|
must.NotEqual(t, orig, newWI)
|
|
|
|
newWI.Env = true
|
|
must.Equal(t, orig, newWI)
|
|
|
|
newWI.File = true
|
|
must.NotEqual(t, orig, newWI)
|
|
}
|