Skip to content

Commit 20a3bb5

Browse files
committed
feat(controller): hard fork
Signed-off-by: Oliver Bähler <[email protected]>
1 parent ecfc967 commit 20a3bb5

33 files changed

+48
-95
lines changed

.github/workflows/coverage.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
8484
with:
8585
token: ${{ secrets.CODECOV_TOKEN }}
86-
slug: projectcapsule/cortex-tenant
86+
slug: projectcapsule/cortex-proxy
8787
files: ./coverage.out
8888
fail_ci_if_error: true
8989
verbose: true

.github/workflows/docker-publish.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ jobs:
3838
repository: ${{ github.repository_owner }}
3939
version: ${{ steps.extract_version.outputs.version }}
4040
sign-image: true
41-
sbom-name: cortex-tenant
42-
sbom-repository: ghcr.io/${{ github.repository_owner }}/cortex-tenant
43-
signature-repository: ghcr.io/${{ github.repository_owner }}/cortex-tenant
41+
sbom-name: cortex-proxy
42+
sbom-repository: ghcr.io/${{ github.repository_owner }}/cortex-proxy
43+
signature-repository: ghcr.io/${{ github.repository_owner }}/cortex-proxy
4444
main-path: ./cmd/
4545
env:
4646
REPOSITORY: ${{ github.repository }}
@@ -52,7 +52,7 @@ jobs:
5252
actions: read # To read the workflow path.
5353
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
5454
with:
55-
image: ghcr.io/${{ github.repository_owner }}/cortex-tenant
55+
image: ghcr.io/${{ github.repository_owner }}/cortex-proxy
5656
digest: "${{ needs.publish-images.outputs.container-digest }}"
5757
registry-username: ${{ github.actor }}
5858
secrets:

.github/workflows/e2e.yaml

-40
This file was deleted.

.github/workflows/helm-publish.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ jobs:
2828
with:
2929
registry: ghcr.io
3030
repository: ${{ github.repository_owner }}/charts
31-
name: "cortex-tenant"
32-
path: "./charts/cortex-tenant/"
31+
name: "cortex-proxy"
32+
path: "./charts/cortex-proxy/"
3333
app-version: ${{ steps.extract_version.outputs.version }}
3434
version: ${{ steps.extract_version.outputs.version }}
3535
registry-username: ${{ github.actor }}
3636
registry-password: ${{ secrets.GITHUB_TOKEN }}
3737
update-dependencies: 'false' # Defaults to false
3838
sign-image: 'true'
39-
signature-repository: ghcr.io/${{ github.repository_owner }}/charts/cortex-tenant
39+
signature-repository: ghcr.io/${{ github.repository_owner }}/charts/cortex-proxy
4040
helm-provenance:
4141
needs: publish-helm
4242
permissions:
@@ -45,7 +45,7 @@ jobs:
4545
actions: read # To read the workflow path.
4646
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
4747
with:
48-
image: ghcr.io/${{ github.repository_owner }}/charts/cortex-tenant
48+
image: ghcr.io/${{ github.repository_owner }}/charts/cortex-proxy
4949
digest: "${{ needs.publish-helm.outputs.chart-digest }}"
5050
registry-username: ${{ github.actor }}
5151
secrets:

.goreleaser.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
project_name: capsule
1+
project_name: cortex-proxy
22
env:
33
- COSIGN_EXPERIMENTAL=true
44
- GO111MODULE=on
@@ -38,11 +38,7 @@ release:
3838
- `ghcr.io/projectcapsule/{{ .ProjectName }}:latest`
3939
4040
**Helm Chart**
41-
View this release on [Artifact Hub](https://artifacthub.io/packages/helm/projectcapsule/capsule/{{ .Version }}) or use the OCI helm chart:
42-
43-
- `ghcr.io/projectcapsule/charts/{{ .ProjectName }}:{{ .Version }}`
44-
45-
[Review the Major Changes section first before upgrading to a new version](https://artifacthub.io/packages/helm/projectcapsule/capsule/{{ .Version }}#major-changes)
41+
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/cortex-proxy)](https://artifacthub.io/packages/search?repo=cortex-proxy)
4642
4743
**Kubernetes compatibility**
4844

Makefile

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ GOARCH ?= $(shell go env GOARCH)
66

77
# Defaults
88
REGISTRY ?= ghcr.io
9-
REPOSITORY ?= projectcapsule/cortex-tenant
9+
REPOSITORY ?= projectcapsule/cortex-proxy
1010
GIT_TAG_COMMIT ?= $(shell git rev-parse --short $(VERSION))
1111
GIT_MODIFIED_1 ?= $(shell git diff $(GIT_HEAD_COMMIT) $(GIT_TAG_COMMIT) --quiet && echo "" || echo ".dev")
1212
GIT_MODIFIED_2 ?= $(shell git diff --quiet && echo "" || echo ".dirty")
@@ -120,8 +120,8 @@ ko-publish-all: ko-publish-controller
120120
SRC_ROOT = $(shell git rev-parse --show-toplevel)
121121

122122
helm-controller-version:
123-
$(eval VERSION := $(shell grep 'appVersion:' charts/cortex-tenant/Chart.yaml | awk '{print $$2}'))
124-
$(eval KO_TAGS := $(shell grep 'appVersion:' charts/cortex-tenant/Chart.yaml | awk '{print $$2}'))
123+
$(eval VERSION := $(shell grep 'appVersion:' charts/cortex-proxy/Chart.yaml | awk '{print $$2}'))
124+
$(eval KO_TAGS := $(shell grep 'appVersion:' charts/cortex-proxy/Chart.yaml | awk '{print $$2}'))
125125

126126

127127
helm-docs: helm-doc
@@ -131,7 +131,7 @@ helm-lint: ct
131131
@$(CT) lint --config .github/configs/ct.yaml --validate-yaml=false --all --debug
132132

133133
helm-schema: helm-plugin-schema
134-
cd charts/cortex-tenant && $(HELM) schema -output values.schema.json
134+
cd charts/cortex-proxy && $(HELM) schema -output values.schema.json
135135

136136
helm-test: kind ct
137137
@$(KIND) create cluster --wait=60s --name $(KIND_K8S_NAME) --image=kindest/node:$(KIND_K8S_VERSION)
@@ -172,13 +172,13 @@ e2e-install-addon: e2e-load-image
172172
--dependency-update \
173173
--debug \
174174
--install \
175-
--namespace cortex-tenant \
175+
--namespace monitoring-system \
176176
--create-namespace \
177177
--set 'image.pullPolicy=Never' \
178178
--set "image.tag=$(VERSION)" \
179179
--set args.logLevel=10 \
180-
cortex-tenant \
181-
./charts/cortex-tenant
180+
cortex-proxy \
181+
./charts/cortex-proxy
182182

183183
e2e-install-distro:
184184
@$(KUBECTL) kustomize e2e/objects/flux/ | kubectl apply -f -

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
[!IMPORTANT]
2-
This project is a permanent hard-fork of the origin project.
2+
This project is a permanent hard-fork of the [origin project](https://github.com/blind-oracle/cortex-tenant).
33

44
# Capsule ❤️ Cortex
55

66
![Capsule Cortex](docs/images/logo.png)
77

88
<p align="center">
9-
<a href="https://github.com/projectcapsule/cortex-tenant/releases/latest">
10-
<img alt="GitHub release (latest SemVer)" src="https://img.shields.io/github/v/release/projectcapsule/cortex-tenant?sort=semver">
9+
<a href="https://github.com/projectcapsule/cortex-proxy/releases/latest">
10+
<img alt="GitHub release (latest SemVer)" src="https://img.shields.io/github/v/release/projectcapsule/cortex-proxy?sort=semver">
1111
</a>
1212
<a href="https://artifacthub.io/packages/search?repo=cortex-proxy">
1313
<img src="https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/cortex-proxy" alt="Artifact Hub">
1414
</a>
15-
<a href="https://codecov.io/gh/projectcapsule/cortex-tenant" >
16-
<img src="https://codecov.io/gh/projectcapsule/cortex-tenant/graph/badge.svg?token=F9Bkp6l8zR"/>
15+
<a href="https://codecov.io/gh/projectcapsule/cortex-proxy" >
16+
<img src="https://codecov.io/gh/projectcapsule/cortex-proxy/graph/badge.svg?token=HER3gBKdqU"/>
1717
</a>
1818
</p>
1919

File renamed without changes.
File renamed without changes.

charts/cortex-tenant/Chart.yaml charts/cortex-proxy/Chart.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
apiVersion: v2
2-
name: cortex-tenant
2+
name: cortex-proxy
33
description: Capsule Cortex Tenant
44
type: application
55
# Note: The version is overwritten by the release workflow.
66
version: 0.0.0
77
# Note: The version is overwritten by the release workflow.
88
appVersion: 0.0.0
9-
home: https://github.com/projectcapsule/cortex-tenant
9+
home: https://github.com/projectcapsule/cortex-proxy
1010
icon: https://github.com/projectcapsule/capsule/raw/main/assets/logo/capsule_small.png
1111
keywords:
1212
- kubernetes
@@ -18,4 +18,4 @@ keywords:
1818
- cortex
1919
- prometheus
2020
sources:
21-
- https://github.com/projectcapsule/cortex-tenant
21+
- https://github.com/projectcapsule/cortex-proxy

charts/cortex-tenant/README.md charts/cortex-proxy/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
# Capsule ❤️ Cortex
22

3-
![Logo](https://github.com/projectcapsule/cortex-tenant/blob/main/docs/images/logo.png)
3+
![Logo](https://github.com/projectcapsule/cortex-proxy/blob/main/docs/images/logo.png)
44

55
## Installation
66

77
1. Install Helm Chart:
88

9-
$ helm install cortex-tenant oci://ghcr.io/projectcapsule/charts/cortex-tenant -n monitioring-system
9+
$ helm install cortex-tenant oci://ghcr.io/projectcapsule/charts/cortex-proxy -n monitioring-system
1010

1111
3. Show the status:
1212

1313
$ helm status cortex-tenant -n monitioring-system
1414

1515
4. Upgrade the Chart
1616

17-
$ helm upgrade cortex-tenant oci://ghcr.io/projectcapsule/charts/cortex-tenant --version 0.4.7
17+
$ helm upgrade cortex-tenant oci://ghcr.io/projectcapsule/charts/cortex-proxy --version 0.4.7
1818

1919
5. Uninstall the Chart
2020

charts/cortex-tenant/README.md.gotmpl charts/cortex-proxy/README.md.gotmpl

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
# Capsule ❤️ Cortex
22

3-
![Logo](https://github.com/projectcapsule/cortex-tenant/blob/main/docs/images/logo.png)
3+
![Logo](https://github.com/projectcapsule/cortex-proxy/blob/main/docs/images/logo.png)
44

55
## Installation
66

77
1. Install Helm Chart:
88

9-
$ helm install cortex-tenant oci://ghcr.io/projectcapsule/charts/cortex-tenant -n monitioring-system
9+
$ helm install cortex-tenant oci://ghcr.io/projectcapsule/charts/cortex-proxy -n monitioring-system
1010

1111
3. Show the status:
1212

1313
$ helm status cortex-tenant -n monitioring-system
1414

1515
4. Upgrade the Chart
1616

17-
$ helm upgrade cortex-tenant oci://ghcr.io/projectcapsule/charts/cortex-tenant --version 0.4.7
17+
$ helm upgrade cortex-tenant oci://ghcr.io/projectcapsule/charts/cortex-proxy --version 0.4.7
1818

1919
5. Uninstall the Chart
2020

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

cmd/main.go

+5-6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ import (
66

77
_ "github.com/KimMachineGun/automemlimit"
88
capsulev1beta2 "github.com/projectcapsule/capsule/api/v1beta2"
9+
"github.com/projectcapsule/cortex-proxy/internal/config"
10+
"github.com/projectcapsule/cortex-proxy/internal/controllers"
11+
"github.com/projectcapsule/cortex-proxy/internal/metrics"
12+
"github.com/projectcapsule/cortex-proxy/internal/processor"
13+
"github.com/projectcapsule/cortex-proxy/internal/stores"
914
_ "go.uber.org/automaxprocs"
1015
"k8s.io/apimachinery/pkg/runtime"
1116
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
@@ -16,12 +21,6 @@ import (
1621
"sigs.k8s.io/controller-runtime/pkg/healthz"
1722
"sigs.k8s.io/controller-runtime/pkg/log/zap"
1823
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
19-
20-
"github.com/projectcapsule/cortex-tenant/internal/config"
21-
"github.com/projectcapsule/cortex-tenant/internal/controllers"
22-
"github.com/projectcapsule/cortex-tenant/internal/metrics"
23-
"github.com/projectcapsule/cortex-tenant/internal/processor"
24-
"github.com/projectcapsule/cortex-tenant/internal/stores"
2524
)
2625

2726
var Version string

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/projectcapsule/cortex-tenant
1+
module github.com/projectcapsule/cortex-proxy
22

33
go 1.23.0
44

internal/config/config_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
. "github.com/onsi/ginkgo/v2"
88
. "github.com/onsi/gomega"
99

10-
"github.com/projectcapsule/cortex-tenant/internal/config"
10+
"github.com/projectcapsule/cortex-proxy/internal/config"
1111
)
1212

1313
var _ = Describe("Config Loading", func() {

internal/controllers/reconciler.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ import (
66

77
"github.com/go-logr/logr"
88
capsulev1beta2 "github.com/projectcapsule/capsule/api/v1beta2"
9+
"github.com/projectcapsule/cortex-proxy/internal/metrics"
10+
"github.com/projectcapsule/cortex-proxy/internal/stores"
911
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1012
"k8s.io/apimachinery/pkg/runtime"
1113
ctrl "sigs.k8s.io/controller-runtime"
1214
"sigs.k8s.io/controller-runtime/pkg/client"
13-
14-
"github.com/projectcapsule/cortex-tenant/internal/metrics"
15-
"github.com/projectcapsule/cortex-tenant/internal/stores"
1615
)
1716

1817
// CapsuleArgocdReconciler reconciles a CapsuleArgocd object.

internal/processor/processor.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ import (
1818
"github.com/google/uuid"
1919
me "github.com/hashicorp/go-multierror"
2020
"github.com/pkg/errors"
21+
"github.com/projectcapsule/cortex-proxy/internal/config"
22+
"github.com/projectcapsule/cortex-proxy/internal/metrics"
23+
"github.com/projectcapsule/cortex-proxy/internal/stores"
2124
"github.com/prometheus/prometheus/prompb"
2225
fh "github.com/valyala/fasthttp"
23-
24-
"github.com/projectcapsule/cortex-tenant/internal/config"
25-
"github.com/projectcapsule/cortex-tenant/internal/metrics"
26-
"github.com/projectcapsule/cortex-tenant/internal/stores"
2726
)
2827

2928
type result struct {

internal/processor/processor_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ import (
1515
fh "github.com/valyala/fasthttp"
1616
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1717

18-
"github.com/projectcapsule/cortex-tenant/internal/config"
19-
"github.com/projectcapsule/cortex-tenant/internal/metrics"
20-
"github.com/projectcapsule/cortex-tenant/internal/stores"
18+
"github.com/projectcapsule/cortex-proxy/internal/config"
19+
"github.com/projectcapsule/cortex-proxy/internal/metrics"
20+
"github.com/projectcapsule/cortex-proxy/internal/stores"
2121
)
2222

2323
var _ = Describe("Processor Forwarding", func() {

internal/stores/store_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"testing"
66

77
capsulev1beta2 "github.com/projectcapsule/capsule/api/v1beta2"
8-
"github.com/projectcapsule/cortex-tenant/internal/stores"
8+
"github.com/projectcapsule/cortex-proxy/internal/stores"
99
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1010

1111
. "github.com/onsi/gomega"

0 commit comments

Comments
 (0)