Fix guided lifecycle job scoping
This commit is contained in:
@@ -291,19 +291,20 @@ func (svc *CoreService) dispatchLifecycleJob(instance domain.ServerInstance, act
|
||||
return domain.Job{}, err
|
||||
}
|
||||
profileKey := ""
|
||||
if err == nil {
|
||||
if err == nil && strings.TrimSpace(binding.ProfileKey) != "" {
|
||||
profileKey = binding.ProfileKey
|
||||
} else {
|
||||
profileKey = instance.Deployment.ProfileKey
|
||||
}
|
||||
actionRef := profileKey
|
||||
actionRef := ""
|
||||
profile, hasProfile := runtimeLifecycleProfileForKey(plugin.RuntimeProfiles, profileKey)
|
||||
if hasProfile {
|
||||
if ref := runtimeProfileActionRef(profile.ActionRefs, action); ref != "" {
|
||||
actionRef = ref
|
||||
}
|
||||
} else if ref := lifecycleActionRef(plugin, action); ref != "" {
|
||||
actionRef = ref
|
||||
}
|
||||
if strings.TrimSpace(actionRef) == "" {
|
||||
actionRef = lifecycleActionRef(plugin, action)
|
||||
}
|
||||
if strings.TrimSpace(actionRef) == "" {
|
||||
return domain.Job{}, validationError(fmt.Sprintf("plugin %s lifecycle action is required", action))
|
||||
|
||||
Reference in New Issue
Block a user