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

Make operator exportable by removing grafonnet-lib git submodule #1280

Merged
merged 4 commits into from
Nov 2, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ jobs:
env:
KUBECONFIG: /home/runner/.kube/kind-grafana-operator-e2e
steps:
- name: Clone repo and checkout submodules
- name: Clone repo and checkout
uses: actions/checkout@v4
with:
submodules: recursive

- uses: actions/setup-go@v4
with:
Expand Down
15 changes: 3 additions & 12 deletions .github/workflows/pr-validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
git check-attr --stdin linguist-generated | grep -Ev ': (set|true)$' | cut -d: -f1 |
git check-attr --stdin linguist-vendored | grep -Ev ': (set|true)$' | cut -d: -f1 |
git check-attr --stdin ignore-lint | grep -Ev ': (set|true)$' | cut -d: -f1 |
grep -Ev '^(vendor/|third_party/|LICENSES/|.git|bundle/)' |
grep -Ev '^(vendor/|third_party/|LICENSES/|.git|bundle/|embeds/grafonnet-lib/)' |
grep -v api.md |
xargs grep -nE " +$" |
reviewdog -efm="%f:%l:%m" \
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
git check-attr --stdin linguist-generated | grep -Ev ': (set|true)$' | cut -d: -f1 |
git check-attr --stdin linguist-vendored | grep -Ev ': (set|true)$' | cut -d: -f1 |
git check-attr --stdin ignore-lint | grep -Ev ': (set|true)$' | cut -d: -f1 |
grep -Ev '^(vendor/|third_party/|LICENSES/|.git)' |
grep -Ev '^(vendor/|third_party/|LICENSES/|.git|embeds/grafonnet-lib/)' |
grep -v '\.ai$' |
grep -v '\.svg$')
for x in $LINT_FILES; do
Expand All @@ -88,8 +88,6 @@ jobs:
steps:
- name: Clone repo
uses: actions/checkout@v4 #v3.2.0
with:
submodules: recursive

- name: Setup go
uses: actions/setup-go@v4
Expand All @@ -106,8 +104,6 @@ jobs:
steps:
- name: Clone repo
uses: actions/checkout@v4 #v3.2.0
with:
submodules: recursive

- name: Setup go
uses: actions/setup-go@v4
Expand All @@ -131,8 +127,6 @@ jobs:
steps:
- name: Clone repo
uses: actions/checkout@v4 #v3.2.0
with:
submodules: recursive

- name: Setup go
uses: actions/setup-go@v4
Expand All @@ -156,8 +150,6 @@ jobs:
steps:
- name: Clone repo
uses: actions/checkout@v4 #v3.2.0
with:
submodules: recursive

- name: Setup go
uses: actions/setup-go@v4
Expand All @@ -181,8 +173,7 @@ jobs:
steps:
- name: Clone repo
uses: actions/checkout@v4 #v3.2.0
with:
submodules: recursive

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ jobs:
steps:
- name: Clone repo
uses: actions/checkout@v4
with:
submodules: recursive

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand Down
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,5 @@ kube-apiserver-audit.log
labs/benchmark/dashboards
labs/benchmark/datasources

# Grafonnet embeds
/embeds/grafonnet-lib/*
!/embeds/grafonnet-lib/grafonnet
!/embeds/grafonnet-lib/grafonnet-7.0

# kind artifacts
kubeconfig
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

4 changes: 1 addition & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ Thank you for investing your time in contributing to our project.

The operator uses unit tests and [Kuttl](https://kuttl.dev/) for e2e tests to make sure that the operator is working as intended, we use make to generate a number of docs and scripts for us.

The operator use a submodule for [grafonnet-lib](https://github.com/grafana/grafonnet-lib),
one of the first things you have to do is to run `make submodule`.
The operator embeds [grafonnet-lib](https://github.com/grafana/grafonnet-lib) inside `embeds/grafonnet-lib`. It used to be a git submodule, however, as that folder was only filled when the git submodule was initiated, the grafana-operator couldn't be imported externally.

**NOTE:** please, run `make all` before opening a PR to make sure your changes are compliant with our standards and all automatically generated files (like CRDs) are up-to-date.

Expand All @@ -22,7 +21,6 @@ As a part of the CI solution these settings will be validated, but all of them c
Before pushing any code we recommend that you run the following make commands.

```shell
make submodule
make test
make code/golangci-lint
```
Expand Down
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ test: manifests generate code/gofumpt api-docs vet envtest ## Run tests.
build: generate code/gofumpt vet ## Build manager binary.
go build -o bin/manager main.go

# Get submodules
submodule:
git submodule update --init --recursive

.PHONY: run
run: manifests generate code/gofumpt vet ## Run a controller from your host.
go run ./main.go
Expand Down
9 changes: 0 additions & 9 deletions embeds/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,3 @@ This directory is used for embedding FS structs into go code.
# Grafonnet

The Grafonnet Jsonnet is used to allow users to define their dashboards using the jsonnet framework.

To update the library, run:

```shell
git submodule update
```

**Note**: the root level .gitignore will ignore everything apart from grafonnet/ and grafonnet-7.0/ directories.
be careful if you need to add other files than these two, update the project root .gitignore accordingly
1 change: 0 additions & 1 deletion embeds/grafonnet-lib
Submodule grafonnet-lib deleted from 302801
Loading