From c7914f2f44ad3ee60c710e0920d0aa0b9c2d35ab Mon Sep 17 00:00:00 2001 From: jdesouza Date: Fri, 21 Aug 2026 09:26:39 -0300 Subject: [PATCH 1/8] Terraform plan testing --- .circleci/config.yml | 178 ++++++++++++++++++++++--------------------- 1 file changed, 90 insertions(+), 88 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0c1e6b32..9817a1e6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 @@ -52,15 +24,72 @@ 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 + attach-workspace: true + requires: + - test + - snapshot + filters: + branches: + only: /.*/ + ignore: /pull\/[0-9]+/ + tags: + ignore: /.*/ + +executors: + golang-exec: + docker: + - image: cimg/go:1.26.5 + jobs: test: - working_directory: /home/circleci/go/src/github.com/fairwindsops/pluto docker: - image: cimg/go:1.26.5 steps: - checkout - - run: go mod download && go mod verify - - run: go test -v ./... -coverprofile=coverage.txt -covermode=atomic + - run: + name: Go Mod Download + command: go mod download && go mod verify + - run: + name: test + command: | + go test -v -coverprofile=coverage.txt -covermode=atomic ./... + go vet ./... + snapshot: + machine: + image: ubuntu-2204:current + resource_class: large + steps: + - checkout + - *setup_qemu_binfmt + - run: + name: Run GoReleaser snapshot + command: | + 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.17.1 release --snapshot --skip=sign + - run: + name: Save snapshot amd64 image for e2e + command: | + mkdir -p /tmp/workspace/docker_save + docker save us-docker.pkg.dev/fairwinds-ops/oss/pluto:${CIRCLE_SHA1}-amd64 > /tmp/workspace/docker_save/pluto_${CIRCLE_SHA1}-amd64.tar + - persist_to_workspace: + root: /tmp/workspace/ + paths: + - docker_save + - store_artifacts: + path: dist + destination: snapshot release: machine: image: ubuntu-2204:current @@ -74,9 +103,9 @@ jobs: - rok8s/get_vault_env: vault_path: repo/pluto/env - run: - name: docker login + name: docker login Google Artifact Registry command: | - docker login -u _json_key -p "$(echo $GCP_ARTIFACTREADWRITE_JSON_KEY | base64 -d)" us-docker.pkg.dev + docker login -u _json_key -p "$$(echo $$GCP_ARTIFACTREADWRITE_JSON_KEY | base64 -d)" us-docker.pkg.dev - *setup_qemu_binfmt - run: name: Run GoReleaser release @@ -84,75 +113,55 @@ jobs: export GORELEASER_CURRENT_TAG="${CIRCLE_TAG}" docker run --rm \ -v /var/run/docker.sock:/var/run/docker.sock \ - -v "$(pwd):/workspace" -w /workspace \ + -v "$$(pwd):/workspace" -w /workspace \ -v "${HOME}/.docker:/root/.docker" \ - -e GORELEASER_CURRENT_TAG -e CIRCLE_TAG -e CIRCLE_SHA1 \ + -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 - snapshot: - machine: - image: ubuntu-2204:current - resource_class: large - steps: - - checkout - - *setup_qemu_binfmt - - run: - name: Run GoReleaser snapshot - command: | - 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 - - store_artifacts: - path: dist - destination: snapshot - request-orb-publish: - docker: - - image: quay.io/reactiveops/ci-images:v14-alpine - steps: - - *install_vault_alpine - - rok8s/get_vault_env: - vault_path: repo/pluto/env - - run: - name: "Request Orb Publish" - 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 + -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: /.*/ + ignore: /pull\/[0-9]+/ 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: + ignore: /^testing-.*/ - release: + requires: + - test context: org-global filters: branches: ignore: /.*/ tags: - only: /.*/ + ignore: /^testing-.*/ - oss-docs/publish-docs: requires: - release @@ -161,11 +170,4 @@ workflows: branches: ignore: /.*/ tags: - only: /^.*/ - - request-orb-publish: - name: "Request Orb Publishing" - filters: - branches: - ignore: /.*/ - tags: - only: /^v.*/ + ignore: /^testing-.*/ \ No newline at end of file From 50cca0f5250ac1eee2049f5fddc6e5fc0d12e55b Mon Sep 17 00:00:00 2001 From: jdesouza Date: Fri, 21 Aug 2026 10:33:29 -0300 Subject: [PATCH 2/8] Terraform plan testing --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9817a1e6..572d00c6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -73,7 +73,7 @@ jobs: command: | docker run --rm \ -v /var/run/docker.sock:/var/run/docker.sock \ - -v "$$(pwd):/workspace" -w /workspace \ + -v "$(pwd):/workspace" -w /workspace \ -e CIRCLE_SHA1 \ -e CIRCLE_BRANCH \ -e CIRCLE_TAG \ @@ -105,7 +105,7 @@ jobs: - run: name: docker login Google Artifact Registry command: | - docker login -u _json_key -p "$$(echo $$GCP_ARTIFACTREADWRITE_JSON_KEY | base64 -d)" us-docker.pkg.dev + docker login -u _json_key -p "$(echo $GCP_ARTIFACTREADWRITE_JSON_KEY | base64 -d)" us-docker.pkg.dev - *setup_qemu_binfmt - run: name: Run GoReleaser release @@ -113,7 +113,7 @@ jobs: export GORELEASER_CURRENT_TAG="${CIRCLE_TAG}" docker run --rm \ -v /var/run/docker.sock:/var/run/docker.sock \ - -v "$$(pwd):/workspace" -w /workspace \ + -v "$(pwd):/workspace" -w /workspace \ -v "${HOME}/.docker:/root/.docker" \ -e GORELEASER_CURRENT_TAG \ -e CIRCLE_TAG \ From 19204c38f19663cad5bfdc36bf1d0171d9bb92c0 Mon Sep 17 00:00:00 2001 From: jdesouza Date: Fri, 21 Aug 2026 12:20:34 -0300 Subject: [PATCH 3/8] Terraform plan testing --- .circleci/config.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 572d00c6..deea729b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -45,17 +45,25 @@ references: executors: golang-exec: docker: - - image: cimg/go:1.26.5 + - image: cimg/go:1.26.6 jobs: test: docker: - - image: cimg/go:1.26.5 + - image: cimg/go:1.26.6 steps: - checkout - run: name: Go Mod Download command: go mod download && go mod verify + - run: + name: golangci-lint + command: | + 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: test command: | @@ -152,7 +160,7 @@ workflows: branches: ignore: /.*/ tags: - ignore: /^testing-.*/ + only: /.*/ - release: requires: - test @@ -161,7 +169,7 @@ workflows: branches: ignore: /.*/ tags: - ignore: /^testing-.*/ + only: /.*/ - oss-docs/publish-docs: requires: - release @@ -170,4 +178,4 @@ workflows: branches: ignore: /.*/ tags: - ignore: /^testing-.*/ \ No newline at end of file + only: /.*/ From 6bcd0bfb6bb9b8babc7036bbabe29cd3dc53c6a3 Mon Sep 17 00:00:00 2001 From: jdesouza Date: Fri, 21 Aug 2026 14:56:11 -0300 Subject: [PATCH 4/8] Terraform plan testing --- .circleci/config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index deea729b..e199a370 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -38,7 +38,6 @@ references: filters: branches: only: /.*/ - ignore: /pull\/[0-9]+/ tags: ignore: /.*/ @@ -146,7 +145,6 @@ workflows: filters: branches: only: /.*/ - ignore: /pull\/[0-9]+/ tags: ignore: /.*/ - rok8s/kubernetes_e2e_tests: From 2d657f814ada9b99b9783548fe833933829dd02b Mon Sep 17 00:00:00 2001 From: jdesouza Date: Fri, 21 Aug 2026 15:49:30 -0300 Subject: [PATCH 5/8] Terraform plan testing --- cmd/root.go | 8 +++----- pkg/api/output.go | 7 +++++-- pkg/api/versions.go | 4 ++-- pkg/kube/kube_test.go | 3 +-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 5641dbe2..0dc509aa 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -332,7 +332,6 @@ var detectHelmCmd = &cobra.Command{ } exitCode = apiInstance.GetReturnCode() klog.V(5).Infof("exitCode: %d", exitCode) - return }, } @@ -353,7 +352,6 @@ var detectApiResourceCmd = &cobra.Command{ } exitCode = apiInstance.GetReturnCode() klog.V(5).Infof("exitCode: %d", exitCode) - return }, } @@ -476,7 +474,7 @@ 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 } @@ -484,11 +482,11 @@ func detectHelm() error { 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 } diff --git a/pkg/api/output.go b/pkg/api/output.go index 49adfb5f..43e50644 100644 --- a/pkg/api/output.go +++ b/pkg/api/output.go @@ -123,7 +123,10 @@ func (instance *Instance) DisplayOutput() error { } t := instance.markdownOut(c) if t != nil { - t.Render() + err = t.Render() + if err != nil { + return err + } } case "csv": var c columnList @@ -256,7 +259,7 @@ func (instance *Instance) markdownOut(columns columnList) *tablewriter.Table { for _, k := range columnIndexes { row = append(row, columns[k].value(o)) } - table.Append(row) + _ = table.Append(row) } return table diff --git a/pkg/api/versions.go b/pkg/api/versions.go index 3d121422..0c1be79b 100644 --- a/pkg/api/versions.go +++ b/pkg/api/versions.go @@ -297,7 +297,7 @@ func (instance *Instance) PrintVersionList(outputFormat string) error { fmt.Println(string(data)) default: fmt.Println("The output format must be one of (normal|wide|json|yaml)") - return fmt.Errorf("The output format must be one of (normal|wide|json|yaml)") + return fmt.Errorf("the output format must be one of (normal|wide|json|yaml)") } return nil } @@ -307,7 +307,7 @@ func (instance *Instance) printVersionsTabular() error { w.Init(os.Stdout, 0, 15, 2, padChar, 0) if !instance.NoHeaders { - fmt.Fprintln(w, "KIND\t NAME\t DEPRECATED IN\t REMOVED IN\t REPLACEMENT\t REPL AVAIL IN\t COMPONENT\t") + _, _ = fmt.Fprintln(w, "KIND\t NAME\t DEPRECATED IN\t REMOVED IN\t REPLACEMENT\t REPL AVAIL IN\t COMPONENT\t") } for _, version := range instance.DeprecatedVersions { diff --git a/pkg/kube/kube_test.go b/pkg/kube/kube_test.go index 9cbb42f9..588b4a4c 100644 --- a/pkg/kube/kube_test.go +++ b/pkg/kube/kube_test.go @@ -15,7 +15,6 @@ package kube import ( - "os" "testing" "github.com/stretchr/testify/assert" @@ -75,7 +74,7 @@ func Test_getKubeClient(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - os.Setenv("KUBECONFIG", tt.kubeConfig) + t.Setenv("KUBECONFIG", tt.kubeConfig) _, err := GetConfig(tt.kubeContext, tt.kubeConfigPath) if tt.wantErr { assert.Error(t, err) From 4ecf3ba64d97be9bbba951f040abb7d81142681a Mon Sep 17 00:00:00 2001 From: jdesouza Date: Wed, 26 Aug 2026 10:39:22 -0300 Subject: [PATCH 6/8] Removing orb --- .gitignore | 1 - Makefile | 3 -- docs/contributing/guide.md | 4 --- docs/orb.md | 8 ----- orb/@orb.yml | 7 ----- orb/commands/configure_env.yml | 29 ------------------- orb/commands/detect.yml | 16 ---------- orb/commands/detect_files.yml | 16 ---------- orb/commands/install.yml | 16 ---------- orb/examples/detect.yml | 14 --------- orb/examples/detect_files.yml | 14 --------- orb/executors/default.yml | 6 ---- orb/jobs/detect.yml | 53 ---------------------------------- orb/jobs/detect_files.yml | 53 ---------------------------------- orb/scripts/detect.sh | 9 ------ orb/scripts/detect_files.sh | 10 ------- orb/scripts/install.sh | 21 -------------- release-orb.sh | 36 ----------------------- 18 files changed, 316 deletions(-) delete mode 100644 docs/orb.md delete mode 100644 orb/@orb.yml delete mode 100644 orb/commands/configure_env.yml delete mode 100644 orb/commands/detect.yml delete mode 100644 orb/commands/detect_files.yml delete mode 100644 orb/commands/install.yml delete mode 100644 orb/examples/detect.yml delete mode 100644 orb/examples/detect_files.yml delete mode 100644 orb/executors/default.yml delete mode 100644 orb/jobs/detect.yml delete mode 100644 orb/jobs/detect_files.yml delete mode 100644 orb/scripts/detect.sh delete mode 100755 orb/scripts/detect_files.sh delete mode 100755 orb/scripts/install.sh delete mode 100755 release-orb.sh diff --git a/.gitignore b/.gitignore index acaf9fd0..a7376d1f 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,5 @@ pkged.go node_modules /dist -orb.yml venom.*.log docs/README.md diff --git a/Makefile b/Makefile index 212edcde..3f6e4ba8 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/docs/contributing/guide.md b/docs/contributing/guide.md index d01f4b0c..6de5eebe 100644 --- a/docs/contributing/guide.md +++ b/docs/contributing/guide.md @@ -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. diff --git a/docs/orb.md b/docs/orb.md deleted file mode 100644 index 00d2d42e..00000000 --- a/docs/orb.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -meta: - - name: description - content: "Fairwinds Pluto | Fairwinds publishes an orb called fairwinds/pluto to provide easier configuration inside of CircleCI." ---- -# Orb - -CircleCI has introduced the concept of reusable config in the form of [Orbs](https://circleci.com/orbs/). As of pluto v5.1, Fairwinds publishes an orb called [`fairwinds/pluto`](https://circleci.com/orbs/registry/orb/fairwinds/pluto) in order to provide easier configuration inside of CircleCI. diff --git a/orb/@orb.yml b/orb/@orb.yml deleted file mode 100644 index 35496be6..00000000 --- a/orb/@orb.yml +++ /dev/null @@ -1,7 +0,0 @@ -version: 2.1 - -description: | - Pluto is a utility to help users find deprecated Kubernetes apiVersions in their code repositories and their helm releases. -display: - home_url: https://pluto.docs.fairwinds.com - source_url: https://github.com/FairwindsOps/pluto diff --git a/orb/commands/configure_env.yml b/orb/commands/configure_env.yml deleted file mode 100644 index df121e5f..00000000 --- a/orb/commands/configure_env.yml +++ /dev/null @@ -1,29 +0,0 @@ -description: Configures pluto environment variables. -parameters: - executor: - description: The name of custom executor to use. Only recommended for development. - type: executor - default: default - ignore-deprecations: - type: boolean - default: false - description: Exit Code 3 is ignored, useful if you do not want the job to fail if deprecated APIs are detected. - ignore-removals: - type: boolean - default: false - description: Exit Code 3 is ignored, useful if you do not want the job to fail if removed APIs are detected. - target-versions: - description: You can target the Kubernetes version you are concerned with. If blank defaults to latest. - type: string - default: "" -steps: - - run: - name: configure Pluto env vars - command: | - #!/bin/bash - - set -e - - echo PLUTO_IGNORE_DEPRECATIONS=<> >> $BASH_ENV - echo PLUTO_IGNORE_REMOVALS=<> >> $BASH_ENV - echo PLUTO_TARGET_VERSIONS=<> >> $BASH_ENV diff --git a/orb/commands/detect.yml b/orb/commands/detect.yml deleted file mode 100644 index 95b9a245..00000000 --- a/orb/commands/detect.yml +++ /dev/null @@ -1,16 +0,0 @@ -description: Detecting deprecated Kubernetes apiVersions within your repository. -parameters: - file: - description: The file to scan. - type: string - default: "" - executor: - description: The name of custom executor to use. Only recommended for development. - type: executor - default: default -steps: - - run: - name: Pluto detect - environment: - PLUTO_FILE: <> - command: <> diff --git a/orb/commands/detect_files.yml b/orb/commands/detect_files.yml deleted file mode 100644 index 55f189e3..00000000 --- a/orb/commands/detect_files.yml +++ /dev/null @@ -1,16 +0,0 @@ -description: Detecting deprecated Kubernetes apiVersions within your repository. -parameters: - directory: - description: The directory to scan. If blank defaults to current directory. - type: string - default: "" - executor: - description: The name of custom executor to use. Only recommended for development. - type: executor - default: default -steps: - - run: - name: Pluto detect-files - environment: - PLUTO_DIRECTORY: <> - command: <> diff --git a/orb/commands/install.yml b/orb/commands/install.yml deleted file mode 100644 index 7d8daff3..00000000 --- a/orb/commands/install.yml +++ /dev/null @@ -1,16 +0,0 @@ -description: Installs the pluto command. -parameters: - executor: - description: The name of custom executor to use. Only recommended for development. - type: executor - default: default - version: - description: The version of pluto to install. Defaults to latest stable. - type: string - default: "" -steps: - - run: - name: Install Pluto - environment: - VERSION: <> - command: <> diff --git a/orb/examples/detect.yml b/orb/examples/detect.yml deleted file mode 100644 index 5f0e39b7..00000000 --- a/orb/examples/detect.yml +++ /dev/null @@ -1,14 +0,0 @@ -description: | - A workflow for detecting deprecated Kubernetes apiVersions for a specific file. -usage: - version: 2.1 - orbs: - pluto: fairwinds/pluto@5 - workflows: - detect_files: - jobs: - - pluto/detect_files: - file: ./K8s/Descriptors/ingress.yml - ignore-deprecations: true - ignore-removals: false - target-versions: "k8s=v1.21" diff --git a/orb/examples/detect_files.yml b/orb/examples/detect_files.yml deleted file mode 100644 index 29974b52..00000000 --- a/orb/examples/detect_files.yml +++ /dev/null @@ -1,14 +0,0 @@ -description: | - A workflow for detecting deprecated Kubernetes apiVersions within your repository. -usage: - version: 2.1 - orbs: - pluto: fairwinds/pluto@5 - workflows: - detect_files: - jobs: - - pluto/detect_files: - directory: ./K8s/Descriptors - ignore-deprecations: true - ignore-removals: false - target-versions: "k8s=v1.21" diff --git a/orb/executors/default.yml b/orb/executors/default.yml deleted file mode 100644 index ec7317df..00000000 --- a/orb/executors/default.yml +++ /dev/null @@ -1,6 +0,0 @@ -parameters: - version: - type: string - default: "stable" -docker: - - image: cimg/base:<> diff --git a/orb/jobs/detect.yml b/orb/jobs/detect.yml deleted file mode 100644 index 5c112c94..00000000 --- a/orb/jobs/detect.yml +++ /dev/null @@ -1,53 +0,0 @@ -description: > - A workflow for detecting deprecated Kubernetes apiVersions within your repository. -parameters: - checkout: - type: boolean - default: true - description: "Perform checkout as first step in job." - executor: - description: The name of custom executor to use. Only recommended for development. - type: executor - default: default - file: - description: The file to scan. Required. - type: string - default: "" - use-external-context: - type: boolean - default: false - description: If this is true, then the configure_env step will be skipped. - ignore-deprecations: - type: boolean - default: false - description: Exit Code 3 is ignored, useful if you do not want the job to fail if deprecated APIs are detected. - ignore-removals: - type: boolean - default: false - description: Exit Code 3 is ignored, useful if you do not want the job to fail if removed APIs are detected. - target-versions: - description: You can target the Kubernetes version you are concerned with. If blank defaults to latest. - type: string - default: "" - version: - description: Version of Pluto to use. Defaults to latest stable. - type: string - default: "" -executor: <> -steps: - - when: - condition: << parameters.checkout >> - steps: - - checkout - - install: - version: <> - - when: - condition: - not: << parameters.use-external-context >> - steps: - - configure_env: - ignore-deprecations: << parameters.ignore-deprecations >> - ignore-removals: << parameters.ignore-removals >> - target-versions: << parameters.target-versions >> - - detect: - file: <> diff --git a/orb/jobs/detect_files.yml b/orb/jobs/detect_files.yml deleted file mode 100644 index 1f851f85..00000000 --- a/orb/jobs/detect_files.yml +++ /dev/null @@ -1,53 +0,0 @@ -description: > - A workflow for detecting deprecated Kubernetes apiVersions within your repository. -parameters: - checkout: - type: boolean - default: true - description: "Perform checkout as first step in job." - directory: - description: The directory to scan. If blank defaults to current directory. - type: string - default: "" - executor: - description: The name of custom executor to use. Only recommended for development. - type: executor - default: default - use-external-context: - type: boolean - default: false - description: If this is true, then the configure_env step will be skipped. - ignore-deprecations: - type: boolean - default: false - description: Exit Code 3 is ignored, useful if you do not want the job to fail if deprecated APIs are detected. - ignore-removals: - type: boolean - default: false - description: Exit Code 3 is ignored, useful if you do not want the job to fail if removed APIs are detected. - target-versions: - description: You can target the Kubernetes version you are concerned with. If blank defaults to latest. - type: string - default: "" - version: - description: Version of Pluto to use. Defaults to latest stable. - type: string - default: "" -executor: <> -steps: - - when: - condition: << parameters.checkout >> - steps: - - checkout - - install: - version: <> - - when: - condition: - not: << parameters.use-external-context >> - steps: - - configure_env: - ignore-deprecations: << parameters.ignore-deprecations >> - ignore-removals: << parameters.ignore-removals >> - target-versions: << parameters.target-versions >> - - detect_files: - directory: <> diff --git a/orb/scripts/detect.sh b/orb/scripts/detect.sh deleted file mode 100644 index 8d77bc0a..00000000 --- a/orb/scripts/detect.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -set -e - -if [[ -z "${PLUTO_FILE}" ]]; then - echo "Error: requires a file argument" - exit 1 -fi - -pluto detect "$PLUTO_FILE" diff --git a/orb/scripts/detect_files.sh b/orb/scripts/detect_files.sh deleted file mode 100755 index 8a95d7ae..00000000 --- a/orb/scripts/detect_files.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -set -e - -if [[ -n "${PLUTO_DIRECTORY}" ]]; then - PLUTO_ARGS="$PLUTO_ARGS --directory ${PLUTO_DIRECTORY}" -fi - -export PLUTO_ARGS - -pluto detect-files "$PLUTO_ARGS" diff --git a/orb/scripts/install.sh b/orb/scripts/install.sh deleted file mode 100755 index 6608e7fe..00000000 --- a/orb/scripts/install.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -if [[ -z "${VERSION}" ]]; then - VERSION=latest -fi - -curl -s https://api.github.com/repos/FairwindsOps/pluto/releases/${VERSION} \ -| grep "browser_download_url.*linux_amd64.tar.gz" \ -| cut -d '"' -f 4 \ -| wget -qi - - -tarball="$(find . -name "*linux_amd64.tar.gz")" -tar -xzf $tarball - -sudo mv pluto /bin - -location="$(which pluto)" -echo "Pluto binary location: $location" - -version="$(pluto version)" -echo "Pluto binary version: $version" diff --git a/release-orb.sh b/release-orb.sh deleted file mode 100755 index 16309e51..00000000 --- a/release-orb.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -function version_gt() { - test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"; -} - -echo "Starting release." - -command -v circleci >/dev/null 2>&1 || { echo >&2 "I require circleci but it's not installed. Aborting."; exit 1; } -echo "Found circleci command." - -cli_version=$(circleci version | cut -d+ -f1) -required_version=0.1.5705 - -if version_gt "$required_version" "$cli_version"; then - echo "This script requires circleci version greater than or equal to 0.1.5705!" - exit 1 -fi - -commit=$(git log -n1 --pretty='%h') -tag=$(git describe --exact-match --tags "$commit") - -retVal=$? -echo "retVal = $retVal" -if [ $retVal -ne 0 ]; then - echo "You need to checkout a valid tag for this to work." - exit $retVal -fi - -echo "Release: $commit - $tag" - -echo "Validating..." -make orb-validate || { echo 'Orb failed to validate.' ; exit 1; } - -echo "Releasing..." -circleci orb publish orb.yml "fairwinds/pluto@${tag:1}" From d055993b773d115a34ed1f4009c8ffa3cbfc3e16 Mon Sep 17 00:00:00 2001 From: jdesouza Date: Wed, 26 Aug 2026 11:22:27 -0300 Subject: [PATCH 7/8] Fix circleci --- .circleci/config.yml | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e199a370..10cf78c3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,10 +31,8 @@ references: command_runner_image: quay.io/reactiveops/ci-images:v14.1-bullseye enable_docker_layer_caching: true store-test-results: /tmp/test-results - attach-workspace: true requires: - test - - snapshot filters: branches: only: /.*/ @@ -85,15 +83,6 @@ jobs: -e CIRCLE_BRANCH \ -e CIRCLE_TAG \ goreleaser/goreleaser:v2.17.1 release --snapshot --skip=sign - - run: - name: Save snapshot amd64 image for e2e - command: | - mkdir -p /tmp/workspace/docker_save - docker save us-docker.pkg.dev/fairwinds-ops/oss/pluto:${CIRCLE_SHA1}-amd64 > /tmp/workspace/docker_save/pluto_${CIRCLE_SHA1}-amd64.tar - - persist_to_workspace: - root: /tmp/workspace/ - paths: - - docker_save - store_artifacts: path: dist destination: snapshot @@ -112,7 +101,7 @@ jobs: - run: name: docker login Google Artifact Registry command: | - docker login -u _json_key -p "$(echo $GCP_ARTIFACTREADWRITE_JSON_KEY | base64 -d)" us-docker.pkg.dev + 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 @@ -158,7 +147,7 @@ workflows: branches: ignore: /.*/ tags: - only: /.*/ + only: /v.*/ - release: requires: - test @@ -167,7 +156,7 @@ workflows: branches: ignore: /.*/ tags: - only: /.*/ + only: /v.*/ - oss-docs/publish-docs: requires: - release @@ -176,4 +165,4 @@ workflows: branches: ignore: /.*/ tags: - only: /.*/ + only: /v.*/ From 1edb4c1190203ceb03c4471c342a1b224c2ec5a4 Mon Sep 17 00:00:00 2001 From: jdesouza Date: Fri, 28 Aug 2026 16:23:32 -0300 Subject: [PATCH 8/8] Updated version --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 10cf78c3..f9a14a9c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -42,12 +42,12 @@ references: executors: golang-exec: docker: - - image: cimg/go:1.26.6 + - image: cimg/go:1.26.7 jobs: test: docker: - - image: cimg/go:1.26.6 + - image: cimg/go:1.26.7 steps: - checkout - run: