diff --git a/nomad/structs/variables.go b/nomad/structs/variables.go index 9fef9d710326..423df8deb75a 100644 --- a/nomad/structs/variables.go +++ b/nomad/structs/variables.go @@ -219,9 +219,10 @@ func (vd *VariableDecrypted) Canonicalize() { } } -// GetNamespace returns the variable's namespace. Used for pagination. +// Copy returns a fully hydrated copy of VariableMetadata that can be +// manipulated while ensuring the original is not touched. func (sv *VariableMetadata) Copy() *VariableMetadata { - var out VariableMetadata = *sv + var out = *sv return &out }