(ctx *cli.Context)
| 83 | } |
| 84 | |
| 85 | func bootstrapAction(ctx *cli.Context) error { |
| 86 | caURL, err := flags.ParseCaURLIfExists(ctx) |
| 87 | if err != nil { |
| 88 | return err |
| 89 | } |
| 90 | fingerprint := strings.TrimSpace(ctx.String("fingerprint")) |
| 91 | team := ctx.String("team") |
| 92 | teamAuthority := ctx.String("team-authority") |
| 93 | |
| 94 | switch { |
| 95 | case team != "" && caURL != "": |
| 96 | return errs.IncompatibleFlagWithFlag(ctx, "team", "ca-url") |
| 97 | case team != "" && fingerprint != "": |
| 98 | return errs.IncompatibleFlagWithFlag(ctx, "team", "fingerprint") |
| 99 | case team != "" && teamAuthority != "": |
| 100 | return cautils.BootstrapTeamAuthority(ctx, team, teamAuthority) |
| 101 | case team != "": |
| 102 | return cautils.BootstrapTeamAuthority(ctx, team, "ssh") |
| 103 | case teamAuthority != "": |
| 104 | return errs.RequiredWithFlag(ctx, "team-authority", "team") |
| 105 | case caURL == "": |
| 106 | return errs.RequiredFlag(ctx, "ca-url") |
| 107 | case fingerprint == "": |
| 108 | return errs.RequiredFlag(ctx, "fingerprint") |
| 109 | default: |
| 110 | return cautils.BootstrapAuthority(ctx, caURL, fingerprint) |
| 111 | } |
| 112 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…