@@ -30,7 +30,6 @@ import (
30
30
)
31
31
32
32
const (
33
- sendgridAPIKeyFlag = "sendgrid-api-key"
34
33
sendgridAPIKeyEnvKey = "SENDGRID_API_KEY"
35
34
nameFlag = "name"
36
35
emailFlag = "email"
@@ -50,8 +49,7 @@ krel announce can be used to announce already built Kubernetes releases to the
50
49
If --nomock=true (the default), then the mail will be sent only to a test
51
50
Google Group %q.
52
51
53
- It is necessary to either set a valid --%s,-s or export the
54
- $%s environment variable. An API key can be created by
52
+ It is necessary to export the $%s environment variable. An API key can be created by
55
53
registering a sendgrid.com account and adding the key here:
56
54
57
55
https://app.sendgrid.com/settings/api_keys
@@ -67,7 +65,6 @@ without doing anything else.`,
67
65
mail .KubernetesAnnounceGoogleGroup ,
68
66
mail .KubernetesDevGoogleGroup ,
69
67
mail .KubernetesAnnounceTestGoogleGroup ,
70
- sendgridAPIKeyFlag ,
71
68
sendgridAPIKeyEnvKey ,
72
69
nameFlag ,
73
70
emailFlag ,
@@ -92,16 +89,7 @@ type announceOptions struct {
92
89
var announceOpts = & announceOptions {}
93
90
94
91
func init () {
95
- announceCmd .PersistentFlags ().StringVarP (
96
- & announceOpts .sendgridAPIKey ,
97
- sendgridAPIKeyFlag ,
98
- "s" ,
99
- util .EnvDefault (sendgridAPIKeyEnvKey , "" ),
100
- fmt .Sprintf (
101
- "API key for sendgrid, can be set via %s too" ,
102
- sendgridAPIKeyEnvKey ,
103
- ),
104
- )
92
+ announceOpts .sendgridAPIKey = util .EnvDefault (sendgridAPIKeyEnvKey , "" )
105
93
106
94
announceCmd .PersistentFlags ().StringVarP (
107
95
& announceOpts .name ,
@@ -167,7 +155,7 @@ func runAnnounce(opts *announceOptions, rootOpts *rootOptions) error {
167
155
168
156
if opts .sendgridAPIKey == "" {
169
157
return errors .Errorf (
170
- "Neither --sendgrid-api-key,-s nor $%s is set" , sendgridAPIKeyEnvKey ,
158
+ "$%s is not set" , sendgridAPIKeyEnvKey ,
171
159
)
172
160
}
173
161
0 commit comments