Skip to content

Commit

Permalink
Rename SecretHash to SecretSHA1
Browse files Browse the repository at this point in the history
  • Loading branch information
periklis committed Dec 11, 2023
1 parent 8659a52 commit 625b6f4
Show file tree
Hide file tree
Showing 18 changed files with 25 additions and 25 deletions.
10 changes: 5 additions & 5 deletions operator/internal/handlers/internal/storage/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ func ExtractSecret(s *corev1.Secret, secretType lokiv1.ObjectStorageSecretType)

switch secretType {
case lokiv1.ObjectStorageSecretAzure:
storageOpts.Azure, storageOpts.SecretHash, err = extractAzureConfigSecret(s)
storageOpts.Azure, storageOpts.SecretSHA1, err = extractAzureConfigSecret(s)
case lokiv1.ObjectStorageSecretGCS:
storageOpts.GCS, storageOpts.SecretHash, err = extractGCSConfigSecret(s)
storageOpts.GCS, storageOpts.SecretSHA1, err = extractGCSConfigSecret(s)
case lokiv1.ObjectStorageSecretS3:
storageOpts.S3, storageOpts.SecretHash, err = extractS3ConfigSecret(s)
storageOpts.S3, storageOpts.SecretSHA1, err = extractS3ConfigSecret(s)
case lokiv1.ObjectStorageSecretSwift:
storageOpts.Swift, storageOpts.SecretHash, err = extractSwiftConfigSecret(s)
storageOpts.Swift, storageOpts.SecretSHA1, err = extractSwiftConfigSecret(s)
case lokiv1.ObjectStorageSecretAlibabaCloud:
storageOpts.AlibabaCloud, storageOpts.SecretHash, err = extractAlibabaCloudConfigSecret(s)
storageOpts.AlibabaCloud, storageOpts.SecretSHA1, err = extractAlibabaCloudConfigSecret(s)
default:
return nil, kverrors.New("unknown secret type", "type", secretType)
}
Expand Down
8 changes: 4 additions & 4 deletions operator/internal/handlers/internal/storage/secrets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func TestAzureExtract(t *testing.T) {
if !tst.wantErr {
require.NoError(t, err)
require.NotEmpty(t, opts.SecretName)
require.NotEmpty(t, opts.SecretHash)
require.NotEmpty(t, opts.SecretSHA1)
require.Equal(t, opts.SharedStore, lokiv1.ObjectStorageSecretAzure)
}
if tst.wantErr {
Expand Down Expand Up @@ -279,7 +279,7 @@ func TestS3Extract(t *testing.T) {
if !tst.wantErr {
require.NoError(t, err)
require.NotEmpty(t, opts.SecretName)
require.NotEmpty(t, opts.SecretHash)
require.NotEmpty(t, opts.SecretSHA1)
require.Equal(t, opts.SharedStore, lokiv1.ObjectStorageSecretS3)
}
if tst.wantErr {
Expand Down Expand Up @@ -428,7 +428,7 @@ func TestSwiftExtract(t *testing.T) {
if !tst.wantErr {
require.NoError(t, err)
require.NotEmpty(t, opts.SecretName)
require.NotEmpty(t, opts.SecretHash)
require.NotEmpty(t, opts.SecretSHA1)
require.Equal(t, opts.SharedStore, lokiv1.ObjectStorageSecretSwift)
}
if tst.wantErr {
Expand Down Expand Up @@ -502,7 +502,7 @@ func TestAlibabaCloudExtract(t *testing.T) {
if !tst.wantErr {
require.NoError(t, err)
require.NotEmpty(t, opts.SecretName)
require.NotEmpty(t, opts.SecretHash)
require.NotEmpty(t, opts.SecretSHA1)
require.Equal(t, opts.SharedStore, lokiv1.ObjectStorageSecretAlibabaCloud)
}
if tst.wantErr {
Expand Down
2 changes: 1 addition & 1 deletion operator/internal/manifests/compactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func BuildCompactor(opts Options) ([]client.Object, error) {
// NewCompactorStatefulSet creates a statefulset object for a compactor.
func NewCompactorStatefulSet(opts Options) *appsv1.StatefulSet {
l := ComponentLabels(LabelCompactorComponent, opts.Name)
a := commonAnnotations(opts.ConfigSHA1, opts.ObjectStorage.SecretHash, opts.CertRotationRequiredAt)
a := commonAnnotations(opts.ConfigSHA1, opts.ObjectStorage.SecretSHA1, opts.CertRotationRequiredAt)
podSpec := corev1.PodSpec{
Affinity: configureAffinity(LabelCompactorComponent, opts.Name, opts.Gates.DefaultNodeAffinity, opts.Stack.Template.Compactor),
Volumes: []corev1.Volume{
Expand Down
2 changes: 1 addition & 1 deletion operator/internal/manifests/compactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func TestNewCompactorStatefulSet_HasTemplateObjectStorageHashAnnotation(t *testi
Name: "abcd",
Namespace: "efgh",
ObjectStorage: storage.Options{
SecretHash: "deadbeef",
SecretSHA1: "deadbeef",
},
Stack: lokiv1.LokiStackSpec{
StorageClassName: "standard",
Expand Down
2 changes: 1 addition & 1 deletion operator/internal/manifests/distributor.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func BuildDistributor(opts Options) ([]client.Object, error) {
// NewDistributorDeployment creates a deployment object for a distributor
func NewDistributorDeployment(opts Options) *appsv1.Deployment {
l := ComponentLabels(LabelDistributorComponent, opts.Name)
a := commonAnnotations(opts.ConfigSHA1, opts.ObjectStorage.SecretHash, opts.CertRotationRequiredAt)
a := commonAnnotations(opts.ConfigSHA1, opts.ObjectStorage.SecretSHA1, opts.CertRotationRequiredAt)
podSpec := corev1.PodSpec{
Affinity: configureAffinity(LabelDistributorComponent, opts.Name, opts.Gates.DefaultNodeAffinity, opts.Stack.Template.Distributor),
Volumes: []corev1.Volume{
Expand Down
2 changes: 1 addition & 1 deletion operator/internal/manifests/distributor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func TestNewDistributorDeployment_HasTemplateObjectStoreHashAnnotation(t *testin
Name: "abcd",
Namespace: "efgh",
ObjectStorage: storage.Options{
SecretHash: "deadbeef",
SecretSHA1: "deadbeef",
},
Stack: lokiv1.LokiStackSpec{
Template: &lokiv1.LokiTemplateSpec{
Expand Down
2 changes: 1 addition & 1 deletion operator/internal/manifests/gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func TestNewGatewayDeployment_HasNotTemplateObjectStoreHashAnnotation(t *testing
Name: "abcd",
Namespace: "efgh",
ObjectStorage: storage.Options{
SecretHash: "deadbeef",
SecretSHA1: "deadbeef",
},
Stack: lokiv1.LokiStackSpec{
Template: &lokiv1.LokiTemplateSpec{
Expand Down
2 changes: 1 addition & 1 deletion operator/internal/manifests/indexgateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func BuildIndexGateway(opts Options) ([]client.Object, error) {
// NewIndexGatewayStatefulSet creates a statefulset object for an index-gateway
func NewIndexGatewayStatefulSet(opts Options) *appsv1.StatefulSet {
l := ComponentLabels(LabelIndexGatewayComponent, opts.Name)
a := commonAnnotations(opts.ConfigSHA1, opts.ObjectStorage.SecretHash, opts.CertRotationRequiredAt)
a := commonAnnotations(opts.ConfigSHA1, opts.ObjectStorage.SecretSHA1, opts.CertRotationRequiredAt)
podSpec := corev1.PodSpec{
Affinity: configureAffinity(LabelIndexGatewayComponent, opts.Name, opts.Gates.DefaultNodeAffinity, opts.Stack.Template.IndexGateway),
Volumes: []corev1.Volume{
Expand Down
2 changes: 1 addition & 1 deletion operator/internal/manifests/indexgateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestNewIndexGatewayStatefulSet_HasTemplateObjectStoreHashAnnotation(t *test
Name: "abcd",
Namespace: "efgh",
ObjectStorage: storage.Options{
SecretHash: "deadbeef",
SecretSHA1: "deadbeef",
},
Stack: lokiv1.LokiStackSpec{
StorageClassName: "standard",
Expand Down
2 changes: 1 addition & 1 deletion operator/internal/manifests/ingester.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func BuildIngester(opts Options) ([]client.Object, error) {
// NewIngesterStatefulSet creates a deployment object for an ingester
func NewIngesterStatefulSet(opts Options) *appsv1.StatefulSet {
l := ComponentLabels(LabelIngesterComponent, opts.Name)
a := commonAnnotations(opts.ConfigSHA1, opts.ObjectStorage.SecretHash, opts.CertRotationRequiredAt)
a := commonAnnotations(opts.ConfigSHA1, opts.ObjectStorage.SecretSHA1, opts.CertRotationRequiredAt)
podSpec := corev1.PodSpec{
Affinity: configureAffinity(LabelIngesterComponent, opts.Name, opts.Gates.DefaultNodeAffinity, opts.Stack.Template.Ingester),
Volumes: []corev1.Volume{
Expand Down
2 changes: 1 addition & 1 deletion operator/internal/manifests/ingester_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestNewIngesterStatefulSet_HasTemplateObjectStoreHashAnnotation(t *testing.
Name: "abcd",
Namespace: "efgh",
ObjectStorage: storage.Options{
SecretHash: "deadbeef",
SecretSHA1: "deadbeef",
},
Stack: lokiv1.LokiStackSpec{
StorageClassName: "standard",
Expand Down
2 changes: 1 addition & 1 deletion operator/internal/manifests/querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func BuildQuerier(opts Options) ([]client.Object, error) {
// NewQuerierDeployment creates a deployment object for a querier
func NewQuerierDeployment(opts Options) *appsv1.Deployment {
l := ComponentLabels(LabelQuerierComponent, opts.Name)
a := commonAnnotations(opts.ConfigSHA1, opts.ObjectStorage.SecretHash, opts.CertRotationRequiredAt)
a := commonAnnotations(opts.ConfigSHA1, opts.ObjectStorage.SecretSHA1, opts.CertRotationRequiredAt)
podSpec := corev1.PodSpec{
Affinity: configureAffinity(LabelQuerierComponent, opts.Name, opts.Gates.DefaultNodeAffinity, opts.Stack.Template.Querier),
Volumes: []corev1.Volume{
Expand Down
2 changes: 1 addition & 1 deletion operator/internal/manifests/querier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestNewQuerierDeployment_HasTemplateObjectStoreHashAnnotation(t *testing.T)
Name: "abcd",
Namespace: "efgh",
ObjectStorage: storage.Options{
SecretHash: "deadbeef",
SecretSHA1: "deadbeef",
},
Stack: lokiv1.LokiStackSpec{
StorageClassName: "standard",
Expand Down
2 changes: 1 addition & 1 deletion operator/internal/manifests/query-frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func BuildQueryFrontend(opts Options) ([]client.Object, error) {
// NewQueryFrontendDeployment creates a deployment object for a query-frontend
func NewQueryFrontendDeployment(opts Options) *appsv1.Deployment {
l := ComponentLabels(LabelQueryFrontendComponent, opts.Name)
a := commonAnnotations(opts.ConfigSHA1, opts.ObjectStorage.SecretHash, opts.CertRotationRequiredAt)
a := commonAnnotations(opts.ConfigSHA1, opts.ObjectStorage.SecretSHA1, opts.CertRotationRequiredAt)
podSpec := corev1.PodSpec{
Affinity: configureAffinity(LabelQueryFrontendComponent, opts.Name, opts.Gates.DefaultNodeAffinity, opts.Stack.Template.QueryFrontend),
Volumes: []corev1.Volume{
Expand Down
2 changes: 1 addition & 1 deletion operator/internal/manifests/query-frontend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func TestNewQueryFrontendDeployment_HasTemplateObjectStoreHashAnnotation(t *test
Name: "abcd",
Namespace: "efgh",
ObjectStorage: storage.Options{
SecretHash: "deadbeef",
SecretSHA1: "deadbeef",
},
Stack: lokiv1.LokiStackSpec{
Template: &lokiv1.LokiTemplateSpec{
Expand Down
2 changes: 1 addition & 1 deletion operator/internal/manifests/ruler.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func NewRulerStatefulSet(opts Options) *appsv1.StatefulSet {
}

l := ComponentLabels(LabelRulerComponent, opts.Name)
a := commonAnnotations(opts.ConfigSHA1, opts.ObjectStorage.SecretHash, opts.CertRotationRequiredAt)
a := commonAnnotations(opts.ConfigSHA1, opts.ObjectStorage.SecretSHA1, opts.CertRotationRequiredAt)
podSpec := corev1.PodSpec{
Affinity: configureAffinity(LabelRulerComponent, opts.Name, opts.Gates.DefaultNodeAffinity, opts.Stack.Template.Ruler),
Volumes: []corev1.Volume{
Expand Down
2 changes: 1 addition & 1 deletion operator/internal/manifests/ruler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestNewRulerStatefulSet_HasTemplateObjectStoreHashAnnotation(t *testing.T)
Name: "abcd",
Namespace: "efgh",
ObjectStorage: storage.Options{
SecretHash: "deadbeef",
SecretSHA1: "deadbeef",
},
Stack: lokiv1.LokiStackSpec{
StorageClassName: "standard",
Expand Down
2 changes: 1 addition & 1 deletion operator/internal/manifests/storage/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type Options struct {
AlibabaCloud *AlibabaCloudStorageConfig

SecretName string
SecretHash string
SecretSHA1 string
TLS *TLSConfig
}

Expand Down

0 comments on commit 625b6f4

Please sign in to comment.