Skip to content

Commit

Permalink
Merge pull request #91 from humblec/e2e-1
Browse files Browse the repository at this point in the history
Fix CVEs, add Make targets, update linters
  • Loading branch information
k8s-ci-robot authored Jan 25, 2022
2 parents 81d283f + 1dca926 commit d2ac659
Show file tree
Hide file tree
Showing 12 changed files with 89 additions and 15 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# GitHub Action to automate the identification of common misspellings in text files.
# https://github.com/codespell-project/actions-codespell
# https://github.com/codespell-project/codespell
name: codespell
on: [push, pull_request]
jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: codespell-project/actions-codespell@master
with:
check_filenames: true
skip: ./.git,./.github/workflows/codespell.yml,.git,*.png,*.jpg,*.svg,*.sum,./vendor,go.sum,./release-tools/prow.sh,./pkg/lib/iscsi/
ignore_words_list: "lun,targetportal"
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: golangci/golangci-lint-action@v2
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.42
version: v1.43

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/shellcheck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: ShellCheck
on:
push:
tags:
- v*
branches:
- master
- release-*
pull_request:
branches:
- master
- release-*

jobs:
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
env:
SHELLCHECK_OPTS: -e SC2034
with:
severity: warning
check_together: 'yes'
disable_matcher: false
ignore_paths: vendor release-tools hack
format: gcc
3 changes: 2 additions & 1 deletion .prow.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#! /bin/bash -e

# Copyright 2021 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -12,7 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

#! /bin/bash -e

# A Prow job can override these defaults, but this shouldn't be necessary.

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM k8s.gcr.io/build-image/debian-base:bullseye-v1.0.0
FROM k8s.gcr.io/build-image/debian-base:bullseye-v1.1.0

RUN apt update && apt-mark unhold libcap2
RUN clean-install ca-certificates mount
# install updated packages to fix CVE issues
RUN clean-install libssl1.1 libgssapi-krb5-2 libk5crypto3 libkrb5-3 libkrb5support0 libgmp10
RUN clean-install libssl1.1 libgssapi-krb5-2 libk5crypto3 libkrb5-3 libkrb5support0 libgmp10 bsdutils

# Copy iscsiplugin.sh
COPY iscsiplugin.sh /iscsiplugin.sh
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,11 @@ container:
sanity-test:
make
./test/sanity/run-test.sh
.PHONY: mod-check
mod-check:
go mod verify && [ "$(shell sha512sum go.mod)" = "`sha512sum go.mod`" ] || ( echo "ERROR: go.mod was modified by 'go mod verify'" && false )

.PHONY: clean
clean:
go clean -mod=vendor -r -x
rm -f bin/iscsiplugin
6 changes: 3 additions & 3 deletions iscsiplugin.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#! /bin/bash -x

# Copyright 2021 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -12,8 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

#! /bin/bash -x

# Update initiatorname with ${iSCSI_INITIATOR_NAME} and start iscsid, if it is defined
if [ -n "${iSCSI_INITIATOR_NAME}" ]; then
echo "InitiatorName=${iSCSI_INITIATOR_NAME}" > /etc/iscsi/initiatorname.iscsi
Expand All @@ -22,4 +22,4 @@ if [ -n "${iSCSI_INITIATOR_NAME}" ]; then
fi

# Start iscsiplugin
./iscsiplugin $*
./iscsiplugin "$*"
1 change: 0 additions & 1 deletion pkg/iscsi/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,4 @@ func (d *driver) AddControllerServiceCapabilities(cl []csi.ControllerServiceCapa
}

d.cscap = csc

}
5 changes: 2 additions & 3 deletions pkg/lib/iscsi/iscsi/multipath.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type path struct {
Device string `json:"dev"`
}

// ExecWithTimeout execute a command with a timeout and returns an error if timeout is excedeed
// ExecWithTimeout execute a command with a timeout and returns an error if timeout is exceeded
func ExecWithTimeout(command string, args []string, timeout time.Duration) ([]byte, error) {
debug.Printf("Executing command '%v' with args: '%v'.\n", command, args)

Expand Down Expand Up @@ -58,7 +58,6 @@ func FlushMultipathDevice(device *Device) error {

timeout := 5 * time.Second
_, err := execWithTimeout("multipath", []string{"-f", devicePath}, timeout)

if err != nil {
if _, e := osStat(devicePath); os.IsNotExist(e) {
debug.Printf("Multipath device %v has been removed.\n", devicePath)
Expand All @@ -71,7 +70,7 @@ func FlushMultipathDevice(device *Device) error {
}
}

debug.Printf("Finshed flushing multipath device %v.\n", devicePath)
debug.Printf("Finished flushing multipath device %v.\n", devicePath)
return nil
}

Expand Down
23 changes: 23 additions & 0 deletions release-tools/SIDECAR_RELEASE_PROCESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,29 @@ naming convention `<hostpath-deployment-version>-on-<kubernetes-version>`.
and [k/k
in-tree](https://github.com/kubernetes/kubernetes/tree/HEAD/test/e2e/testing-manifests/storage-csi/hostpath/hostpath)

### Troubleshooting

#### Image build jobs

The following jobs are triggered after tagging to produce the corresponding
image(s):
https://k8s-testgrid.appspot.com/sig-storage-image-build

Clicking on a failed build job opens that job in https://prow.k8s.io. Next to
the job title is a rerun icon (circle with arrow). Clicking it opens a popup
with a "rerun" button that maintainers with enough permissions can use. If in
doubt, ask someone on #sig-release to rerun the job.

Another way to rerun a job is to search for it in https://prow.k8s.io and click
the rerun icon in the resulting job list:
https://prow.k8s.io/?job=canary-csi-test-push-images

#### Verify images

Canary and staged images can be viewed at https://console.cloud.google.com/gcr/images/k8s-staging-sig-storage

Promoted images can be viewed at https://console.cloud.google.com/gcr/images/k8s-artifacts-prod/us/sig-storage

## Adding support for a new Kubernetes release

1. Add the new release to `k8s_versions` in
Expand Down
2 changes: 1 addition & 1 deletion release-tools/prow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ install_csi_driver () {
fi
}

# Installs all nessesary snapshotter CRDs
# Installs all necessary snapshotter CRDs
install_snapshot_crds() {
# Wait until volumesnapshot CRDs are in place.
CRD_BASE_DIR="https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/${CSI_SNAPSHOTTER_VERSION}/client/config/crd"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d2ac659

Please sign in to comment.