(deps commandDeps, action string)
| 67 | } |
| 68 | |
| 69 | func requireUnmanagedForMutation(deps commandDeps, action string) error { |
| 70 | state := detectManagedState(deps) |
| 71 | if !state.Managed { |
| 72 | return nil |
| 73 | } |
| 74 | return fmt.Errorf( |
| 75 | "cli: AGH is managed by %s; refusing to %s through this binary. %s", |
| 76 | state.Manager, |
| 77 | strings.TrimSpace(action), |
| 78 | managedRecommendation(state.Manager, action), |
| 79 | ) |
| 80 | } |
| 81 | |
| 82 | func managedRecommendation(manager string, action string) string { |
| 83 | normalizedManager := strings.ToLower(strings.TrimSpace(manager)) |
no test coverage detected