Skip to content

Commit

Permalink
Merge pull request #442 from arcolife/unused-vars
Browse files Browse the repository at this point in the history
golangci-lint - remove unused vars
  • Loading branch information
marccampbell committed May 5, 2021
2 parents 77f9896 + 5ef39b9 commit d77a333
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 44 deletions.
40 changes: 0 additions & 40 deletions pkg/controller/migration/migration_controller.go
Expand Up @@ -21,13 +21,9 @@ import (
"time"

"github.com/pkg/errors"
databasesv1alpha4 "github.com/schemahero/schemahero/pkg/apis/databases/v1alpha4"
schemasv1alpha4 "github.com/schemahero/schemahero/pkg/apis/schemas/v1alpha4"
"github.com/schemahero/schemahero/pkg/logger"
corev1 "k8s.io/api/core/v1"
kuberneteserrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
kubeinformers "k8s.io/client-go/informers"
"k8s.io/client-go/kubernetes"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down Expand Up @@ -123,39 +119,3 @@ func (r *ReconcileMigration) getInstance(request reconcile.Request) (*schemasv1a

return v1alpha4instance, nil
}

func (r *ReconcileMigration) readConnectionURI(namespace string, valueOrValueFrom databasesv1alpha4.ValueOrValueFrom) (string, error) {
if valueOrValueFrom.Value != "" {
return valueOrValueFrom.Value, nil
}

if valueOrValueFrom.ValueFrom == nil {
return "", errors.New("value and valueFrom cannot both be nil/empty")
}

if valueOrValueFrom.ValueFrom.SecretKeyRef != nil {
secret := &corev1.Secret{}
secretNamespacedName := types.NamespacedName{
Name: valueOrValueFrom.ValueFrom.SecretKeyRef.Name,
Namespace: namespace,
}

if err := r.Get(context.Background(), secretNamespacedName, secret); err != nil {
if kuberneteserrors.IsNotFound(err) {
return "", errors.New("table secret not found")
} else {
return "", errors.Wrap(err, "failed to get existing connection secret")
}
}

return string(secret.Data[valueOrValueFrom.ValueFrom.SecretKeyRef.Key]), nil
}

if valueOrValueFrom.ValueFrom.Vault != nil {
// this feels wrong, but also doesn't make sense to return a
// a URI ref as a connection URI?
return "", nil
}

return "", errors.New("unable to find supported valueFrom")
}
4 changes: 0 additions & 4 deletions pkg/database/cassandra/alias.go
@@ -1,9 +1,5 @@
package cassandra

var unparameterizedColumnTypes = []string{
// TODO
}

func unaliasUnparameterizedColumnType(requestedType string) string {
switch requestedType {
case "varchar":
Expand Down

0 comments on commit d77a333

Please sign in to comment.