1
0
mirror of https://github.com/Oxalide/vsphere-influxdb-go.git synced 2023-10-10 11:36:51 +00:00

Compare commits

...

4 Commits

Author SHA1 Message Date
Andy Cobaugh
dac91ccd2d
Use url.UserPassword() so passwords are escaped (#101)
* add Dockerfile

* dockerfile: switch to multi-stage build to lighten up the final image

* dockerfile: update to latest images, and update the 2nd stage image on build

* Use url.UserPassword() so passwords are escaped
2020-04-01 14:15:04 +02:00
Andy Cobaugh
88b072f48e Add Dockerfile to project (#98)
* add Dockerfile

* dockerfile: switch to multi-stage build to lighten up the final image

* dockerfile: update to latest images, and update the 2nd stage image on build
2019-07-19 18:24:31 +02:00
Adrian Todorov
dc6df54936
Merge pull request #96 from MicKBfr/patch-2
change for RemoveHostDomainName
2019-03-14 15:52:36 +01:00
MicKBfr
e92e578a98
change for RemoveHostDomainName 2018-10-26 11:28:18 +02:00
3 changed files with 21 additions and 1 deletions

18
Dockerfile Normal file
View File

@ -0,0 +1,18 @@
FROM golang:1.12-alpine3.10 as builder
WORKDIR /go/src/vsphere-influxdb-go
COPY . .
RUN apk --update add --virtual build-deps git
RUN go get -d -v ./...
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo
FROM alpine:3.10
RUN apk update \
&& apk upgrade \
&& apk add ca-certificates \
&& addgroup -S spock && adduser -S spock -G spock
COPY --from=0 /go/src/vsphere-influxdb-go/vsphere-influxdb-go /vsphere-influxdb-go
USER spock
CMD ["/vsphere-influxdb-go"]

View File

@ -110,7 +110,8 @@ func (vcenter *VCenter) Connect() error {
defer cancel() defer cancel()
stdlog.Println("Connecting to vcenter:", vcenter.Hostname) stdlog.Println("Connecting to vcenter:", vcenter.Hostname)
u, err := url.Parse("https://" + vcenter.Username + ":" + vcenter.Password + "@" + vcenter.Hostname + "/sdk") u, err := url.Parse("https://" + vcenter.Hostname + "/sdk")
u.User = url.UserPassword(vcenter.Username, vcenter.Password)
if err != nil { if err != nil {
errlog.Println("Could not parse vcenter url:", vcenter.Hostname) errlog.Println("Could not parse vcenter url:", vcenter.Hostname)
errlog.Println("Error:", err) errlog.Println("Error:", err)

View File

@ -1,5 +1,6 @@
{ {
"Domain": ".lab", "Domain": ".lab",
"RemoveHostDomainName": false,
"Interval": 60, "Interval": 60,
"VCenters": [ "VCenters": [
{ "Username": "monitoring", "Password": "monixx", "Hostname": "vcenter-01.dc-01.lab" }, { "Username": "monitoring", "Password": "monixx", "Hostname": "vcenter-01.dc-01.lab" },