open-nomad/nomad/structs/workload_id_test.go
Charlie Voiselle cc6f4719f1
Add option to expose workload token to task (#15755)
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>
2023-02-02 10:59:14 -08:00

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)
}