Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump go version and dependencies #53

Merged
merged 6 commits into from
Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO_VERSION: '1.16'
GO_VERSION: '1.18'
INTEGRATION: "discovery-kubernetes"
ORIGINAL_REPO_NAME: 'newrelic/nri-discovery-kubernetes'
REPO_FULL_NAME: ${{ github.event.repository.full_name }}
Expand Down
17 changes: 1 addition & 16 deletions .github/workflows/push_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
TAG: "v0.0.0" # needed for goreleaser windows builds
REPO_FULL_NAME: ${{ github.event.repository.full_name }}
ORIGINAL_REPO_NAME: "newrelic/nri-discovery-kubernetes"
GO_VERSION: '1.16'
GO_VERSION: '1.18'

jobs:
static-analysis:
Expand All @@ -30,21 +30,6 @@ jobs:
with:
only-new-issues: true

snyk:
name: Run security checks via snyk
runs-on: ubuntu-20.04
env:
SNYK_TOKEN: ${{ secrets.COREINT_SNYK_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.OHAI_DOCKER_HUB_ID }}
password: ${{ secrets.OHAI_DOCKER_HUB_PASSWORD }}
- name: Scan code for vulnerabilities
run: make ci/snyk-test

test-nix:
name: Run unit tests on *Nix
runs-on: ubuntu-20.04
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
- cron: "0 3 * * *"

jobs:
# Note: Snyk SaaS is already configured for this repository, which does not need a workflow to run
trivy:
name: Trivy security scan
runs-on: ubuntu-latest
Expand All @@ -25,15 +24,15 @@ jobs:
scan-type: fs
ignore-unfixed: true
exit-code: 1
severity: 'HIGH,CRITICAL'
severity: 'CRITICAL'

- name: Run Trivy vulnerability scanner sarif output
uses: aquasecurity/trivy-action@master
if: ${{ github.event.schedule }} # Generate sarif when running periodically
with:
scan-type: fs
ignore-unfixed: true
severity: 'HIGH,CRITICAL'
severity: 'CRITICAL'
format: 'template'
template: '@/contrib/sarif.tpl'
output: 'trivy-results.sarif'
Expand Down
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,38 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## 1.4.1
marcsanmi marked this conversation as resolved.
Show resolved Hide resolved
### Changed
- Bump go version and dependencies

## 1.4.0
### Changed
- Update Kubernetes Go dependencies to latest versions

## 1.3.1
### Changed
- CI/CD pipeline migrated to GitHub Actions

## 1.3.0
### Changelog

- Docs update
- Check if command line args were provided
- Add Open Source Policy Workflow (#11)
- Close request body
- Added auto-detection for kubelet client config by using --auto_config cmd line arg
- b226a2f trigger pipeline
- Update linter version


## 1.2.0
### Changelog

- Filter non-running containers
- Update gcp.yaml.template
- Update minikube.yaml
- Fixed failing test

## 1.1.0
### Changed
- Optional `insecure` flag has been deprecated in favor of `tls`
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.16-alpine AS build
FROM golang:1.18-alpine AS build
RUN apk add --no-cache --update git make

WORKDIR /go/src/github.com/newrelic/nri-discovery-kubernetes
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.release
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM alpine:3.13
FROM alpine:3.16

RUN apk add --no-cache --upgrade ca-certificates

USER nobody
COPY nri-discovery-kubernetes /bin/nri-discovery-kubernetes

ENTRYPOINT ["/bin/nri-discovery-kubernetes"]
ENTRYPOINT ["/bin/nri-discovery-kubernetes"]
10 changes: 1 addition & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,8 @@ ifneq ("$(GOARCH)" "$(NATIVEARCH)")
endif
endif

snyk: deps-only
@echo "=== $(PROJECT) === [ snyk ]: Running snyk..."
@snyk test --file=go.mod --org=ohai

snyk/monitor: deps-only
@echo "=== $(PROJECT) === [ snyk/monitor ]: Running snyk..."
@snyk monitor --file=go.mod --org=ohai

# Include thematic Makefiles
include $(CURDIR)/build/ci.mk
include $(CURDIR)/build/release.mk

.PHONY: all fmt build clean tools tools-update deps deps-only validate compile compile-only test check-version tools-golangci-lint docker-build release release/deps release/test snyk snyk/monitor docker-release
.PHONY: all fmt build clean tools tools-update deps deps-only validate compile compile-only test check-version tools-golangci-lint docker-build release release/deps release/test docker-release
2 changes: 1 addition & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.16-buster
FROM golang:1.18-buster

ARG GH_VERSION='1.10.3'

Expand Down
11 changes: 1 addition & 10 deletions build/ci.mk
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,6 @@ ci/test: ci/deps
-w /go/src/github.com/newrelic/nri-$(INTEGRATION) \
$(BUILDER_TAG) make test

.PHONY : ci/snyk-test
ci/snyk-test:
@docker run --rm -t \
--name "nri-$(INTEGRATION)-snyk-test" \
-v $(CURDIR):/go/src/github.com/newrelic/nri-$(INTEGRATION) \
-w /go/src/github.com/newrelic/nri-$(INTEGRATION) \
-e SNYK_TOKEN \
snyk/snyk:golang snyk test --severity-threshold=high

.PHONY : ci/build
ci/build: ci/deps
ifdef TAG
Expand Down Expand Up @@ -78,4 +69,4 @@ ifdef TAG
else
@echo "===> $(INTEGRATION) === [ci/prerelease] TAG env variable expected to be set"
exit 1
endif
endif
74 changes: 66 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,16 +1,74 @@
module github.com/newrelic/nri-discovery-kubernetes

go 1.13
go 1.18

require (
github.com/newrelic/nri-kubernetes/v2 v2.8.0
github.com/sirupsen/logrus v1.8.1
github.com/sirupsen/logrus v1.9.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.8.1
github.com/stretchr/testify v1.7.0
k8s.io/api v0.22.0
k8s.io/apimachinery v0.22.0
k8s.io/client-go v0.22.0
github.com/spf13/viper v1.12.0
github.com/stretchr/testify v1.8.0
k8s.io/api v0.24.3
k8s.io/apimachinery v0.24.3
k8s.io/client-go v0.24.3
)

replace github.com/pkg/sftp => github.com/pkg/sftp v1.13.2
require (
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful v2.9.5+incompatible // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/go-logr/logr v1.2.0 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/imdario/mergo v0.3.8 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/newrelic/infra-integrations-sdk v2.0.1-0.20180410150501-14a5386f9150+incompatible // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.26.0 // indirect
github.com/prometheus/prom2json v1.3.0 // indirect
github.com/segmentio/go-camelcase v0.0.0-20160726192923-7085f1e3c734 // indirect
github.com/spf13/afero v1.9.2 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/stretchr/objx v0.4.0 // indirect
github.com/subosito/gotenv v1.4.0 // indirect
golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 // indirect
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect
golang.org/x/sys v0.0.0-20220731174439-a90be440212d // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.66.6 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.60.1 // indirect
k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect
k8s.io/kubelet v0.22.0 // indirect
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
)