mirror of
https://github.com/netbirdio/kubernetes-operator.git
synced 2026-05-22 17:11:40 -07:00
Verify management url correct format (#254)
Makes sure that we can parse the management url if configured by user. Fixes #78 Signed-off-by: Philip Laine <philip.laine@gmail.com>
This commit is contained in:
+7
-4
@@ -3,14 +3,13 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
|
||||
// to ensure that exec-entrypoint and run can make use of them.
|
||||
_ "k8s.io/client-go/plugin/pkg/client/auth"
|
||||
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
"flag"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
@@ -130,12 +129,16 @@ func main() {
|
||||
|
||||
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
|
||||
|
||||
runtimeNamespace, err := getRuntimeNamespace(runtimeNamespace)
|
||||
_, err := url.Parse(managementURL)
|
||||
if err != nil {
|
||||
setupLog.Error(err, "invalid management url")
|
||||
os.Exit(1)
|
||||
}
|
||||
runtimeNamespace, err = getRuntimeNamespace(runtimeNamespace)
|
||||
if err != nil {
|
||||
setupLog.Error(err, "unable to get runtime namespace")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if clientImage == "" {
|
||||
clientImage = version.ClientImage()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user