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

Enable misspell, nestif golang linter #2240

Merged
merged 44 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
41261a0
Enable gocyclo linter
ankitjain235 Aug 3, 2023
118bc8a
Enable gocritic linter
ankitjain235 Aug 3, 2023
9fe8ef0
Fix typo for linters-settings, fix gocyclo lint failures
ankitjain235 Aug 3, 2023
88f1097
Add lll linter
ankitjain235 Aug 3, 2023
cf599c9
Add nakedret linter
ankitjain235 Aug 3, 2023
4c91b50
Enable dupl linter
ankitjain235 Aug 3, 2023
54d1d5e
Enable exportloopref linter
ankitjain235 Aug 3, 2023
ad04108
Enable importas linter
ankitjain235 Aug 3, 2023
953121f
Enable misspell linter
ankitjain235 Aug 3, 2023
605f039
Enable nestif linter
ankitjain235 Aug 3, 2023
31e838f
Fix minor typo
ankitjain235 Aug 7, 2023
b4cf462
Merge master, resolve conflicts
ankitjain235 Oct 3, 2023
2f1bbe4
Update new lint misses, add TODO for lint disables
ankitjain235 Oct 3, 2023
ef78a07
Merge master, resolve conflicts
ankitjain235 Oct 3, 2023
62b8959
Merge master, resolve conflicts
ankitjain235 Oct 3, 2023
41933d9
Merge master, resolve conflicts
ankitjain235 Oct 3, 2023
9c3b9a1
Merge master, resolve conflicts
ankitjain235 Oct 3, 2023
44a39cb
Fix misspell lint failure
ankitjain235 Oct 3, 2023
a874943
Merge master, resolve conflicts
ankitjain235 Nov 29, 2023
612154b
Apply linter to new changes
ankitjain235 Nov 29, 2023
0007316
Merge master, resolve conflicts
ankitjain235 Nov 29, 2023
7a3945a
Fix merge issues
ankitjain235 Nov 29, 2023
75b4f9d
Merge parent, resolve conflicts
ankitjain235 Nov 29, 2023
bc30421
Merge parent, resolve conflicts
ankitjain235 Nov 29, 2023
6695929
Merge master, resolve conflicts
ankitjain235 Dec 4, 2023
8c38dc0
Merge branch 'enable-linters-2' into enable-linters-3
ankitjain235 Dec 4, 2023
d522754
Add missing newlint
ankitjain235 Dec 4, 2023
32f0cae
Merge parent, resolve conflicts
ankitjain235 Dec 4, 2023
fded60e
Add explanation for ignoring dupl linter
ankitjain235 Dec 4, 2023
3f68dab
Merge branch 'enable-linters-2' into enable-linters-3
ankitjain235 Dec 4, 2023
08e0240
Merge branch 'enable-linters-3' into enable-linters-4
ankitjain235 Dec 4, 2023
e30c1ce
Remove unnecessary comment
ankitjain235 Dec 4, 2023
5b6234c
Merge branch 'master' into enable-linters-2
ankitjain235 Dec 6, 2023
5e97339
Address review comments
ankitjain235 Dec 18, 2023
da05972
Address review comments - move args
ankitjain235 Dec 19, 2023
a8795b2
Merge branch 'master' into enable-linters-2
ankitjain235 Dec 19, 2023
95d4b08
Merge parent, resolve conflicts
ankitjain235 Dec 19, 2023
7e7f3bf
Merge parent, resolve conflicts
ankitjain235 Dec 19, 2023
446c437
Temporarily disable depguard linter, lint fix
ankitjain235 Dec 19, 2023
8727b06
Merge branch 'enable-linters-2' into enable-linters-3
ankitjain235 Dec 19, 2023
a435fdf
Merge branch 'enable-linters-3' into enable-linters-4
ankitjain235 Dec 19, 2023
74180ac
Fix merge error
ankitjain235 Dec 19, 2023
722b3f8
Merge master, resolve conflicts
ankitjain235 Dec 21, 2023
b7c7b3a
Fix error message in test
ankitjain235 Dec 21, 2023
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
38 changes: 38 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@ linters:
- whitespace
- gocognit
- unparam
- gocyclo
- gocritic
- lll
- nakedret
- asciicheck
- depguard
- dogsled
- dupl
- exportloopref
- importas
# - stylecheck It needs a lot of changes
ankitjain235 marked this conversation as resolved.
Show resolved Hide resolved
- misspell
- nestif

run:
timeout: 10m # golangci-lint run's timeout.
Expand All @@ -25,7 +38,32 @@ issues:
linters:
- errcheck # Errors may be ignored in tests.
- unparam # Tests might have unused function parameters.
- lll
- dupl
- misspell
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is fine to enable misspell in test file if doesn't require much changes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does require changes. Enabling these linters for tests would need a lot of extra work. I'll create a separate issue for the same?

- nestif

- text: "`ctx` is unused" # Context might not be in use in places, but for consistency, we pass it.
linters:
- unparam

linters-settings:
gocyclo:
min-complexity: 20
lll:
line-length: 240
nakedret:
max-func-lines: 2
importas:
no-unaliased: true
alias:
- pkg: k8s.io/apimachinery/pkg/api/errors
alias: apierrors
- pkg: k8s.io/api/core/v1
alias: corev1
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1
alias: metav1
- pkg: github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1
alias: crv1alpha1
nestif:
min-complexity: 6
2 changes: 1 addition & 1 deletion cmd/kanctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

func init() {
// We silence all non-fatal log messages.
//logrus.SetLevel(logrus.ErrorLevel)
// logrus.SetLevel(logrus.ErrorLevel)
}

func main() {
Expand Down
4 changes: 2 additions & 2 deletions cmd/reposervercontroller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

crkanisteriov1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1"
crv1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1"
"github.com/kanisterio/kanister/pkg/controllers/repositoryserver"
"github.com/kanisterio/kanister/pkg/log"
"github.com/kanisterio/kanister/pkg/resource"
Expand All @@ -46,7 +46,7 @@ var (
func init() {
utilruntime.Must(clientgoscheme.AddToScheme(scheme))

utilruntime.Must(crkanisteriov1alpha1.AddToScheme(scheme))
utilruntime.Must(crv1alpha1.AddToScheme(scheme))
//+kubebuilder:scaffold:scheme
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

// App represents an application we can install into a namespace.
type App interface {
// Init instantiates the app based on the environemnt configuration,
// Init instantiates the app based on the environment configuration,
// including environement variables and state in the Kubernetes cluster. If
// any required configuration is not discoverable, Init will return an
// error.
Expand All @@ -48,7 +48,7 @@ type App interface {
type DatabaseApp interface {
App
// Ping will issue trivial request to the database to see if it is
// accessable.
// accessible.
Ping(context.Context) error
// Insert adds n entries to the database.
Insert(ctx context.Context) error
Expand Down
17 changes: 11 additions & 6 deletions pkg/app/cassandra.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (cas *CassandraInstance) Object() crv1alpha1.ObjectReference {
}
}

// Uninstall us used to remove the datbase application
// Uninstall us used to remove the database application
func (cas *CassandraInstance) Uninstall(ctx context.Context) error {
log.Print("Uninstalling application.", field.M{"app": cas.name})
cli, err := helm.NewCliClient()
Expand All @@ -142,7 +142,7 @@ func (cas *CassandraInstance) GetClusterScopedResources(ctx context.Context) []c
return nil
}

// Ping is used to ping the application to check the datbase connectivity
// Ping is used to ping the application to check the database connectivity
func (cas *CassandraInstance) Ping(ctx context.Context) error {
log.Print("Pinging the application.", field.M{"app": cas.name})

Expand All @@ -158,7 +158,9 @@ func (cas *CassandraInstance) Ping(ctx context.Context) error {
// Insert is used to insert the records into the database
func (cas *CassandraInstance) Insert(ctx context.Context) error {
log.Print("Inserting records into the database.", field.M{"app": cas.name})
insertCMD := []string{"sh", "-c", fmt.Sprintf("cqlsh -u cassandra -p $CASSANDRA_PASSWORD -e \"insert into restaurants.guests (id, firstname, lastname, birthday) values (uuid(), 'Tom', 'Singh', '2015-02-18');\" --request-timeout=%s", cqlTimeout)}
insertCMD := []string{"sh", "-c", fmt.Sprintf("cqlsh -u cassandra -p $CASSANDRA_PASSWORD -e \"insert into "+
"restaurants.guests (id, firstname, lastname, birthday) values (uuid(), 'Tom', 'Singh', "+
"'2015-02-18');\" --request-timeout=%s", cqlTimeout)}
_, stderr, err := cas.execCommand(ctx, insertCMD)
if err != nil {
return errors.Wrapf(err, "Error %s inserting records into the database.", stderr)
Expand Down Expand Up @@ -191,7 +193,8 @@ func (cas *CassandraInstance) Count(ctx context.Context) (int, error) {
// Reset is used to reset or imitate disaster, in the database
func (cas *CassandraInstance) Reset(ctx context.Context) error {
// delete keyspace and table if they already exist
delRes := []string{"sh", "-c", fmt.Sprintf("cqlsh -u cassandra -p $CASSANDRA_PASSWORD -e 'drop table if exists restaurants.guests; drop keyspace if exists restaurants;' --request-timeout=%s", cqlTimeout)}
delRes := []string{"sh", "-c", fmt.Sprintf("cqlsh -u cassandra -p $CASSANDRA_PASSWORD -e "+
"'drop table if exists restaurants.guests; drop keyspace if exists restaurants;' --request-timeout=%s", cqlTimeout)}
_, stderr, err := cas.execCommand(ctx, delRes)
if err != nil {
return errors.Wrapf(err, "Error %s, deleting resources while reseting application.", stderr)
Expand All @@ -202,14 +205,16 @@ func (cas *CassandraInstance) Reset(ctx context.Context) error {
// Initialize is used to initialize the database or create schema
func (cas *CassandraInstance) Initialize(ctx context.Context) error {
// create the keyspace
createKS := []string{"sh", "-c", fmt.Sprintf("cqlsh -u cassandra -p $CASSANDRA_PASSWORD -e \"create keyspace restaurants with replication = {'class':'SimpleStrategy', 'replication_factor': 3};\" --request-timeout=%s", cqlTimeout)}
createKS := []string{"sh", "-c", fmt.Sprintf("cqlsh -u cassandra -p $CASSANDRA_PASSWORD -e \"create keyspace "+
"restaurants with replication = {'class':'SimpleStrategy', 'replication_factor': 3};\" --request-timeout=%s", cqlTimeout)}
_, stderr, err := cas.execCommand(ctx, createKS)
if err != nil {
return errors.Wrapf(err, "Error %s while creating the keyspace for application.", stderr)
}

// create the table
createTab := []string{"sh", "-c", fmt.Sprintf("cqlsh -u cassandra -p $CASSANDRA_PASSWORD -e \"create table restaurants.guests (id UUID primary key, firstname text, lastname text, birthday timestamp);\" --request-timeout=%s", cqlTimeout)}
createTab := []string{"sh", "-c", fmt.Sprintf("cqlsh -u cassandra -p $CASSANDRA_PASSWORD -e \"create table "+
"restaurants.guests (id UUID primary key, firstname text, lastname text, birthday timestamp);\" --request-timeout=%s", cqlTimeout)}
_, stderr, err = cas.execCommand(ctx, createTab)
if err != nil {
return errors.Wrapf(err, "Error %s creating table.", stderr)
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/cockroachdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (c *CockroachDB) Init(context.Context) error {
return err
}

func (c *CockroachDB) Install(ctx context.Context, namespace string) error {
func (c *CockroachDB) Install(ctx context.Context, namespace string) error { //nolint:dupl
log.Info().Print("Installing cockroachdb cluster helm chart.", field.M{"app": c.name})
c.namespace = namespace

Expand Down
2 changes: 1 addition & 1 deletion pkg/app/couchbase.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (cb *CouchbaseDB) Init(ctx context.Context) error {
return err
}

func (cb *CouchbaseDB) Install(ctx context.Context, ns string) error {
func (cb *CouchbaseDB) Install(ctx context.Context, ns string) error { //nolint:dupl
log.Info().Print("Installing couchbase operator and cluster helm chart.", field.M{"app": cb.name})
cb.namespace = ns

Expand Down
32 changes: 16 additions & 16 deletions pkg/app/csi-snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"github.com/pkg/errors"
appsv1 "k8s.io/api/apps/v1"
v1 "k8s.io/api/core/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
Expand All @@ -36,7 +36,7 @@ type TimeLogCSI struct {
namespace string
name string
deployment appsv1.Deployment
pvc v1.PersistentVolumeClaim
pvc corev1.PersistentVolumeClaim
}

// NewTimeLogCSI instantiates the TimeLogCSI integration test app
Expand Down Expand Up @@ -184,30 +184,30 @@ func (tlc TimeLogCSI) getAppDeploymentObj() *appsv1.Deployment {
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"app": tlc.name},
},
Template: v1.PodTemplateSpec{
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{"app": tlc.name},
},
Spec: v1.PodSpec{
Containers: []v1.Container{
Spec: corev1.PodSpec{
Containers: []corev1.Container{
{
Name: "test-container",
Image: "ghcr.io/kanisterio/kanister-tools:0.93.0",
Command: []string{"sh", "-c"},
Args: []string{"while true; do for x in $(seq 1200); do date >> /var/log/time.log; sleep 1; done; truncate /var/log/time.log --size 0; done"},
VolumeMounts: []v1.VolumeMount{
VolumeMounts: []corev1.VolumeMount{
{
Name: "data",
MountPath: "/var/log",
},
},
},
},
Volumes: []v1.Volume{
Volumes: []corev1.Volume{
{
Name: "data",
VolumeSource: v1.VolumeSource{
PersistentVolumeClaim: &v1.PersistentVolumeClaimVolumeSource{
VolumeSource: corev1.VolumeSource{
PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{
ClaimName: "time-log-pvc",
},
},
Expand All @@ -220,19 +220,19 @@ func (tlc TimeLogCSI) getAppDeploymentObj() *appsv1.Deployment {
return deployment
}

func (tlc TimeLogCSI) getAppPersistentVolumeClaimObj() *v1.PersistentVolumeClaim {
func (tlc TimeLogCSI) getAppPersistentVolumeClaimObj() *corev1.PersistentVolumeClaim {
storageClassName := "csi-hostpath-sc"
pvc := &v1.PersistentVolumeClaim{
pvc := &corev1.PersistentVolumeClaim{
ObjectMeta: metav1.ObjectMeta{
Name: "time-log-pvc",
Labels: map[string]string{"app": tlc.name},
},
Spec: v1.PersistentVolumeClaimSpec{
Spec: corev1.PersistentVolumeClaimSpec{
StorageClassName: &storageClassName,
AccessModes: []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce},
Resources: v1.ResourceRequirements{
Requests: v1.ResourceList{
v1.ResourceStorage: *resource.NewQuantity(1073741824, resource.BinarySI),
AccessModes: []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce},
Resources: corev1.ResourceRequirements{
Requests: corev1.ResourceList{
corev1.ResourceStorage: *resource.NewQuantity(1073741824, resource.BinarySI),
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/elasticsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func (esi *ElasticsearchInstance) Insert(ctx context.Context) error {
addDocumentToIndexCMD := []string{"sh", "-c", esi.curlCommandWithPayload("POST", esi.indexname+"/_doc/?refresh=true", "'{\"appname\": \"kanister\" }'")}
_, stderr, err := esi.execCommand(ctx, addDocumentToIndexCMD)
if err != nil {
// even one insert failed we will have to return becasue
// even one insert failed we will have to return because
// the count wont match anyway and the test will fail
return errors.Wrapf(err, "Error %s inserting document to an index %s.", stderr, esi.indexname)
}
Expand Down
7 changes: 5 additions & 2 deletions pkg/app/mariadb.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (m *MariaDB) Init(context.Context) error {
return nil
}

func (m *MariaDB) Install(ctx context.Context, namespace string) error {
func (m *MariaDB) Install(ctx context.Context, namespace string) error { //nolint:dupl
m.namespace = namespace
cli, err := helm.NewCliClient()
if err != nil {
Expand Down Expand Up @@ -204,7 +204,10 @@ func (m *MariaDB) Reset(ctx context.Context) error {

func (m *MariaDB) Initialize(ctx context.Context) error {
// create the database and a pets table
createTableCMD := []string{"sh", "-c", "mysql -u root --password=$MARIADB_ROOT_PASSWORD -e 'create database testdb; use testdb; CREATE TABLE pets (name VARCHAR(20), owner VARCHAR(20), species VARCHAR(20), sex CHAR(1), birth DATE, death DATE);'"}
createTableCMD := []string{"sh", "-c", "mysql -u root --password=$MARIADB_ROOT_PASSWORD " +
"-e 'create database testdb; use testdb; " +
"CREATE TABLE pets (name VARCHAR(20), owner VARCHAR(20), species VARCHAR(20), sex CHAR(1), " +
"birth DATE, death DATE);'"}
_, stderr, err := m.execCommand(ctx, createTableCMD)
if err != nil {
return errors.Wrapf(err, "Error while creating the maria table: %s", stderr)
Expand Down
6 changes: 4 additions & 2 deletions pkg/app/mongodb-deploymentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ func (mongo *MongoDBDepConfig) Ping(ctx context.Context) error {

func (mongo *MongoDBDepConfig) Insert(ctx context.Context) error {
log.Print("Inserting documents into collection.", field.M{"app": mongo.name})
insertCMD := []string{"bash", "-c", fmt.Sprintf("mongo admin --authenticationDatabase admin -u %s -p $MONGODB_ADMIN_PASSWORD --quiet --eval \"db.restaurants.insert({'_id': '%s','name' : 'Tom', 'cuisine' : 'Hawaiian', 'id' : '8675309'})\"", mongo.user, uuid.New())}
insertCMD := []string{"bash", "-c", fmt.Sprintf("mongo admin --authenticationDatabase admin -u %s -p "+
"$MONGODB_ADMIN_PASSWORD --quiet --eval \"db.restaurants.insert({'_id': '%s','name' : 'Tom', "+
"'cuisine' : 'Hawaiian', 'id' : '8675309'})\"", mongo.user, uuid.New())}
_, stderr, err := mongo.execCommand(ctx, insertCMD)
if err != nil {
return errors.Wrapf(err, "Error %s while inserting data data into mongodb collection.", stderr)
Expand Down Expand Up @@ -182,7 +184,7 @@ func (mongo *MongoDBDepConfig) execCommand(ctx context.Context, command []string
return "", "", err
}
stdout, stderr, err := kube.Exec(mongo.cli, mongo.namespace, podName, containerName, command, nil)
log.Print("Executing the command in pod and contianer", field.M{"pod": podName, "container": containerName, "cmd": command})
log.Print("Executing the command in pod and container", field.M{"pod": podName, "container": containerName, "cmd": command})

return stdout, stderr, errors.Wrapf(err, "Error executing command in the pod")
}
4 changes: 3 additions & 1 deletion pkg/app/mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ func (mongo *MongoDB) Ping(ctx context.Context) error {

func (mongo *MongoDB) Insert(ctx context.Context) error {
log.Print("Inserting documents into collection.", field.M{"app": mongo.name})
insertCMD := []string{"sh", "-c", fmt.Sprintf("mongosh admin --authenticationDatabase admin -u %s -p $MONGODB_ROOT_PASSWORD --quiet --eval \"db.restaurants.insertOne({'_id': '%s','name' : 'Tom', 'cuisine' : 'Hawaiian', 'id' : '8675309'})\"", mongo.username, uuid.New())}
insertCMD := []string{"sh", "-c", fmt.Sprintf("mongosh admin --authenticationDatabase admin -u %s -p "+
"$MONGODB_ROOT_PASSWORD --quiet --eval \"db.restaurants.insertOne({'_id': '%s','name' : 'Tom', "+
"'cuisine' : 'Hawaiian', 'id' : '8675309'})\"", mongo.username, uuid.New())}
_, stderr, err := mongo.execCommand(ctx, insertCMD)
if err != nil {
return errors.Wrapf(err, "Error %s while inserting data data into mongodb collection.", stderr)
Expand Down
20 changes: 10 additions & 10 deletions pkg/app/mssql.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/pkg/errors"
appsv1 "k8s.io/api/apps/v1"
v1 "k8s.io/api/core/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/yaml"
"k8s.io/client-go/kubernetes"
Expand All @@ -32,9 +32,9 @@ type MssqlDB struct {
namespace string
name string
deployment *appsv1.Deployment
service *v1.Service
pvc *v1.PersistentVolumeClaim
secret *v1.Secret
service *corev1.Service
pvc *corev1.PersistentVolumeClaim
secret *corev1.Secret
}

func NewMssqlDB(name string) App {
Expand Down Expand Up @@ -298,7 +298,7 @@ spec:
return deployment, err
}

func (m *MssqlDB) getPVCObj() (*v1.PersistentVolumeClaim, error) {
func (m *MssqlDB) getPVCObj() (*corev1.PersistentVolumeClaim, error) {
pvcmaniFest :=
`kind: PersistentVolumeClaim
apiVersion: v1
Expand All @@ -311,12 +311,12 @@ spec:
requests:
storage: 4Gi`

var pvc *v1.PersistentVolumeClaim
var pvc *corev1.PersistentVolumeClaim
err := yaml.Unmarshal([]byte(pvcmaniFest), &pvc)
return pvc, err
}

func (m *MssqlDB) getServiceObj() (*v1.Service, error) {
func (m *MssqlDB) getServiceObj() (*corev1.Service, error) {
serviceManifest :=
`apiVersion: v1
kind: Service
Expand All @@ -331,13 +331,13 @@ spec:
targetPort: 1433
type: ClusterIP`

var service *v1.Service
var service *corev1.Service
err := yaml.Unmarshal([]byte(serviceManifest), &service)
return service, err
}

func (m MssqlDB) getSecretObj() *v1.Secret {
return &v1.Secret{
func (m MssqlDB) getSecretObj() *corev1.Secret {
return &corev1.Secret{
ObjectMeta: metav1.ObjectMeta{
Name: m.name,
},
Expand Down
Loading