Skip to content

Commit 47c8462

Browse files
committed
commands/.../up/local.go: checking error on os.Setenv
1 parent ad036c8 commit 47c8462

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

commands/operator-sdk/cmd/up/local.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ func upLocal() {
147147

148148
func upLocalAnsible() {
149149
// Set the kubeconfig that the manager will be able to grab
150-
os.Setenv(k8sutil.KubeConfigEnvVar, kubeConfig)
150+
if err := os.Setenv(k8sutil.KubeConfigEnvVar, kubeConfig); err != nil {
151+
log.Fatalf("failed to set %s environment variable: (%v)", k8sutil.KubeConfigEnvVar, err)
152+
}
151153

152154
logf.SetLogger(logf.ZapLogger(false))
153155

@@ -183,7 +185,9 @@ func upLocalAnsible() {
183185

184186
func upLocalHelm() {
185187
// Set the kubeconfig that the manager will be able to grab
186-
os.Setenv(k8sutil.KubeConfigEnvVar, kubeConfig)
188+
if err := os.Setenv(k8sutil.KubeConfigEnvVar, kubeConfig); err != nil {
189+
log.Fatalf("failed to set %s environment variable: (%v)", k8sutil.KubeConfigEnvVar, err)
190+
}
187191

188192
logf.SetLogger(logf.ZapLogger(false))
189193

0 commit comments

Comments
 (0)