Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
173 changes: 85 additions & 88 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,11 @@
## DO NOT EDIT - Managed by Terraform
version: 2.1

orbs:
rok8s: fairwinds/rok8s-scripts@14
rok8s: fairwinds/rok8s-scripts@16.0.0
oss-docs: fairwinds/oss-docs@0

executors:
golang-exec:
docker:
- image: cimg/go:1.26.5

references:
e2e_config: &e2e_config
command_runner_image: quay.io/reactiveops/ci-images:v14-bullseye
kind_node_image: "kindest/node:v1.26.6@sha256:6e2d8b28a5b601defe327b98bd1c2d1930b49e5d8c512e1895099e4504007adb"
executor: golang-exec
pre_script: e2e/pre.sh
store-test-results: /tmp/test-results/
script: e2e/test.sh
requires:
- test
filters:
branches:
only: /.*/
tags:
ignore: /.*/
install_vault_alpine: &install_vault_alpine
run:
name: install hashicorp vault
command: |
apk --update add curl yq
cd /tmp
curl -LO https://releases.hashicorp.com/vault/1.21.4/vault_1.21.4_linux_amd64.zip
sha256sum vault_1.21.4_linux_amd64.zip | grep 889b681990fe221b884b7932fa9c9dd0ee9811b9349554f1aa287ab63c9f3dae
unzip vault_1.21.4_linux_amd64.zip
mv vault /usr/bin/vault
install_vault_machine: &install_vault_machine
run:
name: install hashicorp vault
Expand All @@ -52,45 +24,48 @@ references:
sudo apt-get install -y qemu-user-static binfmt-support
docker buildx create --use || true
docker buildx inspect --bootstrap
e2e_configuration: &e2e_configuration
executor: golang-exec
pre_script: e2e/pre.sh
script: e2e/test.sh
command_runner_image: quay.io/reactiveops/ci-images:v14.1-bullseye
enable_docker_layer_caching: true
store-test-results: /tmp/test-results
requires:
- test
filters:
branches:
only: /.*/
tags:
ignore: /.*/

executors:
golang-exec:
docker:
- image: cimg/go:1.26.7

jobs:
test:
working_directory: /home/circleci/go/src/github.com/fairwindsops/pluto
docker:
- image: cimg/go:1.26.5
- image: cimg/go:1.26.7
steps:
- checkout
- run: go mod download && go mod verify
- run: go test -v ./... -coverprofile=coverage.txt -covermode=atomic
release:
machine:
image: ubuntu-2204:current
resource_class: large
shell: /bin/bash
steps:
- checkout
- *install_vault_machine
- rok8s/get_vault_env:
vault_path: repo/global/env
- rok8s/get_vault_env:
vault_path: repo/pluto/env
- run:
name: docker login
name: Go Mod Download
command: go mod download && go mod verify
- run:
name: golangci-lint
command: |
docker login -u _json_key -p "$(echo $GCP_ARTIFACTREADWRITE_JSON_KEY | base64 -d)" us-docker.pkg.dev
- *setup_qemu_binfmt
curl -fsSL -o golangci-lint.tar.gz https://github.com/golangci/golangci-lint/releases/download/v2.12.2/golangci-lint-2.12.2-linux-amd64.tar.gz
echo '8df580d2670fed8fa984aac0507099af8df275e665215f5c7a2ae3943893a553 golangci-lint.tar.gz' | sha256sum -c
tar -xzf golangci-lint.tar.gz
mv golangci-lint-2.12.2-linux-amd64/golangci-lint "$(go env GOPATH)/bin/golangci-lint"
golangci-lint run --timeout 5m
- run:
name: Run GoReleaser release
name: test
command: |
export GORELEASER_CURRENT_TAG="${CIRCLE_TAG}"
docker run --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
-v "$(pwd):/workspace" -w /workspace \
-v "${HOME}/.docker:/root/.docker" \
-e GORELEASER_CURRENT_TAG -e CIRCLE_TAG -e CIRCLE_SHA1 \
-e GO111MODULE=on \
-e GITHUB_TOKEN \
-e VAULT_ADDR -e VAULT_TOKEN \
goreleaser/goreleaser:v2.15.4 release
go test -v -coverprofile=coverage.txt -covermode=atomic ./...
go vet ./...
snapshot:
machine:
image: ubuntu-2204:current
Expand All @@ -104,55 +79,84 @@ jobs:
docker run --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
-v "$(pwd):/workspace" -w /workspace \
-e CIRCLE_SHA1 -e CIRCLE_BRANCH -e CIRCLE_TAG \
goreleaser/goreleaser:v2.15.4 release --snapshot --skip=sign
-e CIRCLE_SHA1 \
-e CIRCLE_BRANCH \
-e CIRCLE_TAG \
goreleaser/goreleaser:v2.17.1 release --snapshot --skip=sign
- store_artifacts:
path: dist
destination: snapshot
request-orb-publish:
docker:
- image: quay.io/reactiveops/ci-images:v14-alpine
release:
machine:
image: ubuntu-2204:current
resource_class: large
shell: /bin/bash
steps:
- *install_vault_alpine
- checkout
- *install_vault_machine
- rok8s/get_vault_env:
vault_path: repo/global/env
- rok8s/get_vault_env:
vault_path: repo/pluto/env
- run:
name: "Request Orb Publish"
name: docker login Google Artifact Registry
command: |
echo "$GCP_ARTIFACTREADWRITE_JSON_KEY" | base64 -d | docker login -u _json_key --password-stdin us-docker.pkg.dev
- *setup_qemu_binfmt
- run:
name: Run GoReleaser release
command: |
apk --update add curl
curl -X POST --data-urlencode "payload={\"text\": \"Please publish a new pluto orb by checking out $CIRCLE_TAG and running release-orb.sh\"}" $SLACK_URL
export GORELEASER_CURRENT_TAG="${CIRCLE_TAG}"
docker run --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
-v "$(pwd):/workspace" -w /workspace \
-v "${HOME}/.docker:/root/.docker" \
-e GORELEASER_CURRENT_TAG \
-e CIRCLE_TAG \
-e CIRCLE_SHA1 \
-e GO111MODULE=on \
-e GITHUB_TOKEN \
-e VAULT_ADDR \
-e VAULT_TOKEN \
goreleaser/goreleaser:v2.17.1 release

workflows:
version: 2
test:
test_and_build:
jobs:
- test
- snapshot:
requires:
- test
- test:
filters:
branches:
only: /.*/
tags:
ignore: /.*/
- rok8s/kubernetes_e2e_tests:
- snapshot:
requires:
- test
filters:
branches:
only: /.*/
tags:
ignore: /.*/
name: functional tests
<<: *e2e_config
- rok8s/kubernetes_e2e_tests:
name: "functional tests"
kind_node_image: "kindest/node:v1.26.6@sha256:6e2d8b28a5b601defe327b98bd1c2d1930b49e5d8c512e1895099e4504007adb"
<<: *e2e_configuration
release:
jobs:
- test:
filters:
branches:
ignore: /.*/
tags:
only: /v.*/
- release:
requires:
- test
context: org-global
filters:
branches:
ignore: /.*/
tags:
only: /.*/
only: /v.*/
- oss-docs/publish-docs:
requires:
- release
Expand All @@ -161,11 +165,4 @@ workflows:
branches:
ignore: /.*/
tags:
only: /^.*/
- request-orb-publish:
name: "Request Orb Publishing"
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
only: /v.*/
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ pkged.go
node_modules
/dist

orb.yml
venom.*.log
docs/README.md
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,5 @@ build-windows:
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 $(GOBUILD) -o $(BINARY_NAME) -ldflags "-X main.version=$(VERSION) -X main.commit=$(COMMIT) -s -w" -v ./cmd/pluto/main.go
build-docker: build-linux
docker build --build-arg version=$(VERSION) --build-arg commit=$(COMMIT) -t us-docker.pkg.dev/fairwinds-ops/oss/pluto/$(BINARY_NAME):dev .
orb-validate:
circleci orb pack orb/ > orb.yml
circleci orb validate orb.yml
circleci-validate:
circleci config validate --org-slug github/FairwindsOps
8 changes: 3 additions & 5 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ var detectHelmCmd = &cobra.Command{
}
exitCode = apiInstance.GetReturnCode()
klog.V(5).Infof("exitCode: %d", exitCode)
return
},
}

Expand All @@ -353,7 +352,6 @@ var detectApiResourceCmd = &cobra.Command{
}
exitCode = apiInstance.GetReturnCode()
klog.V(5).Infof("exitCode: %d", exitCode)
return
},
}

Expand Down Expand Up @@ -476,19 +474,19 @@ func detectHelm() error {
}
err = h.FindVersions()
if err != nil {
return fmt.Errorf("Error running helm-detect: %v", err)
return fmt.Errorf("error running helm-detect: %v", err)
}
return nil
}

func detectAPIResources() error {
disCl, err := discoveryapi.NewDiscoveryClient(namespace, kubeContext, apiInstance, kubeConfigPath)
if err != nil {
return fmt.Errorf("Error creating Discovery REST Client: %v", err)
return fmt.Errorf("error creating Discovery REST Client: %v", err)
}
err = disCl.GetApiResources()
if err != nil {
return fmt.Errorf("Error getting API resources using discovery client: %v", err)
return fmt.Errorf("error getting API resources using discovery client: %v", err)
}
return nil
}
4 changes: 0 additions & 4 deletions docs/contributing/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@ Each new pull request should:
- Contain a clear indication of if they're ready for review or a work in progress
- Be up to date and/or rebased on the master branch

## Orb development

There is a Makefile that can assist in validating and testing the orb locally. See the commands there for more info.

## Creating a new release

Push a new tag and Goreleaser will take care of the rest.
Expand Down
8 changes: 0 additions & 8 deletions docs/orb.md

This file was deleted.

7 changes: 0 additions & 7 deletions orb/@orb.yml

This file was deleted.

29 changes: 0 additions & 29 deletions orb/commands/configure_env.yml

This file was deleted.

16 changes: 0 additions & 16 deletions orb/commands/detect.yml

This file was deleted.

16 changes: 0 additions & 16 deletions orb/commands/detect_files.yml

This file was deleted.

Loading