summaryrefslogtreecommitdiff
path: root/importDomain.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-01 12:48:31 -0500
committerJeff Carr <[email protected]>2024-11-01 12:48:31 -0500
commit71e0065240b5bf4a4476e55cc6dcb3648aa82e8f (patch)
treefb37829b16e9ea8a094786c59647db28ed70f93e /importDomain.go
parent301fe567e2318c318c073226475f83941e5da6be (diff)
everything is working againv0.2.2
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'importDomain.go')
-rw-r--r--importDomain.go17
1 files changed, 12 insertions, 5 deletions
diff --git a/importDomain.go b/importDomain.go
index 50dfd90..71aa42b 100644
--- a/importDomain.go
+++ b/importDomain.go
@@ -20,6 +20,7 @@ import (
func importDomain(w http.ResponseWriter, r *http.Request) (string, error) {
var result string
domainName := r.URL.Query().Get("domainName")
+ force := r.URL.Query().Get("force")
if domainName == "" {
result = "importDomain() failed. name is blank " + r.URL.Path
log.Warn(result)
@@ -30,7 +31,7 @@ func importDomain(w http.ResponseWriter, r *http.Request) (string, error) {
// a LocalOnly record should already have been created by hypervisor.Poll()
d := me.cluster.FindDropletByName(domainName)
if d == nil {
- result = "libvirt domain " + domainName + " could not be found on any hypervisor"
+ result = "libvirt domain " + domainName + " could not be found on any hypervisor\n"
log.Info(result)
fmt.Fprintln(w, result)
return result, errors.New(result)
@@ -38,10 +39,16 @@ func importDomain(w http.ResponseWriter, r *http.Request) (string, error) {
// if it's not local only, don't attempt this for now
if d.LocalOnly == "" {
- result = "LocalOnly is blank. SKIP. merge not supported yet."
- log.Log(WARN, result)
- fmt.Fprintln(w, result)
- return result, errors.New(result)
+ if force == "true" {
+ result = "LocalOnly is blank. force=true. PROCEEDING WITH DANGER\n"
+ log.Warn(result)
+ fmt.Fprint(w, result)
+ } else {
+ result = "LocalOnly is blank. SKIP. merge not supported yet. force=" + force
+ log.Log(WARN, result)
+ fmt.Fprintln(w, result)
+ return result, errors.New(result)
+ }
}
/*