-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.go
More file actions
35 lines (26 loc) · 741 Bytes
/
main.go
File metadata and controls
35 lines (26 loc) · 741 Bytes
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
package main
import (
"errors"
"fmt"
"os"
"strconv"
"sync"
"github.com/rancher/kontainer-engine/types"
"github.com/sirupsen/logrus"
"github.com/opentelekomcloud/kontainer-engine-driver-otc/opentelekomcloud"
)
var wg = &sync.WaitGroup{}
func main() {
if os.Args[1] == "" {
panic(errors.New("no port provided"))
}
port, err := strconv.Atoi(os.Args[1])
if err != nil {
panic(fmt.Errorf("argument not parsable as int: %v", err))
}
addr := make(chan string)
go types.NewServer(opentelekomcloud.NewDriver(), addr).ServeOrDie(fmt.Sprintf("127.0.0.1:%v", port))
logrus.Infof("OpenTelekomCloud CCE driver up and running on at %v", <-addr)
wg.Add(1)
wg.Wait() // wait forever, we only exit if killed by parent process
}