@@ -9,12 +9,12 @@ import (
9
9
"time"
10
10
11
11
"k8s.io/client-go/kubernetes"
12
- v1core "k8s.io/client-go/kubernetes/typed/core/v1"
12
+ corev1 "k8s.io/client-go/kubernetes/typed/core/v1"
13
13
"k8s.io/client-go/pkg/api/errors"
14
14
"k8s.io/client-go/pkg/api/resource"
15
+ "k8s.io/client-go/pkg/api/unversioned"
15
16
"k8s.io/client-go/pkg/api/v1"
16
17
"k8s.io/client-go/pkg/apis/extensions/v1beta1"
17
- metav1 "k8s.io/client-go/pkg/apis/meta/v1"
18
18
"k8s.io/client-go/pkg/util"
19
19
"k8s.io/client-go/pkg/util/intstr"
20
20
"k8s.io/client-go/tools/clientcmd"
@@ -75,17 +75,17 @@ func secretifyDockerCred() string {
75
75
return jsonFilled
76
76
}
77
77
78
- func (x * KubeDeploy ) createDockerIOSecretIfNotExists (namespace string , coreInterface v1core .CoreV1Interface ) error {
78
+ func (x * KubeDeploy ) createDockerIOSecretIfNotExists (namespace string , coreInterface corev1 .CoreV1Interface ) error {
79
79
// Load up the docker-io secrets for image pull if not exists
80
- _ , dockerIOSecretErr := coreInterface .Secrets (namespace ).Get ("docker-io" , metav1. GetOptions {} )
80
+ _ , dockerIOSecretErr := coreInterface .Secrets (namespace ).Get ("docker-io" )
81
81
if dockerIOSecretErr != nil {
82
82
if errors .IsNotFound (dockerIOSecretErr ) {
83
83
log .Printf ("docker-io secret not found for %s, creating." , namespace )
84
84
secretMap := map [string ]string {
85
85
".dockercfg" : secretifyDockerCred (),
86
86
}
87
87
_ , createDockerIOSecretErr := coreInterface .Secrets (namespace ).Create (& v1.Secret {
88
- TypeMeta : metav1 .TypeMeta {
88
+ TypeMeta : unversioned .TypeMeta {
89
89
Kind : "Secret" ,
90
90
APIVersion : "v1" ,
91
91
},
@@ -108,14 +108,14 @@ func (x *KubeDeploy) createDockerIOSecretIfNotExists(namespace string, coreInter
108
108
return nil
109
109
}
110
110
111
- func (x * KubeDeploy ) createNamespaceIfNotExists (namespace string , coreInterface v1core .CoreV1Interface ) error {
111
+ func (x * KubeDeploy ) createNamespaceIfNotExists (namespace string , coreInterface corev1 .CoreV1Interface ) error {
112
112
// Create namespace if it does not exist.
113
- _ , nameGetErr := coreInterface .Namespaces ().Get (namespace , metav1. GetOptions {} )
113
+ _ , nameGetErr := coreInterface .Namespaces ().Get (namespace )
114
114
if nameGetErr != nil {
115
115
if errors .IsNotFound (nameGetErr ) {
116
116
log .Printf ("Namespace %s does not yet exist, creating." , namespace )
117
117
namespaceParams := & v1.Namespace {
118
- TypeMeta : metav1 .TypeMeta {
118
+ TypeMeta : unversioned .TypeMeta {
119
119
Kind : "Namespace" ,
120
120
APIVersion : "v1" ,
121
121
},
@@ -189,7 +189,7 @@ func (x *KubeDeploy) doDeploy(e agent.Event) error {
189
189
}
190
190
191
191
secretParams := & v1.Secret {
192
- TypeMeta : metav1 .TypeMeta {
192
+ TypeMeta : unversioned .TypeMeta {
193
193
Kind : "Secret" ,
194
194
APIVersion : "v1" ,
195
195
},
@@ -378,7 +378,7 @@ func (x *KubeDeploy) doDeploy(e agent.Event) error {
378
378
var revisionHistoryLimit int32 = 10
379
379
terminationGracePeriodSeconds := service .Spec .TerminationGracePeriodSeconds
380
380
deployParams := & v1beta1.Deployment {
381
- TypeMeta : metav1 .TypeMeta {
381
+ TypeMeta : unversioned .TypeMeta {
382
382
Kind : "Deployment" ,
383
383
APIVersion : "extensions/v1beta1" ,
384
384
},
@@ -435,7 +435,7 @@ func (x *KubeDeploy) doDeploy(e agent.Event) error {
435
435
}
436
436
437
437
log .Printf ("Getting list of deployments matching %s" , deploymentName )
438
- _ , err := depInterface .Deployments (namespace ).Get (deploymentName , metav1. GetOptions {} )
438
+ _ , err := depInterface .Deployments (namespace ).Get (deploymentName )
439
439
var myError error
440
440
if err != nil {
441
441
// Create deployment if it does not exist
@@ -474,7 +474,7 @@ func (x *KubeDeploy) doDeploy(e agent.Event) error {
474
474
for {
475
475
for index , service := range data .Services {
476
476
deploymentName := genDeploymentName (data .Project .Slug , service .Name )
477
- deployment , err := depInterface .Deployments (namespace ).Get (deploymentName , metav1. GetOptions {} )
477
+ deployment , err := depInterface .Deployments (namespace ).Get (deploymentName )
478
478
if err != nil {
479
479
log .Printf ("Error '%s' fetching deployment status for %s" , err , deploymentName )
480
480
continue
0 commit comments