Add basic Make

This commit is contained in:
Stefan Reimer 2022-05-13 17:55:01 +02:00
parent e550ac0e0d
commit d6a962cb39
2 changed files with 11 additions and 3 deletions

9
Makefile Normal file
View File

@ -0,0 +1,9 @@
all: build
.PHONY: fmt
fmt: ## Run go fmt against code.
go fmt ./...
.PHONY: build
build: fmt
go build -ldflags "-s -w" -o build/etcdhelper etcdhelper.go

View File

@ -259,8 +259,8 @@ func changeProviderId(client *clientv3.Client, nodeName, providerId string) erro
fmt.Printf("get key %s %s\n", nodeKey, err)
}
obj, _, _ := decoder.Decode(resp.Kvs[0].Value, nil, nil)
node := obj.(*v1.Node)
obj, _, _ := decoder.Decode(resp.Kvs[0].Value, nil, nil)
node := obj.(*v1.Node)
if node.Name == nodeName {
fmt.Printf("%s %s > %s\n", nodeKey, node.Spec.ProviderID, providerId)
@ -277,7 +277,6 @@ func changeProviderId(client *clientv3.Client, nodeName, providerId string) erro
}
}
return nil
}