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

Package pkg renamed into internal vol.2 #8

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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 .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiserver.local.config/
bin/
key.json
openapi_generated.go
pkg/client/
internal/client/
tmp/
vendor/
zz_generated.deepcopy.go
2 changes: 1 addition & 1 deletion Makefile
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build: GOARCH?=amd64
build: gen
@GOOS=$(GOOS) GOARCH=$(GOARCH) CGO_ENABLED=0 go build \
-v \
-ldflags="-d -s -w -X github.com/travelaudience/aerospike-operator/pkg/versioning.OperatorVersion=$(VERSION)" \
-ldflags="-d -s -w -X github.com/travelaudience/aerospike-operator/internal/versioning.OperatorVersion=$(VERSION)" \
-tags=netgo \
-installsuffix=netgo \
-o=$(OUT) ./cmd/$(BIN)/main.go
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ require (
k8s.io/apiserver v0.0.0-20180910083620-386115dd78fd // indirect
k8s.io/client-go v0.0.0-20180910083459-2cefa64ff137
k8s.io/component-base v0.0.0-20190515024022-2354f2393ad4 // indirect
k8s.io/kube-openapi v0.0.0-20190510232812-a01b7d5d6c22
k8s.io/kube-openapi v0.0.0-20190510232812-a01b7d5d6c22 // indirect
k8s.io/kubernetes v1.14.2
k8s.io/utils v0.0.0-20190520173318-324c5df7d3f0 // indirect
sigs.k8s.io/yaml v1.1.0 // indirect
Expand Down
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,10 @@ gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bl
gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
k8s.io/api v0.0.0-20190516230258-a675ac48af67 h1:BKg03K4me3EdM340RB08XB3MRlJ57KY+0f5PfI6wPZY=
k8s.io/api v0.0.0-20190516230258-a675ac48af67/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA=
k8s.io/apiextensions-apiserver v0.0.0-20190516231611-bf6753f2aa24 h1:SwpU8lyfh7Orv1XmveHiN6AD2LxffLHLePQ2gcav4sk=
k8s.io/apiextensions-apiserver v0.0.0-20190516231611-bf6753f2aa24/go.mod h1:IxkesAMoaCRoLrPJdZNZUQp9NfZnzqaVzLhb2VEQzXE=
k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d h1:Jmdtdt1ZnoGfWWIIik61Z7nKYgO3J+swQJtPYsP9wHA=
k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0=
k8s.io/apiserver v0.0.0-20190516230822-f89599b3f645/go.mod h1:6bqaTSOSJavUIXUtfaR9Os9JtTCm8ZqH2SUl2S60C4w=
k8s.io/client-go v11.0.1-0.20190516230509-ae8359b20417+incompatible h1:bK03DJulJi9j05gwnXUufcs2j7h4M85YFvJ0dIlQ9k4=
k8s.io/client-go v11.0.1-0.20190516230509-ae8359b20417+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s=
k8s.io/component-base v0.0.0-20190515024022-2354f2393ad4 h1:TOebDR8jh/AcqOEWnotJ+DYVUNcMA1GT86TR4Bg70KQ=
k8s.io/component-base v0.0.0-20190515024022-2354f2393ad4/go.mod h1:pKRi1i5IQdJDpK1LItot8oy27Bc3zL/hQiy9T171rvE=
Expand Down
12 changes: 6 additions & 6 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,26 @@ CODEGEN_PACKAGES="${BASE_PACKAGE}/internal/apis/aerospike/v1alpha1,${BASE_PACKAG
"${BINDIR}/deepcopy-gen" \
--input-dirs ${CODEGEN_PACKAGES} \
-O zz_generated.deepcopy \
--bounding-dirs ${BASE_PACKAGE}/pkg/apis \
--bounding-dirs ${BASE_PACKAGE}/internal/apis \
--go-header-file "${FAKE_REPOPATH}/hack/custom-boilerplate.go.txt"

"${BINDIR}/client-gen" \
--clientset-name versioned \
--input-base '' \
--input ${CODEGEN_PACKAGES} \
--output-package ${BASE_PACKAGE}/pkg/client/clientset \
--output-package ${BASE_PACKAGE}/internal/client/clientset \
--go-header-file "${FAKE_REPOPATH}/hack/custom-boilerplate.go.txt"

"${BINDIR}/lister-gen" \
--input-dirs ${CODEGEN_PACKAGES} \
--output-package ${BASE_PACKAGE}/pkg/client/listers \
--output-package ${BASE_PACKAGE}/internal/client/listers \
--go-header-file "${FAKE_REPOPATH}/hack/custom-boilerplate.go.txt"

"${BINDIR}/informer-gen" \
--input-dirs ${CODEGEN_PACKAGES} \
--versioned-clientset-package ${BASE_PACKAGE}/pkg/client/clientset/versioned \
--listers-package ${BASE_PACKAGE}/pkg/client/listers \
--output-package ${BASE_PACKAGE}/pkg/client/informers \
--versioned-clientset-package ${BASE_PACKAGE}/internal/client/clientset/versioned \
--listers-package ${BASE_PACKAGE}/internal/client/listers \
--output-package ${BASE_PACKAGE}/internal/client/informers \
--go-header-file "${FAKE_REPOPATH}/hack/custom-boilerplate.go.txt"

export GO111MODULE="on"
Expand Down
8 changes: 4 additions & 4 deletions hack/update-openapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
"github.com/go-openapi/spec"

log "github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/kube-openapi/pkg/common"
"k8s.io/apimachinery/internal/runtime"
piotrkowalczuk marked this conversation as resolved.
Show resolved Hide resolved
"k8s.io/apimachinery/internal/runtime/serializer"
utilruntime "k8s.io/apimachinery/internal/util/runtime"
"k8s.io/kube-openapi/internal/common"

aerospikev1alpha2 "github.com/travelaudience/aerospike-operator/internal/apis/aerospike/v1alpha2"
"github.com/travelaudience/aerospike-operator/internal/crd"
Expand Down
4 changes: 2 additions & 2 deletions hack/update-openapi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ SCRIPT_ROOT="$(dirname $(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd))"
# run openapi-gen
${GOPATH}/bin/openapi-gen \
--go-header-file "${SCRIPT_ROOT}/hack/custom-boilerplate.go.txt" \
--input-dirs github.com/travelaudience/aerospike-operator/pkg/apis/aerospike/v1alpha2,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/runtime \
--output-package github.com/travelaudience/aerospike-operator/pkg/apis/aerospike/v1alpha2
--input-dirs github.com/travelaudience/aerospike-operator/internal/apis/aerospike/v1alpha2,k8s.io/apimachinery/internal/apis/meta/v1,k8s.io/apimachinery/internal/runtime \
--output-package github.com/travelaudience/aerospike-operator/internal/apis/aerospike/v1alpha2

# run hack/openapi.go
go run ${SCRIPT_ROOT}/hack/update-openapi.go > ${SCRIPT_ROOT}/docs/design/swagger.json
5 changes: 3 additions & 2 deletions internal/admission/backups.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (

av1beta1 "k8s.io/api/admission/v1beta1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

aerospikev1alpha2 "github.com/travelaudience/aerospike-operator/internal/apis/aerospike/v1alpha2"
)
Expand Down Expand Up @@ -89,7 +90,7 @@ func (s *ValidatingAdmissionWebhook) admitAerospikeNamespaceRestore(ar av1beta1.

func (s *ValidatingAdmissionWebhook) validateBackupRestoreObj(obj aerospikev1alpha2.BackupRestoreObject) error {
// make sure that the target cluster exists
aerospikeCluster, err := s.aerospikeClient.AerospikeV1alpha2().AerospikeClusters(obj.GetNamespace()).Get(obj.GetTarget().Cluster, v1.GetOptions{})
aerospikeCluster, err := s.aerospikeClient.AerospikeV1alpha2().AerospikeClusters(obj.GetNamespace()).Get(obj.GetTarget().Cluster, metav1.GetOptions{})
if err != nil {
return err
}
Expand All @@ -115,7 +116,7 @@ func (s *ValidatingAdmissionWebhook) validateBackupRestoreObj(obj aerospikev1alp
// make sure that the secret containing cloud storage credentials exists and
// matches the expected format
secretNamespace := storageSpec.GetSecretNamespace(obj.GetNamespace())
secret, err := s.kubeClient.CoreV1().Secrets(secretNamespace).Get(storageSpec.GetSecret(), v1.GetOptions{})
secret, err := s.kubeClient.CoreV1().Secrets(secretNamespace).Get(storageSpec.GetSecret(), metav1.GetOptions{})
if err != nil {
if errors.IsNotFound(err) {
return fmt.Errorf("secret %q not found in namespace %q", storageSpec.GetSecret(), secretNamespace)
Expand Down
3 changes: 2 additions & 1 deletion internal/admission/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
av1beta1 "k8s.io/api/admission/v1beta1"

"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

aerospikev1alpha2 "github.com/travelaudience/aerospike-operator/internal/apis/aerospike/v1alpha2"
"github.com/travelaudience/aerospike-operator/internal/versioning"
Expand Down Expand Up @@ -129,7 +130,7 @@ func (s *ValidatingAdmissionWebhook) validateAerospikeCluster(aerospikeCluster *
if aerospikeCluster.Spec.BackupSpec != nil {
secretNamespace := aerospikeCluster.Spec.BackupSpec.Storage.GetSecretNamespace(aerospikeCluster.Namespace)
secretName := aerospikeCluster.Spec.BackupSpec.Storage.GetSecret()
secret, err := s.kubeClient.CoreV1().Secrets(secretNamespace).Get(secretName, v1.GetOptions{})
secret, err := s.kubeClient.CoreV1().Secrets(secretNamespace).Get(secretName, metav1.GetOptions{})
if err != nil {
if errors.IsNotFound(err) {
return fmt.Errorf("secret %q not found in namespace %q", secretName, secretNamespace)
Expand Down
15 changes: 8 additions & 7 deletions internal/admission/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (
log "github.com/sirupsen/logrus"
admissionv1beta1 "k8s.io/api/admission/v1beta1"
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -111,7 +112,7 @@ func (s *ValidatingAdmissionWebhook) Register() error {
return err
}
// parse the pem-encoded tls artifacts contained in the secret
cert, err := tls.X509KeyPair(sec.Data[v1.TLSCertKey], sec.Data[v1.TLSPrivateKeyKey])
cert, err := tls.X509KeyPair(sec.Data[corev1.TLSCertKey], sec.Data[corev1.TLSPrivateKeyKey])
if err != nil {
return err
}
Expand All @@ -120,7 +121,7 @@ func (s *ValidatingAdmissionWebhook) Register() error {

// if the admission webhook is enable, ensure it is correctly registered
if Enabled {
return s.ensureWebhookConfig(sec.Data[v1.TLSCertKey])
return s.ensureWebhookConfig(sec.Data[corev1.TLSCertKey])
}

// at this point we know the admission webhook is disabled, so we should
Expand Down Expand Up @@ -176,7 +177,7 @@ func (s *ValidatingAdmissionWebhook) handleAerospikeNamespaceRestore(res http.Re
// ensureTLSSecret generates a certificate and private key to be used for registering and serving the webhook, and
// creates a kubernetes secret containing them so they can be used by all running instances of aerospike-operator.
// in case such secret already exists, it is read and returned.
func (s *ValidatingAdmissionWebhook) ensureTLSSecret() (*v1.Secret, error) {
func (s *ValidatingAdmissionWebhook) ensureTLSSecret() (*corev1.Secret, error) {
// generate the certificate to use when registering and serving the webhook
svc := fmt.Sprintf("%s.%s.svc", serviceName, s.namespace)
now := time.Now()
Expand Down Expand Up @@ -212,18 +213,18 @@ func (s *ValidatingAdmissionWebhook) ensureTLSSecret() (*v1.Secret, error) {
Bytes: sig,
})
// create a kubernetes secret holding the certificate and private key
sec, err := s.kubeClient.CoreV1().Secrets(s.namespace).Create(&v1.Secret{
sec, err := s.kubeClient.CoreV1().Secrets(s.namespace).Create(&corev1.Secret{
ObjectMeta: metav1.ObjectMeta{
Name: tlsSecretName,
Labels: map[string]string{
selectors.LabelAppKey: "aerospike-operator",
},
Namespace: s.namespace,
},
Type: v1.SecretTypeTLS,
Type: corev1.SecretTypeTLS,
Data: map[string][]byte{
v1.TLSCertKey: sigBytes,
v1.TLSPrivateKeyKey: keyBytes,
corev1.TLSCertKey: sigBytes,
corev1.TLSPrivateKeyKey: keyBytes,
},
})
// if creation was successful, return the created secret
Expand Down
3 changes: 2 additions & 1 deletion internal/apis/aerospike/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package v1alpha1

import (
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/travelaudience/aerospike-operator/internal/apis/aerospike/common"
)
Expand All @@ -27,7 +28,7 @@ type BackupRestoreObject interface {
GetKind() string
GetName() string
GetNamespace() string
GetObjectMeta() *v1.ObjectMeta
GetObjectMeta() *metav1.ObjectMeta
GetStorage() *BackupStorageSpec
SetStorage(*BackupStorageSpec)
GetTarget() *TargetNamespace
Expand Down
3 changes: 2 additions & 1 deletion internal/apis/aerospike/v1alpha2/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package v1alpha2

import (
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/travelaudience/aerospike-operator/internal/apis/aerospike/common"
)
Expand All @@ -27,7 +28,7 @@ type BackupRestoreObject interface {
GetKind() string
GetName() string
GetNamespace() string
GetObjectMeta() *v1.ObjectMeta
GetObjectMeta() *metav1.ObjectMeta
GetStorage() *BackupStorageSpec
SetStorage(*BackupStorageSpec)
GetTarget() *TargetNamespace
Expand Down
13 changes: 7 additions & 6 deletions internal/backuprestore/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (

log "github.com/sirupsen/logrus"
batch "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -125,7 +126,7 @@ func (h *AerospikeBackupRestoreHandler) Handle(obj aerospikev1alpha2.BackupResto

// launchJob performs a number of checks and launches the job associated with
// obj.
func (h *AerospikeBackupRestoreHandler) launchJob(obj aerospikev1alpha2.BackupRestoreObject, secret *v1.Secret) error {
func (h *AerospikeBackupRestoreHandler) launchJob(obj aerospikev1alpha2.BackupRestoreObject, secret *corev1.Secret) error {
// create the backup/restore job
job, err := h.createJob(obj, secret)
if err != nil {
Expand All @@ -139,7 +140,7 @@ func (h *AerospikeBackupRestoreHandler) launchJob(obj aerospikev1alpha2.BackupRe
}).Debugf("%s job created as %s", obj.GetOperationType(), meta.Key(job))
// record an event indicating the current status
h.recorder.Eventf(obj.(runtime.Object),
v1.EventTypeNormal, events.ReasonJobCreated,
corev1.EventTypeNormal, events.ReasonJobCreated,
"%s job created as %s", obj.GetOperationType(), meta.Key(job))
// append a condition to the resource indicating the current status
condition := apiextensions.CustomResourceDefinitionCondition{
Expand All @@ -159,11 +160,11 @@ func (h *AerospikeBackupRestoreHandler) maybeSetConditions(obj aerospikev1alpha2

// look for the complete or failed condition in the associated job
for _, c := range job.Status.Conditions {
if c.Type == batch.JobComplete && c.Status == v1.ConditionTrue {
if c.Type == batch.JobComplete && c.Status == corev1.ConditionTrue {
jobCondition = batch.JobComplete
break
}
if c.Type == batch.JobFailed && c.Status == v1.ConditionTrue {
if c.Type == batch.JobFailed && c.Status == corev1.ConditionTrue {
jobCondition = batch.JobFailed
break
}
Expand All @@ -178,7 +179,7 @@ func (h *AerospikeBackupRestoreHandler) maybeSetConditions(obj aerospikev1alpha2
logfields.Key: meta.Key(obj),
}).Debugf("%s job has finished", obj.GetOperationType())
// record an event indicating success
h.recorder.Eventf(obj.(runtime.Object), v1.EventTypeNormal, events.ReasonJobFinished,
h.recorder.Eventf(obj.(runtime.Object), corev1.EventTypeNormal, events.ReasonJobFinished,
"%s job has finished", obj.GetOperationType())
// append a jobCondition to the resource's status indicating success
obj.SetConditions(append(obj.GetConditions(), apiextensions.CustomResourceDefinitionCondition{
Expand All @@ -194,7 +195,7 @@ func (h *AerospikeBackupRestoreHandler) maybeSetConditions(obj aerospikev1alpha2
logfields.Key: meta.Key(obj),
}).Debugf("%s job failed %d times", obj.GetOperationType(), job.Status.Failed)
// record an event indicating failure
h.recorder.Eventf(obj.(runtime.Object), v1.EventTypeWarning, events.ReasonJobFailed,
h.recorder.Eventf(obj.(runtime.Object), corev1.EventTypeWarning, events.ReasonJobFailed,
"%s job failed %d times", obj.GetOperationType(), job.Status.Failed)
// append a jobCondition to the resource's status indicating failure
obj.SetConditions(append(obj.GetConditions(), apiextensions.CustomResourceDefinitionCondition{
Expand Down
2 changes: 1 addition & 1 deletion internal/crd/converters/v1alpha2/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package v1alpha2
import (
log "github.com/sirupsen/logrus"
extsclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
"k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/travelaudience/aerospike-operator/internal/apis/aerospike/v1alpha1"
aerospikeclientset "github.com/travelaudience/aerospike-operator/internal/client/clientset/versioned"
Expand Down
1 change: 1 addition & 0 deletions internal/crd/converters/v1alpha2/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
log "github.com/sirupsen/logrus"
extsclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
"k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/travelaudience/aerospike-operator/internal/apis/aerospike/common"
"github.com/travelaudience/aerospike-operator/internal/apis/aerospike/v1alpha1"
Expand Down
1 change: 1 addition & 0 deletions internal/crd/converters/v1alpha2/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
log "github.com/sirupsen/logrus"
extsclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
"k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/travelaudience/aerospike-operator/internal/apis/aerospike/v1alpha1"
aerospikeclientset "github.com/travelaudience/aerospike-operator/internal/client/clientset/versioned"
Expand Down
6 changes: 3 additions & 3 deletions internal/garbagecollector/asbackups.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"time"

log "github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/record"

Expand Down Expand Up @@ -59,7 +59,7 @@ func (h *AerospikeNamespaceBackupHandler) Handle(asBackup *aerospikev1alpha2.Aer
}).Debug("checking whether aerospikenamespacebackup has expired")

// get the corresponding aerospikecluster object
aerospikeCluster, err := h.aerospikeclientset.AerospikeV1alpha2().AerospikeClusters(asBackup.Namespace).Get(asBackup.Spec.Target.Cluster, v1.GetOptions{})
aerospikeCluster, err := h.aerospikeclientset.AerospikeV1alpha2().AerospikeClusters(asBackup.Namespace).Get(asBackup.Spec.Target.Cluster, metav1.GetOptions{})
if err != nil {
return err
}
Expand Down Expand Up @@ -117,7 +117,7 @@ func (h *AerospikeNamespaceBackupHandler) Handle(asBackup *aerospikev1alpha2.Aer
}

// delete AerospikeNamespaceBackup resource
if err := h.aerospikeclientset.AerospikeV1alpha2().AerospikeNamespaceBackups(asBackup.Namespace).Delete(asBackup.Name, &v1.DeleteOptions{}); err != nil {
if err := h.aerospikeclientset.AerospikeV1alpha2().AerospikeNamespaceBackups(asBackup.Namespace).Delete(asBackup.Name, &metav1.DeleteOptions{}); err != nil {
return err
}
log.WithFields(log.Fields{
Expand Down
4 changes: 3 additions & 1 deletion internal/garbagecollector/gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ limitations under the License.
package garbagecollector

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

aerospikev1alpha2 "github.com/travelaudience/aerospike-operator/internal/apis/aerospike/v1alpha2"
"github.com/travelaudience/aerospike-operator/internal/backuprestore"
"github.com/travelaudience/aerospike-operator/internal/backuprestore/gcs"
Expand All @@ -25,7 +27,7 @@ import (
func (h *AerospikeNamespaceBackupHandler) deleteBackupDataGCS(asBackup *aerospikev1alpha2.AerospikeNamespaceBackup) error {
// get the secret containing the credentials to access the gcs bucket
namespace := asBackup.Spec.Storage.GetSecretNamespace(asBackup.Namespace)
secret, err := h.kubeclientset.CoreV1().Secrets(namespace).Get(asBackup.Spec.Storage.GetSecret(), v1.GetOptions{})
secret, err := h.kubeclientset.CoreV1().Secrets(namespace).Get(asBackup.Spec.Storage.GetSecret(), metav1.GetOptions{})
if err != nil {
return err
}
Expand Down
3 changes: 2 additions & 1 deletion internal/garbagecollector/pvcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"time"

log "github.com/sirupsen/logrus"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
Expand Down Expand Up @@ -49,7 +50,7 @@ func NewPVCsGCHandler(kubeclientset kubernetes.Interface,
}
}

func (h *PVCsHandler) Handle(pvc *v1.PersistentVolumeClaim) error {
func (h *PVCsHandler) Handle(pvc *corev1.PersistentVolumeClaim) error {
log.WithFields(log.Fields{
logfields.Key: meta.Key(pvc),
}).Debug("checking whether pvc has expired")
Expand Down
1 change: 1 addition & 0 deletions internal/meta/key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/reconciler/backups.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (r *AerospikeClusterReconciler) isClusterBackupFinished(aerospikeCluster *a

func (r *AerospikeClusterReconciler) createNamespaceBackup(aerospikeCluster *aerospikev1alpha2.AerospikeCluster, ns string) error {
backup := aerospikev1alpha2.AerospikeNamespaceBackup{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: GetBackupName(ns, aerospikeCluster.Status.Version, aerospikeCluster.Spec.Version),
Labels: map[string]string{
selectors.LabelAppKey: selectors.LabelAppVal,
Expand Down
Loading