(ctx *cli.Context)
| 718 | } |
| 719 | |
| 720 | func isNonInteractiveInit(ctx *cli.Context) bool { |
| 721 | var pkiFlags []string |
| 722 | configFlags := []string{ |
| 723 | "dns", "address", "provisioner", |
| 724 | } |
| 725 | switch strings.ToLower(ctx.String("ra")) { |
| 726 | case apiv1.CloudCAS: |
| 727 | pkiFlags = []string{"issuer"} |
| 728 | configFlags = append(configFlags, "password-file") |
| 729 | case apiv1.StepCAS: |
| 730 | pkiFlags = []string{"issuer", "issuer-fingerprint", "issuer-provisioner"} |
| 731 | configFlags = append(configFlags, "password-file") |
| 732 | default: |
| 733 | pkiFlags = []string{"name", "password-file"} |
| 734 | } |
| 735 | |
| 736 | for _, s := range pkiFlags { |
| 737 | if ctx.String(s) == "" { |
| 738 | return false |
| 739 | } |
| 740 | } |
| 741 | |
| 742 | // If not pki only, then require all config flags. |
| 743 | if !ctx.Bool("pki") { |
| 744 | for _, s := range configFlags { |
| 745 | if ctx.String(s) == "" { |
| 746 | return false |
| 747 | } |
| 748 | } |
| 749 | } |
| 750 | |
| 751 | return true |
| 752 | } |
| 753 | |
| 754 | func promptDeploymentType(ctx *cli.Context, isRA bool) (pki.DeploymentType, error) { |
| 755 | type deployment struct { |
no test coverage detected
searching dependent graphs…