-
Notifications
You must be signed in to change notification settings - Fork 0
/
password.go
39 lines (32 loc) · 843 Bytes
/
password.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package installconfig
import (
survey "gopkg.in/AlecAivazis/survey.v1"
"github.com/openshift/installer/pkg/asset"
)
type password struct {
Password string
}
var _ asset.Asset = (*password)(nil)
// Dependencies returns no dependencies.
func (a *password) Dependencies() []asset.Asset {
return []asset.Asset{}
}
// Generate queries for the password from the user.
func (a *password) Generate(asset.Parents) error {
p, err := asset.GenerateUserProvidedAsset(
a.Name(),
&survey.Question{
Prompt: &survey.Password{
Message: "Password",
Help: "The password of the cluster administrator. This will be used to log in to the console.",
},
},
"OPENSHIFT_INSTALL_PASSWORD",
)
a.Password = p
return err
}
// Name returns the human-friendly name of the asset.
func (a *password) Name() string {
return "Password"
}