Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Commit

Permalink
update imports to apimachinery from client-go
Browse files Browse the repository at this point in the history
  • Loading branch information
surajssd committed Jul 25, 2017
1 parent 6832f7f commit 77d1b5e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 17 deletions.
4 changes: 3 additions & 1 deletion cmd/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ package cmd

import (
"fmt"
"os"

pkgcmd "github.com/kedgeproject/kedge/pkg/cmd"

"github.com/spf13/cobra"
"os"
)

// Represents the "apply" command
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

"github.com/ghodss/yaml"
"github.com/pkg/errors"
"k8s.io/client-go/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime"
)

func Generate(files []string) error {
Expand Down
7 changes: 5 additions & 2 deletions pkg/transform/fixtures/single_container_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ limitations under the License.

package fixtures

import api_v1 "k8s.io/client-go/pkg/api/v1"
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
api_v1 "k8s.io/client-go/pkg/api/v1"
)

var SingleContainerService *api_v1.Service = &api_v1.Service{
ObjectMeta: api_v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "test",
},
Spec: api_v1.ServiceSpec{
Expand Down
25 changes: 13 additions & 12 deletions pkg/transform/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@ import (
"strconv"
"strings"

"github.com/davecgh/go-spew/spew"
"github.com/kedgeproject/kedge/pkg/spec"
"github.com/pkg/errors"
"k8s.io/client-go/pkg/api"
"k8s.io/client-go/pkg/api/resource"
"k8s.io/client-go/pkg/runtime"
"k8s.io/client-go/pkg/util/intstr"

log "github.com/Sirupsen/logrus"
"github.com/davecgh/go-spew/spew"
"github.com/pkg/errors"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/client-go/pkg/api"
api_v1 "k8s.io/client-go/pkg/api/v1"
ext_v1beta1 "k8s.io/client-go/pkg/apis/extensions/v1beta1"

Expand All @@ -49,7 +50,7 @@ func createIngresses(app *spec.App) ([]runtime.Object, error) {

for _, i := range app.Ingresses {
ing := &ext_v1beta1.Ingress{
ObjectMeta: api_v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: i.Name,
Labels: app.Labels,
},
Expand All @@ -64,7 +65,7 @@ func createServices(app *spec.App) ([]runtime.Object, error) {
var svcs []runtime.Object
for _, s := range app.Services {
svc := &api_v1.Service{
ObjectMeta: api_v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: s.Name,
Labels: app.Labels,
},
Expand Down Expand Up @@ -97,7 +98,7 @@ func createServices(app *spec.App) ([]runtime.Object, error) {

ingressName := s.Name + "-" + strconv.FormatInt(int64(port.Port), 10)
endpointIngress := &ext_v1beta1.Ingress{
ObjectMeta: api_v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: ingressName,
Labels: app.Labels,
},
Expand Down Expand Up @@ -164,7 +165,7 @@ func createDeployment(app *spec.App) (*ext_v1beta1.Deployment, error) {
deploymentSpec.Template.ObjectMeta.Labels = app.Labels

deployment := ext_v1beta1.Deployment{
ObjectMeta: api_v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: app.Name,
Labels: app.Labels,
},
Expand Down Expand Up @@ -214,7 +215,7 @@ func createPVC(v spec.VolumeClaim, labels map[string]string) (*api_v1.Persistent
v.AccessModes = []api_v1.PersistentVolumeAccessMode{api_v1.ReadWriteOnce}
}
pvc := &api_v1.PersistentVolumeClaim{
ObjectMeta: api_v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: v.Name,
Labels: labels,
},
Expand Down Expand Up @@ -390,7 +391,7 @@ func CreateK8sObjects(app *spec.App) ([]runtime.Object, error) {
var configMap []runtime.Object
for _, cd := range app.ConfigMaps {
cm := &api_v1.ConfigMap{
ObjectMeta: api_v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: cd.Name,
Labels: app.Labels,
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/transform/kubernetes/kubernetes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
encodingFixtures "github.com/kedgeproject/kedge/pkg/encoding/fixtures"
"github.com/kedgeproject/kedge/pkg/spec"
transformFixtures "github.com/kedgeproject/kedge/pkg/transform/fixtures"
"k8s.io/client-go/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime"
)

func TestCreateServices(t *testing.T) {
Expand Down

0 comments on commit 77d1b5e

Please sign in to comment.