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

refactor(operator)!: Rename loki api go module #14568

Merged
merged 2 commits into from
Oct 22, 2024
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
2 changes: 1 addition & 1 deletion operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ oci-push-calculator: ## Push the calculator image
##@ Website
TYPES_TARGET := $(shell find api/loki -type f -iname "*_types.go")
docs/operator/api.md: $(TYPES_TARGET) $(GEN_CRD_API_REFERENCE_DOCS)
$(GEN_CRD_API_REFERENCE_DOCS) -api-dir "github.com/grafana/loki/operator/apis/loki/" -config "$(PWD)/config/docs/config.json" -template-dir "$(PWD)/config/docs/templates" -out-file "$(PWD)/$@"
$(GEN_CRD_API_REFERENCE_DOCS) -api-dir "github.com/grafana/loki/operator/api/loki/" -config "$(PWD)/config/docs/config.json" -template-dir "$(PWD)/config/docs/templates" -out-file "$(PWD)/$@"
sed -i 's/+docs:/ docs:/' $@
sed -i 's/+parent:/ parent:/' $@
sed -i 's/##/\n##/' $@
Expand Down
2 changes: 1 addition & 1 deletion operator/api/loki/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/grafana/loki/operator/apis/loki
module github.com/grafana/loki/operator/api/loki

go 1.19

Expand Down
2 changes: 1 addition & 1 deletion operator/api/loki/v1beta1/alertingrule_types.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package v1beta1

import (
v1 "github.com/grafana/loki/operator/apis/loki/v1"
v1 "github.com/grafana/loki/operator/api/loki/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/conversion"
)
Expand Down
4 changes: 2 additions & 2 deletions operator/api/loki/v1beta1/alertingrule_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package v1beta1_test
import (
"testing"

v1 "github.com/grafana/loki/operator/apis/loki/v1"
"github.com/grafana/loki/operator/apis/loki/v1beta1"
v1 "github.com/grafana/loki/operator/api/loki/v1"
"github.com/grafana/loki/operator/api/loki/v1beta1"
"github.com/stretchr/testify/require"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down
2 changes: 1 addition & 1 deletion operator/api/loki/v1beta1/lokistack_types.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package v1beta1

import (
v1 "github.com/grafana/loki/operator/apis/loki/v1"
v1 "github.com/grafana/loki/operator/api/loki/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/conversion"
Expand Down
4 changes: 2 additions & 2 deletions operator/api/loki/v1beta1/lokistack_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

v1 "github.com/grafana/loki/operator/apis/loki/v1"
"github.com/grafana/loki/operator/apis/loki/v1beta1"
v1 "github.com/grafana/loki/operator/api/loki/v1"
"github.com/grafana/loki/operator/api/loki/v1beta1"
)

func TestConvertToV1_LokiStack(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion operator/api/loki/v1beta1/recordingrule_types.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package v1beta1

import (
v1 "github.com/grafana/loki/operator/apis/loki/v1"
v1 "github.com/grafana/loki/operator/api/loki/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/conversion"
)
Expand Down
4 changes: 2 additions & 2 deletions operator/api/loki/v1beta1/recordingrule_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package v1beta1_test
import (
"testing"

v1 "github.com/grafana/loki/operator/apis/loki/v1"
"github.com/grafana/loki/operator/apis/loki/v1beta1"
v1 "github.com/grafana/loki/operator/api/loki/v1"
"github.com/grafana/loki/operator/api/loki/v1beta1"
"github.com/stretchr/testify/require"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down
2 changes: 1 addition & 1 deletion operator/api/loki/v1beta1/rulerconfig_types.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package v1beta1

import (
v1 "github.com/grafana/loki/operator/apis/loki/v1"
v1 "github.com/grafana/loki/operator/api/loki/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/conversion"
)
Expand Down
4 changes: 2 additions & 2 deletions operator/api/loki/v1beta1/rulerconfig_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package v1beta1_test
import (
"testing"

v1 "github.com/grafana/loki/operator/apis/loki/v1"
"github.com/grafana/loki/operator/apis/loki/v1beta1"
v1 "github.com/grafana/loki/operator/api/loki/v1"
"github.com/grafana/loki/operator/api/loki/v1beta1"
"github.com/stretchr/testify/require"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/ptr"
Expand Down
2 changes: 1 addition & 1 deletion operator/cmd/loki-broker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"sigs.k8s.io/yaml"

configv1 "github.com/grafana/loki/operator/api/config/v1"
lokiv1 "github.com/grafana/loki/operator/apis/loki/v1"
lokiv1 "github.com/grafana/loki/operator/api/loki/v1"
"github.com/grafana/loki/operator/internal/manifests"
"github.com/grafana/loki/operator/internal/manifests/storage"
)
Expand Down
4 changes: 2 additions & 2 deletions operator/cmd/loki-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
runtimemetrics "sigs.k8s.io/controller-runtime/pkg/metrics"

ctrlconfigv1 "github.com/grafana/loki/operator/api/config/v1"
lokiv1 "github.com/grafana/loki/operator/apis/loki/v1"
lokiv1beta1 "github.com/grafana/loki/operator/apis/loki/v1beta1"
lokiv1 "github.com/grafana/loki/operator/api/loki/v1"
lokiv1beta1 "github.com/grafana/loki/operator/api/loki/v1beta1"
"github.com/grafana/loki/operator/internal/config"
lokictrl "github.com/grafana/loki/operator/internal/controller/loki"
"github.com/grafana/loki/operator/internal/metrics"
Expand Down
12 changes: 6 additions & 6 deletions operator/config/docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
"docsURLTemplate": "https://pkg.go.dev/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1#JSON"
},
{
"typeMatchPrefix": "^github\\.com/grafana/loki/operator/apis/loki/v1",
"typeMatchPrefix": "^github\\.com/grafana/loki/operator/api/loki/v1",
"docsURLTemplate": "../v1/api.md#loki.grafana.com/v1.{{ .TypeIdentifier}}"
},
{
"typeMatchPrefix": "^github\\.com/grafana/loki/operator/apis/loki/v1beta1",
"typeMatchPrefix": "^github\\.com/grafana/loki/operator/api/loki/v1beta1",
"docsURLTemplate": "../v1beta1/api.md#loki-grafana.com-v1beta1-{{ .TypeIdentifier}}"
},
{
"typeMatchPrefix": "^github\\.com/grafana/loki/operator/apis/loki/config/v1",
"typeMatchPrefix": "^github\\.com/grafana/loki/operator/api/loki/config/v1",
"docsURLTemplate": "../v1/feature-gates.md#loki-grafana-com-v1-{{ .TypeIdentifier}}"
},
{
Expand All @@ -51,9 +51,9 @@
"k8s.io/apimachinery/pkg/apis/": "Kubernetes ",
"k8s.io/component-base/config/": "Kubernetes ",
"sigs.k8s.io/controller-runtime/pkg/config/": "K8S Controller-runtime ",
"github.com/grafana/loki/operator/apis/loki/v1": "Loki Operator v1",
"github.com/grafana/loki/operator/apis/loki/v1beta1": "Loki Operator v1beta1",
"github.com/grafana/loki/operator/apis/loki/config/v1": "Feature Gates"
"github.com/grafana/loki/operator/api/loki/v1": "Loki Operator v1",
"github.com/grafana/loki/operator/api/loki/v1beta1": "Loki Operator v1beta1",
"github.com/grafana/loki/operator/api/loki/config/v1": "Feature Gates"
},
"markdownDisabled": false
}
12 changes: 6 additions & 6 deletions operator/docs/operator/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ BlockedQueryTypes
</table>

## BlockedQueryTypes { #loki-grafana-com-v1-BlockedQueryTypes }
(<code>[]github.com/grafana/loki/operator/apis/loki/v1.BlockedQueryType</code> alias)
(<code>[]github.com/grafana/loki/operator/api/loki/v1.BlockedQueryType</code> alias)
<p>
(<em>Appears on:</em><a href="#loki-grafana-com-v1-BlockedQuerySpec">BlockedQuerySpec</a>)
</p>
Expand Down Expand Up @@ -1461,7 +1461,7 @@ LimitsTemplateSpec
<code>tenants</code><br/>
<em>
<a href="#loki-grafana-com-v1-PerTenantLimitsTemplateSpec">
map[string]github.com/grafana/loki/operator/apis/loki/v1.PerTenantLimitsTemplateSpec
map[string]github.com/grafana/loki/operator/api/loki/v1.PerTenantLimitsTemplateSpec
</a>
</em>
</td>
Expand Down Expand Up @@ -3405,7 +3405,7 @@ At least one container is still running or is in the process of being restarted.
</table>

## PodStatusMap { #loki-grafana-com-v1-PodStatusMap }
(<code>map[github.com/grafana/loki/operator/apis/loki/v1.PodStatus][]string</code> alias)
(<code>map[github.com/grafana/loki/operator/api/loki/v1.PodStatus][]string</code> alias)
<p>
(<em>Appears on:</em><a href="#loki-grafana-com-v1-LokiStackComponentStatus">LokiStackComponentStatus</a>)
</p>
Expand Down Expand Up @@ -4594,7 +4594,7 @@ RemoteWriteSpec
<code>overrides</code><br/>
<em>
<a href="#loki-grafana-com-v1-RulerOverrides">
map[string]github.com/grafana/loki/operator/apis/loki/v1.RulerOverrides
map[string]github.com/grafana/loki/operator/api/loki/v1.RulerOverrides
</a>
</em>
</td>
Expand Down Expand Up @@ -5967,7 +5967,7 @@ LimitsTemplateSpec
<code>tenants</code><br/>
<em>
<a href="#loki-grafana-com-v1beta1-LimitsTemplateSpec">
map[string]github.com/grafana/loki/operator/apis/loki/v1beta1.LimitsTemplateSpec
map[string]github.com/grafana/loki/operator/api/loki/v1beta1.LimitsTemplateSpec
</a>
</em>
</td>
Expand Down Expand Up @@ -8188,7 +8188,7 @@ RemoteWriteSpec
<code>overrides</code><br/>
<em>
<a href="#loki-grafana-com-v1beta1-RulerOverrides">
map[string]github.com/grafana/loki/operator/apis/loki/v1beta1.RulerOverrides
map[string]github.com/grafana/loki/operator/api/loki/v1beta1.RulerOverrides
</a>
</em>
</td>
Expand Down
4 changes: 2 additions & 2 deletions operator/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.6.0
github.com/grafana/loki v1.6.2-0.20230403212622-90888a0cc737
github.com/grafana/loki/operator/apis/loki v0.0.0-00010101000000-000000000000
github.com/grafana/loki/operator/api/loki v0.0.0-00010101000000-000000000000
github.com/imdario/mergo v0.3.16
github.com/maxbrunsfeld/counterfeiter/v6 v6.9.0
github.com/openshift/api v0.0.0-20240912201240-0a8800162826 // release-4.17
Expand Down Expand Up @@ -162,7 +162,7 @@ require (
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
)

replace github.com/grafana/loki/operator/apis/loki => ./api/loki
replace github.com/grafana/loki/operator/api/loki => ./api/loki

// Replace v2.4.0+incompatible indirect refs with v5.1.1 for compatibility with google.golang.org/grpc >=v1.56.3
replace github.com/sercand/kuberesolver => github.com/sercand/kuberesolver/v5 v5.1.1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/handler"

lokiv1 "github.com/grafana/loki/operator/apis/loki/v1"
lokiv1 "github.com/grafana/loki/operator/api/loki/v1"
"github.com/grafana/loki/operator/internal/controller/loki/internal/lokistack"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"

configv1 "github.com/grafana/loki/operator/api/config/v1"
lokiv1 "github.com/grafana/loki/operator/apis/loki/v1"
lokiv1 "github.com/grafana/loki/operator/api/loki/v1"
"github.com/grafana/loki/operator/internal/certrotation"
"github.com/grafana/loki/operator/internal/controller/loki/internal/lokistack"
"github.com/grafana/loki/operator/internal/controller/loki/internal/management/state"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/require"
corev1 "k8s.io/api/core/v1"

lokiv1 "github.com/grafana/loki/operator/apis/loki/v1"
lokiv1 "github.com/grafana/loki/operator/api/loki/v1"
"github.com/grafana/loki/operator/internal/external/k8s/k8sfakes"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/predicate"

lokiv1 "github.com/grafana/loki/operator/apis/loki/v1"
lokiv1 "github.com/grafana/loki/operator/api/loki/v1"
"github.com/grafana/loki/operator/internal/handlers"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
apierrors "k8s.io/apimachinery/pkg/api/errors"
"sigs.k8s.io/controller-runtime/pkg/client"

lokiv1 "github.com/grafana/loki/operator/apis/loki/v1"
lokiv1 "github.com/grafana/loki/operator/api/loki/v1"
"github.com/grafana/loki/operator/internal/external/k8s"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
apierrors "k8s.io/apimachinery/pkg/api/errors"
"sigs.k8s.io/controller-runtime/pkg/client"

lokiv1 "github.com/grafana/loki/operator/apis/loki/v1"
lokiv1 "github.com/grafana/loki/operator/api/loki/v1"
"github.com/grafana/loki/operator/internal/external/k8s"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"k8s.io/apimachinery/pkg/labels"
"sigs.k8s.io/controller-runtime/pkg/client"

lokiv1 "github.com/grafana/loki/operator/apis/loki/v1"
lokiv1 "github.com/grafana/loki/operator/api/loki/v1"
"github.com/grafana/loki/operator/internal/external/k8s"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"k8s.io/client-go/util/retry"
"sigs.k8s.io/controller-runtime/pkg/client"

lokiv1 "github.com/grafana/loki/operator/apis/loki/v1"
lokiv1 "github.com/grafana/loki/operator/api/loki/v1"
"github.com/grafana/loki/operator/internal/external/k8s"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
apierrors "k8s.io/apimachinery/pkg/api/errors"
ctrl "sigs.k8s.io/controller-runtime"

lokiv1 "github.com/grafana/loki/operator/apis/loki/v1"
lokiv1 "github.com/grafana/loki/operator/api/loki/v1"
"github.com/grafana/loki/operator/internal/external/k8s"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"

lokiv1 "github.com/grafana/loki/operator/apis/loki/v1"
lokiv1 "github.com/grafana/loki/operator/api/loki/v1"
"github.com/grafana/loki/operator/internal/external/k8s/k8sfakes"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/reconcile"

configv1 "github.com/grafana/loki/operator/api/config/v1"
lokiv1 "github.com/grafana/loki/operator/apis/loki/v1"
lokiv1 "github.com/grafana/loki/operator/api/loki/v1"
"github.com/grafana/loki/operator/internal/config"
"github.com/grafana/loki/operator/internal/controller/loki/internal/management/state"
"github.com/grafana/loki/operator/internal/external/k8s"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"

configv1 "github.com/grafana/loki/operator/api/config/v1"
lokiv1 "github.com/grafana/loki/operator/apis/loki/v1"
lokiv1 "github.com/grafana/loki/operator/api/loki/v1"
"github.com/grafana/loki/operator/internal/external/k8s/k8sfakes"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/handler"
"sigs.k8s.io/controller-runtime/pkg/predicate"

lokiv1 "github.com/grafana/loki/operator/apis/loki/v1"
lokiv1 "github.com/grafana/loki/operator/api/loki/v1"
"github.com/grafana/loki/operator/internal/external/k8s"
"github.com/grafana/loki/operator/internal/handlers"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/handler"

lokiv1 "github.com/grafana/loki/operator/apis/loki/v1"
lokiv1 "github.com/grafana/loki/operator/api/loki/v1"
"github.com/grafana/loki/operator/internal/controller/loki/internal/lokistack"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"

lokiv1 "github.com/grafana/loki/operator/apis/loki/v1"
lokiv1 "github.com/grafana/loki/operator/api/loki/v1"
"github.com/grafana/loki/operator/internal/controller/loki/internal/lokistack"
)

Expand Down
2 changes: 1 addition & 1 deletion operator/internal/handlers/credentialsrequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
ctrlutil "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"

lokiv1 "github.com/grafana/loki/operator/apis/loki/v1"
lokiv1 "github.com/grafana/loki/operator/api/loki/v1"
"github.com/grafana/loki/operator/internal/config"
"github.com/grafana/loki/operator/internal/external/k8s"
"github.com/grafana/loki/operator/internal/manifests"
Expand Down
2 changes: 1 addition & 1 deletion operator/internal/handlers/credentialsrequest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"

lokiv1 "github.com/grafana/loki/operator/apis/loki/v1"
lokiv1 "github.com/grafana/loki/operator/api/loki/v1"
"github.com/grafana/loki/operator/internal/config"
"github.com/grafana/loki/operator/internal/external/k8s/k8sfakes"
)
Expand Down
2 changes: 1 addition & 1 deletion operator/internal/handlers/dashboards_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"

lokiv1 "github.com/grafana/loki/operator/apis/loki/v1"
lokiv1 "github.com/grafana/loki/operator/api/loki/v1"
"github.com/grafana/loki/operator/internal/external/k8s/k8sfakes"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"

lokiv1 "github.com/grafana/loki/operator/apis/loki/v1"
lokiv1 "github.com/grafana/loki/operator/api/loki/v1"
"github.com/grafana/loki/operator/internal/certrotation"
"github.com/grafana/loki/operator/internal/external/k8s"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"

lokiv1 "github.com/grafana/loki/operator/apis/loki/v1"
lokiv1 "github.com/grafana/loki/operator/api/loki/v1"
"github.com/grafana/loki/operator/internal/external/k8s/k8sfakes"
)

Expand Down
Loading
Loading