Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
e157b6b
update to Go 1.12.4
pohly Apr 15, 2019
d334873
Merge commit 'e157b6b514ace191f46d4c879491cb7d11684659' into release-…
pohly Apr 15, 2019
8cf42d4
Add PR template
jsafrane Apr 15, 2019
0bee749
Merge pull request #18 from pohly/go-version
k8s-ci-robot Apr 15, 2019
9d1ae1e
Merge pull request #40 from jsafrane/add-pr-template
k8s-ci-robot Apr 15, 2019
19865be
Merge pull request #39 from pohly/release-tools
k8s-ci-robot Apr 15, 2019
066143d
build.make: allow repos to use 'go mod' for vendoring
pohly May 10, 2019
0399988
Merge pull request #19 from pohly/go-mod-vendor
k8s-ci-robot May 13, 2019
7d2c04f
Correct repository name of driver-registrar
zhangxiaoyu-zidif Jun 17, 2019
b2f4e05
prow.sh: flexible test driver config
pohly Jul 8, 2019
db8abb6
Merge pull request #20 from pohly/test-driver-config
k8s-ci-robot Jul 8, 2019
a6f21d4
Add variables for 1.15
msau42 Jul 11, 2019
ecc7918
Update kind to v0.4.0. This requires overriding Kubernetes versions
msau42 Jul 11, 2019
4b6fa4a
Update hostpath version for sidecar testing to v1.2.0-rc2
msau42 Jul 11, 2019
4e31f07
Change default hostpath driver name to hostpath.csi.k8s.io
msau42 Jul 12, 2019
f4f73ce
Merge pull request #21 from msau42/add-1.15-jobs
k8s-ci-robot Jul 12, 2019
347a6ab
release-tools: support Kubernetes 1.15
pohly Jul 12, 2019
0a2ca43
Merge pull request #43 from pohly/prow-update
k8s-ci-robot Jul 12, 2019
0c0dc30
prow.sh: tag master images with a large version number
msau42 Jul 15, 2019
1cac3af
Merge pull request #22 from msau42/add-1.15-jobs
k8s-ci-robot Jul 16, 2019
d9613c8
release-tools: update
pohly Jul 16, 2019
344dd64
Merge pull request #44 from pohly/prow-update-master
k8s-ci-robot Jul 16, 2019
f46191d
Kubernetes master changed the way that releases are tagged, which needed
msau42 Aug 5, 2019
aa85b82
Merge pull request #23 from msau42/fix-master-jobs
k8s-ci-robot Aug 9, 2019
526425d
release-tools: update
msau42 Aug 9, 2019
6f509a1
Merge pull request #46 from msau42/prow-update-master
k8s-ci-robot Aug 12, 2019
dc0a5d8
Update kind to v0.5.0
msau42 Aug 21, 2019
0400867
Merge pull request #25 from msau42/fix-master-jobs
k8s-ci-robot Aug 27, 2019
216c2aa
Build Node Driver Registrar for Windows nodes
ddebroy Aug 14, 2019
9fba09b
Add rule for building Windows binaries
ddebroy Aug 28, 2019
f85ab5a
Merge pull request #26 from ddebroy/windows1
k8s-ci-robot Aug 28, 2019
35ceaed
prow.sh: install dep if needed
pohly Aug 29, 2019
df8530d
Merge pull request #27 from pohly/dep-vendor-check
k8s-ci-robot Aug 29, 2019
27b5d2c
Merge pull request #42 from zhangxiaoyu-zidif/patch-1
k8s-ci-robot Sep 5, 2019
21825d3
Merge pull request #47 from ddebroy/windows1
k8s-ci-robot Sep 5, 2019
43feac1
add 1.2 changelog
msau42 Sep 6, 2019
a8ea8bc
create 2-node kind cluster since topology support is added to hostpat…
mucahitkurt Sep 6, 2019
2d33550
Merge pull request #29 from mucahitkurt/create-2-node-kind-cluster
k8s-ci-robot Sep 7, 2019
ea2f1b5
build windows binaries with .exe suffix
msau42 Sep 7, 2019
6ecaa76
Merge pull request #30 from msau42/fix-windows
k8s-ci-robot Sep 7, 2019
183a86e
Merge commit '6ecaa76eb94a5b30907fccdccbd678e53887298d' into prow-upd…
msau42 Sep 7, 2019
5912d2b
Merge pull request #50 from msau42/prow-update-master
k8s-ci-robot Sep 9, 2019
6ef000a
Merge pull request #49 from msau42/changelog
k8s-ci-robot Sep 9, 2019
542099d
Merge tag 'v1.2.0' into rebase-1.2.0
jsafrane Oct 15, 2019
698e21d
UPSTREAM: <carry>: Use golang 1.12 for OpenShift images
jsafrane Oct 15, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!-- Thanks for sending a pull request! Here are some tips for you:

1. If this is your first time, please read our contributor guidelines: https://git.k8s.io/community/contributors/guide#your-first-contribution and developer guide https://git.k8s.io/community/contributors/devel/development.md#development-guide
2. Follow the instructions for writing a release note: https://git.k8s.io/community/contributors/guide/release-notes.md
3. If the PR is unfinished, see how to mark it: https://git.k8s.io/community/contributors/guide/pull-requests.md#marking-unfinished-pull-requests
-->

**What type of PR is this?**
> Uncomment only one ` /kind <>` line, hit enter to put that in a new line, and remove leading whitespaces from that line:
>
> /kind api-change
> /kind bug
> /kind cleanup
> /kind design
> /kind documentation
> /kind failing-test
> /kind feature
> /kind flake

**What this PR does / why we need it**:

**Which issue(s) this PR fixes**:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
_If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_*
-->
Fixes #

**Special notes for your reviewer**:

**Does this PR introduce a user-facing change?**:
<!--
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->
```release-note

```
7 changes: 7 additions & 0 deletions CHANGELOG-1.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog since v1.1.0

## New Features

- Support Node Driver Registrar on Windows nodes. Note Windows container images are not published and need to be manually built. ([#47](https://github.com/kubernetes-csi/node-driver-registrar/pull/47), [@ddebroy](https://github.com/ddebroy))


9 changes: 9 additions & 0 deletions Dockerfile.Windows
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM mcr.microsoft.com/windows/servercore:1809 as core

FROM mcr.microsoft.com/windows/nanoserver:1809
LABEL description="CSI Node driver registrar"

COPY ./bin/csi-node-driver-registrar.exe /csi-node-driver-registrar.exe
COPY --from=core /Windows/System32/netapi32.dll /Windows/System32/netapi32.dll
USER ContainerAdministrator
ENTRYPOINT ["/csi-node-driver-registrar.exe"]
2 changes: 1 addition & 1 deletion Dockerfile.openshift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.svc.ci.openshift.org/openshift/release:golang-1.11 AS builder
FROM registry.svc.ci.openshift.org/openshift/release:golang-1.12 AS builder
WORKDIR /go/src/github.com/kubernetes-csi/node-driver-registrar
COPY . .
RUN make build
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.openshift.rhel7
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.svc.ci.openshift.org/ocp/builder:golang-1.11 AS builder
FROM registry.svc.ci.openshift.org/ocp/builder:golang-1.12 AS builder
WORKDIR /go/src/github.com/kubernetes-csi/node-driver-registrar
COPY . .
RUN make build
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This information reflects the head of this branch.
| ------------------------------------------------------------------------------------------ | ----------------------------------------------- | --------------- |
| [CSI Spec v1.0.0](https://github.com/container-storage-interface/spec/releases/tag/v1.0.0) | quay.io/k8scsi/csi-node-driver-registrar | 1.13 |

For release-0.4 and below, please refer to the [node-registrar
For release-0.4 and below, please refer to the [driver-registrar
repository](https://github.com/kubernetes-csi/driver-registrar).

## Usage
Expand Down
14 changes: 10 additions & 4 deletions cmd/csi-node-driver-registrar/node_register.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import (
"fmt"
"net"
"os"
"runtime"

"google.golang.org/grpc"

"golang.org/x/sys/unix"
"k8s.io/klog"
registerapi "k8s.io/kubernetes/pkg/kubelet/apis/pluginregistration/v1alpha1"
)
Expand All @@ -48,16 +48,22 @@ func nodeRegister(
klog.Errorf("failed to stat the socket %s with error: %+v", socketPath, err)
os.Exit(1)
}
// Default to only user accessible socket, caller can open up later if desired
oldmask := unix.Umask(0077)

var oldmask int
if runtime.GOOS == "linux" {
// Default to only user accessible socket, caller can open up later if desired
oldmask, _ = umask(0077)
}

klog.Infof("Starting Registration Server at: %s\n", socketPath)
lis, err := net.Listen("unix", socketPath)
if err != nil {
klog.Errorf("failed to listen on socket: %s with error: %+v", socketPath, err)
os.Exit(1)
}
unix.Umask(oldmask)
if runtime.GOOS == "linux" {
umask(oldmask)
}
klog.Infof("Registration Server started at: %s\n", socketPath)
grpcServer := grpc.NewServer()
// Registers kubelet plugin watcher api.
Expand Down
27 changes: 27 additions & 0 deletions cmd/csi-node-driver-registrar/util_linux.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// +build linux

/*
Copyright 2019 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package main

import (
"golang.org/x/sys/unix"
)

func umask(mask int) (int, error) {
return unix.Umask(mask), nil
}
27 changes: 27 additions & 0 deletions cmd/csi-node-driver-registrar/util_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// +build windows

/*
Copyright 2019 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package main

import (
"errors"
)

func umask(mask int) (int, error) {
return -1, errors.New("umask not supported in Windows")
}
34 changes: 30 additions & 4 deletions release-tools/build.make
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ endif
build-%:
mkdir -p bin
CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-X main.version=$(REV) -extldflags "-static"' -o ./bin/$* ./cmd/$*
CGO_ENABLED=0 GOOS=windows go build -a -ldflags '-X main.version=$(REV) -extldflags "-static"' -o ./bin/$*.exe ./cmd/$*

container-%: build-%
docker build -t $*:latest -f $(shell if [ -e ./cmd/$*/Dockerfile ]; then echo ./cmd/$*/Dockerfile; else echo Dockerfile; fi) --label revision=$(REV) .
Expand Down Expand Up @@ -118,14 +119,39 @@ test-fmt:
fi

# This test only runs when dep >= 0.5 is installed, which is the case for the CI setup.
# When using 'go mod', we allow the test to be skipped in the Prow CI under some special
# circumstances, because it depends on accessing all remote repos and thus
# running it all the time would defeat the purpose of vendoring:
# - not handling a PR or
# - the fabricated merge commit leaves go.mod, go.sum and vendor dir unchanged
# - release-tools also didn't change (changing rules or Go version might lead to
# a different result and thus must be tested)
.PHONY: test-vendor
test: test-vendor
test-vendor:
@ echo; echo "### $@:"
@ case "$$(dep version 2>/dev/null | grep 'version *:')" in \
*v0.[56789]*) dep check && echo "vendor up-to-date" || false;; \
*) echo "skipping check, dep >= 0.5 required";; \
esac
@ if [ -f Gopkg.toml ]; then \
echo "Repo uses 'dep' for vendoring."; \
case "$$(dep version 2>/dev/null | grep 'version *:')" in \
*v0.[56789]*) dep check && echo "vendor up-to-date" || false;; \
*) echo "skipping check, dep >= 0.5 required";; \
esac; \
else \
echo "Repo uses 'go mod' for vendoring."; \
if [ "$${JOB_NAME}" ] && \
( [ "$${JOB_TYPE}" != "presubmit" ] || \
[ $$(git diff "${PULL_BASE_SHA}..HEAD" -- go.mod go.sum vendor release-tools | wc -l) -eq 0 ] ); then \
echo "Skipping vendor check because the Prow pre-submit job does not change vendoring."; \
elif ! GO111MODULE=on go mod vendor; then \
echo "ERROR: vendor check failed."; \
false; \
elif [ $$(git status --porcelain -- vendor | wc -l) -gt 0 ]; then \
echo "ERROR: vendor directory *not* up-to-date, it did get modified by 'GO111MODULE=on go mod vendor':"; \
git status -- vendor; \
git diff -- vendor; \
false; \
fi; \
fi;

.PHONY: test-subtree
test: test-subtree
Expand Down
Loading