Skip to content

Commit

Permalink
add "or later" to log warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross committed Oct 31, 2023
1 parent 8b4ed26 commit 486b2b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion nomad/job_endpoint_hook_implicit_identities.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ func (jobImplicitIdentitiesHook) Name() string {
}

func (h jobImplicitIdentitiesHook) Mutate(job *structs.Job) (*structs.Job, []error, error) {

for _, tg := range job.TaskGroups {
for _, s := range tg.Services {
h.handleConsulService(s)
Expand Down
6 changes: 3 additions & 3 deletions nomad/job_endpoint_hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ func (v *jobValidate) Validate(job *structs.Job) (warnings []error, err error) {

for _, t := range tg.Tasks {
if len(t.Identities) > 1 && !okForIdentity {
multierror.Append(validationErrors, fmt.Errorf("tasks can only have 1 identity block until all servers are upgraded to %s", minVersionMultiIdentities))
multierror.Append(validationErrors, fmt.Errorf("tasks can only have 1 identity block until all servers are upgraded to %s or later", minVersionMultiIdentities))
}
for _, s := range t.Services {
serviceErrs := v.validateServiceIdentity(
Expand All @@ -419,7 +419,7 @@ func (v *jobValidate) isEligibleForMultiIdentity() bool {

func (v *jobValidate) validateServiceIdentity(s *structs.Service, parent string, okForIdentity bool) error {
if s.Identity != nil && !okForIdentity {
return fmt.Errorf("Service %s in %s cannot have an identity until all servers are upgraded to %s",
return fmt.Errorf("Service %s in %s cannot have an identity until all servers are upgraded to %s or later",
s.Name, parent, minVersionMultiIdentities)
}
if s.Identity != nil && s.Identity.Name == "" {
Expand Down Expand Up @@ -451,7 +451,7 @@ func (v *jobValidate) validateVaultIdentity(t *structs.Task, okForIdentity bool)
vaultWID := t.GetIdentity(vaultWIDName)

if vaultWID != nil && !okForIdentity {
return warnings, fmt.Errorf("Task %s cannot have an identity for Vault until all servers are upgraded to %s", t.Name, minVersionMultiIdentities)
return warnings, fmt.Errorf("Task %s cannot have an identity for Vault until all servers are upgraded to %s or later", t.Name, minVersionMultiIdentities)
}

if vaultWID == nil {
Expand Down

0 comments on commit 486b2b9

Please sign in to comment.