Skip to content

Commit

Permalink
chore(kinds): merge into mono repo
Browse files Browse the repository at this point in the history
  • Loading branch information
emosbaugh committed Aug 30, 2024
1 parent 709613b commit 38be957
Show file tree
Hide file tree
Showing 71 changed files with 256 additions and 249 deletions.
1 change: 1 addition & 0 deletions .github/actions/e2e/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ runs:
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: "**/*.sum"
- name: E2E
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ updates:
- "patch"

- package-ecosystem: "gomod"
directory: "/operator/"
directory: "/kinds/"
open-pull-requests-limit: 25
schedule:
interval: "weekly"
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
name: CI

on:
pull_request: {}
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: write

jobs:
git-sha:
name: Git SHA
Expand All @@ -30,6 +34,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: "**/*.sum"
- name: Go vet
run: |
make vet
Expand All @@ -38,7 +43,7 @@ jobs:
with:
version: v1.54

tests:
test:
name: Unit tests
runs-on: ubuntu-latest
steps:
Expand All @@ -48,6 +53,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: "**/*.sum"
- name: Unit tests
run: |
make unit-tests
Expand Down Expand Up @@ -148,6 +154,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: "**/*.sum"
- name: Compile buildtools
run: |
make buildtools
Expand All @@ -174,6 +181,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: "**/*.sum"

- name: Download buildtools artifact
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -431,6 +439,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: "**/*.sum"
- name: Write license file
run: |
echo "${{ secrets.STAGING_EMBEDDED_CLUSTER_LICENSE }}" | base64 --decode > e2e/license.yaml
Expand Down Expand Up @@ -532,7 +541,7 @@ jobs:
- e2e
- e2e-docker
- sanitize
- tests
- test
- check-images
- check-operator-crds
if: always()
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: "**/*.sum"
- name: Kubectl
run: |
export VERSION=`curl -L -s https://dl.k8s.io/release/stable.txt`
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/image-deps-updater.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: "**/*.sum"

- name: Compile buildtools
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/image-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: "**/*.sum"

- name: Build
run: |
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/kinds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Kinds

on:
pull_request:
paths:
- 'kinds/**'

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: kinds/go.mod
cache-dependency-path: kinds/*.sum

- name: Fmt
run: make fmt

- name: Vet
run: make vet

- name: Generate
run: make generate

- name: Check generated code to be consistent
run: |
git diff --exit-code --name-only
if [ $? -eq 0 ]; then
echo "Generated files are up to date"
else
echo "Generated files are out of date"
exit 1
fi
tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: kinds/go.mod
cache-dependency-path: kinds/*.sum

- name: Unit tests
run: make unit-tests
2 changes: 2 additions & 0 deletions .github/workflows/release-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: "**/*.sum"

- name: Compile buildtools
run: |
Expand Down Expand Up @@ -140,6 +141,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: "**/*.sum"

- name: Download buildtools artifact
uses: actions/download-artifact@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/update-addons.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: "**/*.sum"
- name: Compile buildtools
run: |
make buildtools
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ vendor
e2e/kots-release-install/license.yaml
/build/
/bin/
go.work
go.work.sum
4 changes: 2 additions & 2 deletions cmd/buildtools/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"sort"
"strings"

embeddedclusterv1beta1 "github.com/replicatedhq/embedded-cluster-kinds/apis/v1beta1"
"github.com/replicatedhq/embedded-cluster-kinds/types"
embeddedclusterv1beta1 "github.com/replicatedhq/embedded-cluster/kinds/apis/v1beta1"
"github.com/replicatedhq/embedded-cluster/kinds/types"
"github.com/replicatedhq/embedded-cluster/pkg/helm"
"github.com/replicatedhq/embedded-cluster/pkg/helpers"
"github.com/urfave/cli/v2"
Expand Down
2 changes: 1 addition & 1 deletion cmd/embedded-cluster/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"time"

k0sconfig "github.com/k0sproject/k0s/pkg/apis/k0s/v1beta1"
ecv1beta1 "github.com/replicatedhq/embedded-cluster-kinds/apis/v1beta1"
ecv1beta1 "github.com/replicatedhq/embedded-cluster/kinds/apis/v1beta1"
kotsv1beta1 "github.com/replicatedhq/kotskinds/apis/kots/v1beta1"
"github.com/sirupsen/logrus"
"github.com/urfave/cli/v2"
Expand Down
2 changes: 1 addition & 1 deletion cmd/embedded-cluster/join.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/google/uuid"
"github.com/k0sproject/dig"
k0sconfig "github.com/k0sproject/k0s/pkg/apis/k0s/v1beta1"
ecv1beta1 "github.com/replicatedhq/embedded-cluster-kinds/apis/v1beta1"
ecv1beta1 "github.com/replicatedhq/embedded-cluster/kinds/apis/v1beta1"
"github.com/sirupsen/logrus"
"github.com/urfave/cli/v2"
"gopkg.in/yaml.v2"
Expand Down
2 changes: 1 addition & 1 deletion cmd/embedded-cluster/join_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/k0sproject/dig"
k0sconfig "github.com/k0sproject/k0s/pkg/apis/k0s/v1beta1"
embeddedclusterv1beta1 "github.com/replicatedhq/embedded-cluster-kinds/apis/v1beta1"
embeddedclusterv1beta1 "github.com/replicatedhq/embedded-cluster/kinds/apis/v1beta1"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
Expand Down
4 changes: 2 additions & 2 deletions cmd/embedded-cluster/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"sort"

k0sconfig "github.com/k0sproject/k0s/pkg/apis/k0s/v1beta1"
eckinds "github.com/replicatedhq/embedded-cluster-kinds/apis/v1beta1"
"github.com/replicatedhq/embedded-cluster-kinds/types"
eckinds "github.com/replicatedhq/embedded-cluster/kinds/apis/v1beta1"
"github.com/replicatedhq/embedded-cluster/kinds/types"
"github.com/urfave/cli/v2"

"github.com/replicatedhq/embedded-cluster/pkg/addons"
Expand Down
2 changes: 1 addition & 1 deletion cmd/embedded-cluster/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"os"
"strings"

ecv1beta1 "github.com/replicatedhq/embedded-cluster-kinds/apis/v1beta1"
ecv1beta1 "github.com/replicatedhq/embedded-cluster/kinds/apis/v1beta1"
"github.com/replicatedhq/embedded-cluster/pkg/defaults"
"github.com/urfave/cli/v2"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/embedded-cluster/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

k0sconfig "github.com/k0sproject/k0s/pkg/apis/k0s/v1beta1"
ecv1beta1 "github.com/replicatedhq/embedded-cluster-kinds/apis/v1beta1"
ecv1beta1 "github.com/replicatedhq/embedded-cluster/kinds/apis/v1beta1"
"github.com/stretchr/testify/assert"
"github.com/urfave/cli/v2"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/embedded-cluster/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
k0sv1beta1 "github.com/k0sproject/k0s/pkg/apis/k0s/v1beta1"
ecv1beta1 "github.com/replicatedhq/embedded-cluster-kinds/apis/v1beta1"
ecv1beta1 "github.com/replicatedhq/embedded-cluster/kinds/apis/v1beta1"
"github.com/replicatedhq/embedded-cluster/pkg/addons"
"github.com/replicatedhq/embedded-cluster/pkg/addons/adminconsole"
"github.com/replicatedhq/embedded-cluster/pkg/addons/seaweedfs"
Expand Down
2 changes: 1 addition & 1 deletion cmd/embedded-cluster/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"path/filepath"

ecv1beta1 "github.com/replicatedhq/embedded-cluster-kinds/apis/v1beta1"
ecv1beta1 "github.com/replicatedhq/embedded-cluster/kinds/apis/v1beta1"
"github.com/replicatedhq/embedded-cluster/pkg/helpers"
"github.com/sirupsen/logrus"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/local-artifact-mirror/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"os/exec"
"path/filepath"

"github.com/replicatedhq/embedded-cluster-kinds/apis/v1beta1"
"github.com/replicatedhq/embedded-cluster/kinds/apis/v1beta1"
"github.com/replicatedhq/embedded-cluster/pkg/defaults"
"github.com/replicatedhq/embedded-cluster/pkg/helpers"
"github.com/replicatedhq/embedded-cluster/pkg/kubeutils"
Expand Down
2 changes: 1 addition & 1 deletion docs/resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ The `Installation` object is used by the Embedded Cluster Operator to both initi

The `Installation` object can contain errors surfaced from the `Plan` and `Chart` resources.

Possible Installation statuses can be found here: https://github.com/replicatedhq/embedded-cluster-kinds/blob/f54d45f99095ac6beaac61a3c8b735b9f7473329/apis/v1beta1/installation_types.go#L29-L42
Possible Installation statuses can be found here: https://github.com/replicatedhq/embedded-cluster/kinds/blob/f54d45f99095ac6beaac61a3c8b735b9f7473329/apis/v1beta1/installation_types.go#L29-L42
2 changes: 1 addition & 1 deletion e2e/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"testing"
"time"

"github.com/replicatedhq/embedded-cluster-kinds/types"
"github.com/replicatedhq/embedded-cluster/e2e/cluster"
"github.com/replicatedhq/embedded-cluster/kinds/types"
)

func TestVersion(t *testing.T) {
Expand Down
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ require (
github.com/ohler55/ojg v1.23.0
github.com/onsi/ginkgo/v2 v2.19.0
github.com/onsi/gomega v1.33.1
github.com/replicatedhq/embedded-cluster-kinds v1.4.7
github.com/replicatedhq/embedded-cluster-utils v1.0.0
github.com/replicatedhq/embedded-cluster/kinds v0.0.0
github.com/replicatedhq/kotskinds v0.0.0-20240621115447-55148ce032e4
github.com/replicatedhq/troubleshoot v0.100.0
github.com/sirupsen/logrus v1.9.3
Expand All @@ -53,6 +53,8 @@ require (
sigs.k8s.io/yaml v1.4.0
)

replace github.com/replicatedhq/embedded-cluster/kinds v0.0.0 => ./kinds

require (
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
Expand Down Expand Up @@ -150,6 +152,7 @@ require (
github.com/rubenv/sql-migrate v1.5.2 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
Expand Down
5 changes: 1 addition & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,6 @@ github.com/redis/go-redis/extra/redisotel/v9 v9.0.5 h1:EfpWLLCyXw8PSM2/XNJLjI3Pb
github.com/redis/go-redis/extra/redisotel/v9 v9.0.5/go.mod h1:WZjPDy7VNzn77AAfnAfVjZNvfJTYfPetfZk5yoSTLaQ=
github.com/redis/go-redis/v9 v9.5.2 h1:L0L3fcSNReTRGyZ6AqAEN0K56wYeYAwapBIhkvh0f3E=
github.com/redis/go-redis/v9 v9.5.2/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M=
github.com/replicatedhq/embedded-cluster-kinds v1.4.7 h1:CR55z8Q2ek90BwwwOEz+P3qFIgc84G7wp/FNs+ctfsw=
github.com/replicatedhq/embedded-cluster-kinds v1.4.7/go.mod h1:AwopUvvGcaWO4mn9DkbPj5RnLuOy756CNLrcaAlmjMo=
github.com/replicatedhq/embedded-cluster-utils v1.0.0 h1:Axdni1nYfl5zeOP9g5U79yvN8cRdClyU6hz0wV1Hmdc=
github.com/replicatedhq/embedded-cluster-utils v1.0.0/go.mod h1:4JmMC2CwMCLxq05GEW3XSPPVotqyamAF/omrbB3pH+c=
github.com/replicatedhq/kotskinds v0.0.0-20240621115447-55148ce032e4 h1:nsNSod6wpFpaMUq1IqnU4y2XWQd2FEKtdr02UB2udkk=
Expand All @@ -535,8 +533,7 @@ github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6ke
github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4=
github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE=
github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ=
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
Expand Down
21 changes: 0 additions & 21 deletions kinds/.github/dependabot.yml

This file was deleted.

Loading

0 comments on commit 38be957

Please sign in to comment.