Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into laverya/redactor-re…
Browse files Browse the repository at this point in the history
…format
  • Loading branch information
laverya committed Jun 15, 2020
2 parents e66d12d + d98172e commit afd2ee9
Show file tree
Hide file tree
Showing 45 changed files with 1,379 additions and 761 deletions.
37 changes: 36 additions & 1 deletion .github/workflows/build-test-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,42 @@ jobs:
path: bin/
- uses: engineerd/[email protected]
- run: chmod +x bin/preflight
- run: bin/preflight --interactive=false --format=json https://preflight.replicated.com
- run: ./bin/preflight --interactive=false --format=json https://preflight.replicated.com

compile-supportbundle:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/setup-go@v1
with:
go-version: '1.14'
- name: setup env
run: |
echo "::set-env name=GOPATH::$(go env GOPATH)"
echo "::add-path::$(go env GOPATH)/bin"
shell: bash
- uses: actions/checkout@master
- run: make support-bundle
- uses: actions/upload-artifact@v1
with:
name: support-bundle
path: bin/support-bundle

validate-supportbundle:
runs-on: ubuntu-latest
needs: compile-supportbundle
steps:
- uses: actions/checkout@v1
- name: Download support-bundle binary
uses: actions/download-artifact@v1
with:
name: support-bundle
path: bin/
- uses: engineerd/[email protected]
- run: chmod +x bin/support-bundle
- run: ./bin/support-bundle ./examples/troubleshoot/sample-collectors.yaml
- run: ./bin/support-bundle ./examples/troubleshoot/sample-supportbundle.yaml
- run: ./bin/support-bundle https://kots.io

goreleaser:
runs-on: ubuntu-latest
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ vet:

.PHONY: generate
generate: controller-gen client-gen
$(shell go env GOPATH)/bin/controller-gen object:headerFile=./hack/boilerplate.go.txt paths=./pkg/apis/...
$(shell go env GOPATH)/bin/client-gen \
$(CONTROLLER_GEN) \
object:headerFile=./hack/boilerplate.go.txt paths=./pkg/apis/...
$(CLIENT_GEN) \
--output-package=github.com/replicatedhq/troubleshoot/pkg/client \
--clientset-name troubleshootclientset \
--input-base github.com/replicatedhq/troubleshoot/pkg/apis \
Expand All @@ -84,8 +85,7 @@ schemas: fmt vet openapischema
go build ${LDFLAGS} -o bin/schemagen github.com/replicatedhq/troubleshoot/cmd/schemagen
./bin/schemagen --output-dir ./schemas

# find or download controller-gen
# download controller-gen if necessary
.PHONY: contoller-gen
controller-gen:
ifeq (, $(shell which controller-gen))
go get sigs.k8s.io/controller-tools/cmd/[email protected]
Expand All @@ -94,10 +94,10 @@ else
CONTROLLER_GEN=$(shell which controller-gen)
endif

# find or download client-gen
.PHONY: client-gen
client-gen:
ifeq (, $(shell which client-gen))
go get k8s.io/code-generator/cmd/client-gen@kubernetes-1.16.4
go get k8s.io/code-generator/cmd/client-gen@kubernetes-1.18.0
CLIENT_GEN=$(shell go env GOPATH)/bin/client-gen
else
CLIENT_GEN=$(shell which client-gen)
Expand Down Expand Up @@ -128,7 +128,7 @@ run-preflight: preflight

.PHONY: run-troubleshoot
run-troubleshoot: support-bundle
./bin/support-bundle ./examples/troubleshoot/sample-troubleshoot.yaml
./bin/support-bundle ./examples/troubleshoot/sample-supportbundle.yaml

.PHONY: run-analyze
run-analyze: analyze
Expand Down
5 changes: 0 additions & 5 deletions cmd/preflight/cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,10 @@ that a cluster meets the requirements to run an application.`,

cmd.Flags().Bool("interactive", true, "interactive preflights")
cmd.Flags().String("format", "human", "output format, one of human, json, yaml. only used when interactive is set to false")
cmd.Flags().String("preflight", "", "name of the preflight to use")
cmd.Flags().String("image", "", "the full name of the preflight image to use")
cmd.Flags().String("pullpolicy", "", "the pull policy of the preflight image")
cmd.Flags().String("collector-image", "", "the full name of the collector image to use")
cmd.Flags().String("collector-pullpolicy", "", "the pull policy of the collector image")
cmd.Flags().Bool("collect-without-permissions", false, "always run preflight checks even if some require permissions that preflight does not have")

cmd.Flags().String("serviceaccount", "", "name of the service account to use. if not provided, one will be created")

viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_"))

KubernetesConfigFlags = genericclioptions.NewConfigFlags(false)
Expand Down
151 changes: 0 additions & 151 deletions cmd/preflight/cli/serviceaccount.go

This file was deleted.

Loading

0 comments on commit afd2ee9

Please sign in to comment.