From 7e05fd93f1253fb0c7c4dc7680e169eefde97b0c Mon Sep 17 00:00:00 2001 From: Aaron Stein Date: Tue, 19 Jun 2018 16:38:24 -0700 Subject: [PATCH] kube: manifest crd * replaces deployment annotation encoding/decoding --- Makefile | 12 +- _run/multi/akash-provider/run.sh | 2 +- .../akash-provider/templates/deployment.yaml | 2 +- cmd/akash/provider.go | 7 +- glide.lock | 8 + glide.yaml | 4 + pkg/apis/akash.network/v1/doc.go | 5 + pkg/apis/akash.network/v1/register.go | 68 +++++ pkg/apis/akash.network/v1/types.go | 179 +++++++++++ pkg/apis/akash.network/v1/types_test.go | 40 +++ .../akash.network/v1/zz_generated.deepcopy.go | 279 ++++++++++++++++++ pkg/client/clientset/versioned/clientset.go | 100 +++++++ pkg/client/clientset/versioned/doc.go | 20 ++ .../versioned/fake/clientset_generated.go | 81 +++++ pkg/client/clientset/versioned/fake/doc.go | 20 ++ .../clientset/versioned/fake/register.go | 54 ++++ pkg/client/clientset/versioned/scheme/doc.go | 20 ++ .../clientset/versioned/scheme/register.go | 54 ++++ .../akash.network/v1/akash.network_client.go | 90 ++++++ .../versioned/typed/akash.network/v1/doc.go | 20 ++ .../typed/akash.network/v1/fake/doc.go | 20 ++ .../v1/fake/fake_akash.network_client.go | 40 +++ .../akash.network/v1/fake/fake_manifest.go | 140 +++++++++ .../akash.network/v1/generated_expansion.go | 21 ++ .../typed/akash.network/v1/manifest.go | 174 +++++++++++ .../akash.network/interface.go | 46 +++ .../akash.network/v1/interface.go | 45 +++ .../akash.network/v1/manifest.go | 89 ++++++ .../informers/externalversions/factory.go | 131 ++++++++ .../informers/externalversions/generic.go | 62 ++++ .../internalinterfaces/factory_interfaces.go | 38 +++ .../akash.network/v1/expansion_generated.go | 27 ++ .../listers/akash.network/v1/manifest.go | 94 ++++++ provider/cluster/kube/apply.go | 31 ++ provider/cluster/kube/builder.go | 46 +-- provider/cluster/kube/client.go | 48 ++- provider/cluster/kube/deployment.go | 25 -- provider/cluster/kube/deployment_test.go | 26 +- provider/manifest/http/server_test.go | 1 + sdl/v1.go | 4 +- sdl/v1_test.go | 4 +- testutil/deployment.go | 2 +- types/types.pb.go | 238 +++++++-------- types/types.proto | 2 +- 44 files changed, 2219 insertions(+), 200 deletions(-) create mode 100644 pkg/apis/akash.network/v1/doc.go create mode 100644 pkg/apis/akash.network/v1/register.go create mode 100644 pkg/apis/akash.network/v1/types.go create mode 100644 pkg/apis/akash.network/v1/types_test.go create mode 100644 pkg/apis/akash.network/v1/zz_generated.deepcopy.go create mode 100644 pkg/client/clientset/versioned/clientset.go create mode 100644 pkg/client/clientset/versioned/doc.go create mode 100644 pkg/client/clientset/versioned/fake/clientset_generated.go create mode 100644 pkg/client/clientset/versioned/fake/doc.go create mode 100644 pkg/client/clientset/versioned/fake/register.go create mode 100644 pkg/client/clientset/versioned/scheme/doc.go create mode 100644 pkg/client/clientset/versioned/scheme/register.go create mode 100644 pkg/client/clientset/versioned/typed/akash.network/v1/akash.network_client.go create mode 100644 pkg/client/clientset/versioned/typed/akash.network/v1/doc.go create mode 100644 pkg/client/clientset/versioned/typed/akash.network/v1/fake/doc.go create mode 100644 pkg/client/clientset/versioned/typed/akash.network/v1/fake/fake_akash.network_client.go create mode 100644 pkg/client/clientset/versioned/typed/akash.network/v1/fake/fake_manifest.go create mode 100644 pkg/client/clientset/versioned/typed/akash.network/v1/generated_expansion.go create mode 100644 pkg/client/clientset/versioned/typed/akash.network/v1/manifest.go create mode 100644 pkg/client/informers/externalversions/akash.network/interface.go create mode 100644 pkg/client/informers/externalversions/akash.network/v1/interface.go create mode 100644 pkg/client/informers/externalversions/akash.network/v1/manifest.go create mode 100644 pkg/client/informers/externalversions/factory.go create mode 100644 pkg/client/informers/externalversions/generic.go create mode 100644 pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go create mode 100644 pkg/client/listers/akash.network/v1/expansion_generated.go create mode 100644 pkg/client/listers/akash.network/v1/manifest.go diff --git a/Makefile b/Makefile index d4b006c602..be3831bd20 100644 --- a/Makefile +++ b/Makefile @@ -47,10 +47,10 @@ test-cover: goveralls -service=travis-ci -ignore="types/types.pb.go" test-vet: - go vet $$(glide novendor) + go vet $$(glide novendor | grep -v ./pkg/) deps-install: - glide install + glide install -v devdeps-install: go get github.com/gogo/protobuf/protoc-gen-gogo @@ -68,6 +68,11 @@ integrationdeps-install: gentypes: $(PROTOC_FILES) +kubetypes: + vendor/k8s.io/code-generator/generate-groups.sh all \ + github.com/ovrclk/akash/pkg/client github.com/ovrclk/akash/pkg/apis \ + akash.network:v1 + %.pb.go: %.proto protoc -I. \ -Ivendor -Ivendor/github.com/gogo/protobuf/protobuf \ @@ -102,4 +107,5 @@ clean: test-vet \ mocks \ docs \ - clean + clean \ + kubetypes diff --git a/_run/multi/akash-provider/run.sh b/_run/multi/akash-provider/run.sh index 0eae6d3343..b10a2c8776 100644 --- a/_run/multi/akash-provider/run.sh +++ b/_run/multi/akash-provider/run.sh @@ -36,4 +36,4 @@ fi echo "running provider $(cat "$providerKey")..." -./akash provider run "$(cat "$providerKey")" -k master --kube +./akash provider run "$(cat "$providerKey")" -k master --kube --manifest-ns "$1" diff --git a/_run/multi/akash-provider/templates/deployment.yaml b/_run/multi/akash-provider/templates/deployment.yaml index 85ca257fb8..eefee8bb84 100644 --- a/_run/multi/akash-provider/templates/deployment.yaml +++ b/_run/multi/akash-provider/templates/deployment.yaml @@ -24,7 +24,7 @@ spec: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} - command: [ "/bin/sh" , "/config/run.sh" ] + command: [ "/bin/sh" , "/config/run.sh", "{{ template "akash-provider.name" . }}" ] env: - name: AKASH_DATA value: /data diff --git a/cmd/akash/provider.go b/cmd/akash/provider.go index e34dc1a506..ae230be2c6 100644 --- a/cmd/akash/provider.go +++ b/cmd/akash/provider.go @@ -124,6 +124,7 @@ func runCommand() *cobra.Command { } cmd.Flags().Bool("kube", false, "use kubernetes cluster") + cmd.Flags().String("manifest-ns", "lease", "set manifest namespace") return cmd } @@ -152,7 +153,11 @@ func doProviderRunCommand(session session.Session, cmd *cobra.Command, args []st if ok, _ := cmd.Flags().GetBool("kube"); ok { session.Log().Debug("using kube client") - cclient, err = kube.NewClient(session.Log().With("cmp", "cluster-client")) + ns, err := cmd.Flags().GetString("manifest-ns") + if err != nil { + return err + } + cclient, err = kube.NewClient(session.Log().With("cmp", "cluster-client"), ns) if err != nil { return err } diff --git a/glide.lock b/glide.lock index 4fbdd2fd00..0132528a2f 100644 --- a/glide.lock +++ b/glide.lock @@ -297,6 +297,14 @@ imports: version: 3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4 - name: gopkg.in/yaml.v2 version: 5420a8b6744d3b0345ab293f6fcba19c978f1183 +- name: github.com/hashicorp/golang-lru + version: 0fb14efe8c47ae851c0034ed7a448854d3d34cf3 +- name: k8s.io/apiextensions-apiserver + version: e8ab413e0ae1e19df66d60088a1e11c97b73fdd9 +- name: k8s.io/code-generator + version: 69d88fb997c52c32288a40f5efb62add0a7c8e04 +- name: k8s.io/gengo + version: 9667b67e4b895d34f09fad596d28f285e0197131 - name: k8s.io/api version: 73d903622b7391f3312dcbac6483fed484e185f8 subpackages: diff --git a/glide.yaml b/glide.yaml index 7369038ed8..b2008bbadb 100644 --- a/glide.yaml +++ b/glide.yaml @@ -46,6 +46,7 @@ import: version: ^7.0.0 subpackages: - '...' +- package: k8s.io/apiextensions-apiserver - package: k8s.io/apimachinery subpackages: - '...' @@ -56,3 +57,6 @@ import: - package: github.com/golang/protobuf version: ~1.1.0 - package: github.com/juju/errors +- package: k8s.io/code-generator +- package: k8s.io/gengo +- package: github.com/hashicorp/golang-lru \ No newline at end of file diff --git a/pkg/apis/akash.network/v1/doc.go b/pkg/apis/akash.network/v1/doc.go new file mode 100644 index 0000000000..078bd6db26 --- /dev/null +++ b/pkg/apis/akash.network/v1/doc.go @@ -0,0 +1,5 @@ +// +k8s:deepcopy-gen=package + +// Package v1 is the v1 version of the API. +// +groupName=akash.network +package v1 diff --git a/pkg/apis/akash.network/v1/register.go b/pkg/apis/akash.network/v1/register.go new file mode 100644 index 0000000000..a639ed47ba --- /dev/null +++ b/pkg/apis/akash.network/v1/register.go @@ -0,0 +1,68 @@ +package v1 + +import ( + "reflect" + + apiextv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + apiextcs "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +const ( + CRDPlural string = "manifests" + CRDGroup string = "akash.network" + CRDVersion string = "v1" + FullCRDName string = CRDPlural + "." + CRDGroup +) + +var ( + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + AddToScheme = SchemeBuilder.AddToScheme +) + +// Create a Rest client with the new CRD Schema +var SchemeGroupVersion = schema.GroupVersion{Group: CRDGroup, Version: CRDVersion} + +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &Manifest{}, + &ManifestList{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} + +// Kind takes an unqualified kind and returns back a Group qualified GroupKind +func Kind(kind string) schema.GroupKind { + return SchemeGroupVersion.WithKind(kind).GroupKind() +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +// Create the CRD resource, ignore error if it already exists +func CreateCRD(clientset apiextcs.Interface) error { + crd := &apiextv1beta1.CustomResourceDefinition{ + ObjectMeta: metav1.ObjectMeta{Name: FullCRDName}, + Spec: apiextv1beta1.CustomResourceDefinitionSpec{ + Group: CRDGroup, + Version: CRDVersion, + Scope: apiextv1beta1.NamespaceScoped, + Names: apiextv1beta1.CustomResourceDefinitionNames{ + Plural: CRDPlural, + Kind: reflect.TypeOf(Manifest{}).Name(), + }, + }, + } + + _, err := clientset.ApiextensionsV1beta1().CustomResourceDefinitions().Create(crd) + if err != nil && apierrors.IsAlreadyExists(err) { + return nil + } + return err +} diff --git a/pkg/apis/akash.network/v1/types.go b/pkg/apis/akash.network/v1/types.go new file mode 100644 index 0000000000..3e58b165b0 --- /dev/null +++ b/pkg/apis/akash.network/v1/types.go @@ -0,0 +1,179 @@ +package v1 + +import ( + "bytes" + "encoding/json" + + "github.com/gogo/protobuf/jsonpb" + "github.com/ovrclk/akash/types" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type Manifest struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata"` + Spec ManifestSpec + Status ManifestStatus +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type ManifestGroup struct { + metav1.TypeMeta `json:",inline"` + // Placement profile name + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Service definitions + Services []*ManifestService `protobuf:"bytes,2,rep,name=services" json:"services,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type LeaseID struct { + metav1.TypeMeta `json:",inline"` + // deployment address + Deployment []byte `protobuf:"bytes,1,opt,name=deployment,proto3,customtype=github.com/ovrclk/akash/types/base.Bytes" json:"deployment"` + // deployment group sequence + Group uint64 `protobuf:"varint,2,opt,name=group,proto3" json:"group,omitempty"` + // order sequence + Order uint64 `protobuf:"varint,3,opt,name=order,proto3" json:"order,omitempty"` + // provider address + Provider []byte `protobuf:"bytes,4,opt,name=provider,proto3,customtype=github.com/ovrclk/akash/types/base.Bytes" json:"provider"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type ManifestSpec struct { + metav1.TypeMeta `json:",inline"` + LeaseID LeaseID `json:"lease_id"` + ManifestGroup ManifestGroup `json:"manifest_group"` +} + +type ManifestService struct { + // Service name + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Docker image + Image string `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"` + Args []string `protobuf:"bytes,3,rep,name=args" json:"args,omitempty"` + Env []string `protobuf:"bytes,4,rep,name=env" json:"env,omitempty"` + // Resource requirements + Unit ResourceUnit `protobuf:"bytes,5,opt,name=unit" json:"unit"` + // Number of instances + Count uint32 `protobuf:"varint,6,opt,name=count,proto3" json:"count,omitempty"` + // Overlay Network Links + Expose []*ManifestServiceExpose `protobuf:"bytes,7,rep,name=expose" json:"expose,omitempty"` +} + +type ManifestServiceExpose struct { + Port uint32 `protobuf:"varint,1,opt,name=port,proto3" json:"port,omitempty"` + ExternalPort uint32 `protobuf:"varint,2,opt,name=externalPort,proto3" json:"externalPort,omitempty"` + Proto string `protobuf:"bytes,3,opt,name=proto,proto3" json:"proto,omitempty"` + Service string `protobuf:"bytes,4,opt,name=service,proto3" json:"service,omitempty"` + Global bool `protobuf:"varint,5,opt,name=global,proto3" json:"global,omitempty"` + // accepted hostnames + Hosts []string `protobuf:"bytes,6,rep,name=hosts" json:"hosts,omitempty"` +} + +type ResourceUnit struct { + CPU uint32 `protobuf:"varint,1,opt,name=CPU,proto3" json:"CPU,omitempty"` + Memory uint32 `protobuf:"varint,2,opt,name=memory,proto3" json:"memory,omitempty"` + Disk uint64 `protobuf:"varint,3,opt,name=disk,proto3" json:"disk,omitempty"` +} + +type ManifestStatus struct { + State string `json:"state,omitempty"` + Message string `json:"message,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type ManifestList struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata"` + Items []Manifest `json:"items"` +} + +func (m Manifest) ManifestGroup() *types.ManifestGroup { + group, err := m.manifestGroup() + if err != nil { + panic("kube manifest manifestGroup error: " + err.Error()) + } + return group +} + +func (m *Manifest) manifestGroup() (*types.ManifestGroup, error) { + group := &types.ManifestGroup{} + unmarshaler := &jsonpb.Unmarshaler{} + buf, err := json.Marshal(m.Spec.ManifestGroup) + if err != nil { + return nil, err + } + err = unmarshaler.Unmarshal(bytes.NewReader(buf), group) + if err != nil { + return nil, err + } + return group, nil +} + +func (m Manifest) LeaseID() types.LeaseID { + leaseID, err := m.leaseID() + if err != nil { + panic("kube manifest leaseID error: " + err.Error()) + } + return leaseID +} + +func (m *Manifest) leaseID() (types.LeaseID, error) { + leaseID := types.LeaseID{} + buf, err := json.Marshal(m.Spec.LeaseID) + if err != nil { + return leaseID, err + } + unmarshaler := &jsonpb.Unmarshaler{} + err = unmarshaler.Unmarshal(bytes.NewReader(buf), &leaseID) + if err != nil { + return leaseID, err + } + return leaseID, nil +} + +func NewManifest(name string, lid *types.LeaseID, mgroup *types.ManifestGroup) (*Manifest, error) { + buf := bytes.NewBuffer(nil) + marshaler := &jsonpb.Marshaler{} + manifestGroup := &ManifestGroup{} + leaseID := &LeaseID{} + + err := marshaler.Marshal(buf, mgroup) + if err != nil { + return nil, err + } + json.Unmarshal(buf.Bytes(), manifestGroup) + if err != nil { + return nil, err + } + + buf.Reset() + err = marshaler.Marshal(buf, lid) + if err != nil { + return nil, err + } + json.Unmarshal(buf.Bytes(), leaseID) + if err != nil { + return nil, err + } + + return &Manifest{ + TypeMeta: metav1.TypeMeta{ + Kind: "Manifest", + APIVersion: "akash.network/v1", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: name, + }, + Spec: ManifestSpec{ + ManifestGroup: *manifestGroup, + LeaseID: *leaseID, + }, + }, nil +} diff --git a/pkg/apis/akash.network/v1/types_test.go b/pkg/apis/akash.network/v1/types_test.go new file mode 100644 index 0000000000..8c95ddb321 --- /dev/null +++ b/pkg/apis/akash.network/v1/types_test.go @@ -0,0 +1,40 @@ +package v1 + +import ( + "testing" + + "github.com/ovrclk/akash/sdl" + "github.com/ovrclk/akash/testutil" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestToProto(t *testing.T) { + lease := testutil.Lease(testutil.Address(t), testutil.Address(t), 1, 2, 3) + + sdl, err := sdl.ReadFile("../../../../_run/kube/deployment.yml") + require.NoError(t, err) + + mani, err := sdl.Manifest() + require.NoError(t, err) + + _, err = NewManifest("name", &lease.LeaseID, mani.Groups[0]) + assert.NoError(t, err) +} + +func TestFromProto(t *testing.T) { + lease := testutil.Lease(testutil.Address(t), testutil.Address(t), 1, 2, 3) + sdl, err := sdl.ReadFile("../../../../_run/kube/deployment.yml") + require.NoError(t, err) + + mani, err := sdl.Manifest() + require.NoError(t, err) + + kubeManifest, err := NewManifest("name", &lease.LeaseID, mani.Groups[0]) + assert.NoError(t, err) + + fromKube := kubeManifest.ManifestGroup() + assert.NoError(t, err) + + assert.Equal(t, mani.Groups[0].Name, fromKube.Name) +} diff --git a/pkg/apis/akash.network/v1/zz_generated.deepcopy.go b/pkg/apis/akash.network/v1/zz_generated.deepcopy.go new file mode 100644 index 0000000000..4d835cc93f --- /dev/null +++ b/pkg/apis/akash.network/v1/zz_generated.deepcopy.go @@ -0,0 +1,279 @@ +// +build !ignore_autogenerated + +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LeaseID) DeepCopyInto(out *LeaseID) { + *out = *in + out.TypeMeta = in.TypeMeta + if in.Deployment != nil { + in, out := &in.Deployment, &out.Deployment + *out = make([]byte, len(*in)) + copy(*out, *in) + } + if in.Provider != nil { + in, out := &in.Provider, &out.Provider + *out = make([]byte, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeaseID. +func (in *LeaseID) DeepCopy() *LeaseID { + if in == nil { + return nil + } + out := new(LeaseID) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LeaseID) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Manifest) DeepCopyInto(out *Manifest) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Manifest. +func (in *Manifest) DeepCopy() *Manifest { + if in == nil { + return nil + } + out := new(Manifest) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Manifest) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManifestGroup) DeepCopyInto(out *ManifestGroup) { + *out = *in + out.TypeMeta = in.TypeMeta + if in.Services != nil { + in, out := &in.Services, &out.Services + *out = make([]*ManifestService, len(*in)) + for i := range *in { + if (*in)[i] == nil { + (*out)[i] = nil + } else { + in, out := &(*in)[i], &(*out)[i] + *out = new(ManifestService) + (*in).DeepCopyInto(*out) + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManifestGroup. +func (in *ManifestGroup) DeepCopy() *ManifestGroup { + if in == nil { + return nil + } + out := new(ManifestGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ManifestGroup) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManifestList) DeepCopyInto(out *ManifestList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Manifest, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManifestList. +func (in *ManifestList) DeepCopy() *ManifestList { + if in == nil { + return nil + } + out := new(ManifestList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ManifestList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManifestService) DeepCopyInto(out *ManifestService) { + *out = *in + if in.Args != nil { + in, out := &in.Args, &out.Args + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Env != nil { + in, out := &in.Env, &out.Env + *out = make([]string, len(*in)) + copy(*out, *in) + } + out.Unit = in.Unit + if in.Expose != nil { + in, out := &in.Expose, &out.Expose + *out = make([]*ManifestServiceExpose, len(*in)) + for i := range *in { + if (*in)[i] == nil { + (*out)[i] = nil + } else { + in, out := &(*in)[i], &(*out)[i] + *out = new(ManifestServiceExpose) + (*in).DeepCopyInto(*out) + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManifestService. +func (in *ManifestService) DeepCopy() *ManifestService { + if in == nil { + return nil + } + out := new(ManifestService) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManifestServiceExpose) DeepCopyInto(out *ManifestServiceExpose) { + *out = *in + if in.Hosts != nil { + in, out := &in.Hosts, &out.Hosts + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManifestServiceExpose. +func (in *ManifestServiceExpose) DeepCopy() *ManifestServiceExpose { + if in == nil { + return nil + } + out := new(ManifestServiceExpose) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManifestSpec) DeepCopyInto(out *ManifestSpec) { + *out = *in + out.TypeMeta = in.TypeMeta + in.LeaseID.DeepCopyInto(&out.LeaseID) + in.ManifestGroup.DeepCopyInto(&out.ManifestGroup) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManifestSpec. +func (in *ManifestSpec) DeepCopy() *ManifestSpec { + if in == nil { + return nil + } + out := new(ManifestSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ManifestSpec) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManifestStatus) DeepCopyInto(out *ManifestStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManifestStatus. +func (in *ManifestStatus) DeepCopy() *ManifestStatus { + if in == nil { + return nil + } + out := new(ManifestStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceUnit) DeepCopyInto(out *ResourceUnit) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceUnit. +func (in *ResourceUnit) DeepCopy() *ResourceUnit { + if in == nil { + return nil + } + out := new(ResourceUnit) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go new file mode 100644 index 0000000000..61a801842c --- /dev/null +++ b/pkg/client/clientset/versioned/clientset.go @@ -0,0 +1,100 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package versioned + +import ( + glog "github.com/golang/glog" + akashv1 "github.com/ovrclk/akash/pkg/client/clientset/versioned/typed/akash.network/v1" + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + AkashV1() akashv1.AkashV1Interface + // Deprecated: please explicitly pick a version if possible. + Akash() akashv1.AkashV1Interface +} + +// Clientset contains the clients for groups. Each group has exactly one +// version included in a Clientset. +type Clientset struct { + *discovery.DiscoveryClient + akashV1 *akashv1.AkashV1Client +} + +// AkashV1 retrieves the AkashV1Client +func (c *Clientset) AkashV1() akashv1.AkashV1Interface { + return c.akashV1 +} + +// Deprecated: Akash retrieves the default version of AkashClient. +// Please explicitly pick a version. +func (c *Clientset) Akash() akashv1.AkashV1Interface { + return c.akashV1 +} + +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + if c == nil { + return nil + } + return c.DiscoveryClient +} + +// NewForConfig creates a new Clientset for the given config. +func NewForConfig(c *rest.Config) (*Clientset, error) { + configShallowCopy := *c + if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { + configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) + } + var cs Clientset + var err error + cs.akashV1, err = akashv1.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) + if err != nil { + glog.Errorf("failed to create the DiscoveryClient: %v", err) + return nil, err + } + return &cs, nil +} + +// NewForConfigOrDie creates a new Clientset for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *Clientset { + var cs Clientset + cs.akashV1 = akashv1.NewForConfigOrDie(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) + return &cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.akashV1 = akashv1.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/pkg/client/clientset/versioned/doc.go b/pkg/client/clientset/versioned/doc.go new file mode 100644 index 0000000000..006b792140 --- /dev/null +++ b/pkg/client/clientset/versioned/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated clientset. +package versioned diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go new file mode 100644 index 0000000000..f5702b9db6 --- /dev/null +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,81 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + clientset "github.com/ovrclk/akash/pkg/client/clientset/versioned" + akashv1 "github.com/ovrclk/akash/pkg/client/clientset/versioned/typed/akash.network/v1" + fakeakashv1 "github.com/ovrclk/akash/pkg/client/clientset/versioned/typed/akash.network/v1/fake" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" +) + +// NewSimpleClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +func NewSimpleClientset(objects ...runtime.Object) *Clientset { + o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + fakePtr := testing.Fake{} + fakePtr.AddReactor("*", "*", testing.ObjectReaction(o)) + fakePtr.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return &Clientset{fakePtr, &fakediscovery.FakeDiscovery{Fake: &fakePtr}} +} + +// Clientset implements clientset.Interface. Meant to be embedded into a +// struct to get a default implementation. This makes faking out just the method +// you want to test easier. +type Clientset struct { + testing.Fake + discovery *fakediscovery.FakeDiscovery +} + +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + return c.discovery +} + +var _ clientset.Interface = &Clientset{} + +// AkashV1 retrieves the AkashV1Client +func (c *Clientset) AkashV1() akashv1.AkashV1Interface { + return &fakeakashv1.FakeAkashV1{Fake: &c.Fake} +} + +// Akash retrieves the AkashV1Client +func (c *Clientset) Akash() akashv1.AkashV1Interface { + return &fakeakashv1.FakeAkashV1{Fake: &c.Fake} +} diff --git a/pkg/client/clientset/versioned/fake/doc.go b/pkg/client/clientset/versioned/fake/doc.go new file mode 100644 index 0000000000..0bc260bcaa --- /dev/null +++ b/pkg/client/clientset/versioned/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated fake clientset. +package fake diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go new file mode 100644 index 0000000000..ab2eaf7c03 --- /dev/null +++ b/pkg/client/clientset/versioned/fake/register.go @@ -0,0 +1,54 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + akashv1 "github.com/ovrclk/akash/pkg/apis/akash.network/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) +var parameterCodec = runtime.NewParameterCodec(scheme) + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + AddToScheme(scheme) +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +func AddToScheme(scheme *runtime.Scheme) { + akashv1.AddToScheme(scheme) +} diff --git a/pkg/client/clientset/versioned/scheme/doc.go b/pkg/client/clientset/versioned/scheme/doc.go new file mode 100644 index 0000000000..5c5c8debb6 --- /dev/null +++ b/pkg/client/clientset/versioned/scheme/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package contains the scheme of the automatically generated clientset. +package scheme diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go new file mode 100644 index 0000000000..6fa1a044e8 --- /dev/null +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -0,0 +1,54 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package scheme + +import ( + akashv1 "github.com/ovrclk/akash/pkg/apis/akash.network/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" +) + +var Scheme = runtime.NewScheme() +var Codecs = serializer.NewCodecFactory(Scheme) +var ParameterCodec = runtime.NewParameterCodec(Scheme) + +func init() { + v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) + AddToScheme(Scheme) +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +func AddToScheme(scheme *runtime.Scheme) { + akashv1.AddToScheme(scheme) +} diff --git a/pkg/client/clientset/versioned/typed/akash.network/v1/akash.network_client.go b/pkg/client/clientset/versioned/typed/akash.network/v1/akash.network_client.go new file mode 100644 index 0000000000..7c8a768522 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/akash.network/v1/akash.network_client.go @@ -0,0 +1,90 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/ovrclk/akash/pkg/apis/akash.network/v1" + "github.com/ovrclk/akash/pkg/client/clientset/versioned/scheme" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + rest "k8s.io/client-go/rest" +) + +type AkashV1Interface interface { + RESTClient() rest.Interface + ManifestsGetter +} + +// AkashV1Client is used to interact with features provided by the akash.network group. +type AkashV1Client struct { + restClient rest.Interface +} + +func (c *AkashV1Client) Manifests(namespace string) ManifestInterface { + return newManifests(c, namespace) +} + +// NewForConfig creates a new AkashV1Client for the given config. +func NewForConfig(c *rest.Config) (*AkashV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &AkashV1Client{client}, nil +} + +// NewForConfigOrDie creates a new AkashV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *AkashV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new AkashV1Client for the given RESTClient. +func New(c rest.Interface) *AkashV1Client { + return &AkashV1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs} + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *AkashV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/pkg/client/clientset/versioned/typed/akash.network/v1/doc.go b/pkg/client/clientset/versioned/typed/akash.network/v1/doc.go new file mode 100644 index 0000000000..d007a2903d --- /dev/null +++ b/pkg/client/clientset/versioned/typed/akash.network/v1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1 diff --git a/pkg/client/clientset/versioned/typed/akash.network/v1/fake/doc.go b/pkg/client/clientset/versioned/typed/akash.network/v1/fake/doc.go new file mode 100644 index 0000000000..87a1873edc --- /dev/null +++ b/pkg/client/clientset/versioned/typed/akash.network/v1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/pkg/client/clientset/versioned/typed/akash.network/v1/fake/fake_akash.network_client.go b/pkg/client/clientset/versioned/typed/akash.network/v1/fake/fake_akash.network_client.go new file mode 100644 index 0000000000..943fd1cf1f --- /dev/null +++ b/pkg/client/clientset/versioned/typed/akash.network/v1/fake/fake_akash.network_client.go @@ -0,0 +1,40 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "github.com/ovrclk/akash/pkg/client/clientset/versioned/typed/akash.network/v1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeAkashV1 struct { + *testing.Fake +} + +func (c *FakeAkashV1) Manifests(namespace string) v1.ManifestInterface { + return &FakeManifests{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeAkashV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/pkg/client/clientset/versioned/typed/akash.network/v1/fake/fake_manifest.go b/pkg/client/clientset/versioned/typed/akash.network/v1/fake/fake_manifest.go new file mode 100644 index 0000000000..1046227648 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/akash.network/v1/fake/fake_manifest.go @@ -0,0 +1,140 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + akash_network_v1 "github.com/ovrclk/akash/pkg/apis/akash.network/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeManifests implements ManifestInterface +type FakeManifests struct { + Fake *FakeAkashV1 + ns string +} + +var manifestsResource = schema.GroupVersionResource{Group: "akash.network", Version: "v1", Resource: "manifests"} + +var manifestsKind = schema.GroupVersionKind{Group: "akash.network", Version: "v1", Kind: "Manifest"} + +// Get takes name of the manifest, and returns the corresponding manifest object, and an error if there is any. +func (c *FakeManifests) Get(name string, options v1.GetOptions) (result *akash_network_v1.Manifest, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(manifestsResource, c.ns, name), &akash_network_v1.Manifest{}) + + if obj == nil { + return nil, err + } + return obj.(*akash_network_v1.Manifest), err +} + +// List takes label and field selectors, and returns the list of Manifests that match those selectors. +func (c *FakeManifests) List(opts v1.ListOptions) (result *akash_network_v1.ManifestList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(manifestsResource, manifestsKind, c.ns, opts), &akash_network_v1.ManifestList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &akash_network_v1.ManifestList{} + for _, item := range obj.(*akash_network_v1.ManifestList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested manifests. +func (c *FakeManifests) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(manifestsResource, c.ns, opts)) + +} + +// Create takes the representation of a manifest and creates it. Returns the server's representation of the manifest, and an error, if there is any. +func (c *FakeManifests) Create(manifest *akash_network_v1.Manifest) (result *akash_network_v1.Manifest, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(manifestsResource, c.ns, manifest), &akash_network_v1.Manifest{}) + + if obj == nil { + return nil, err + } + return obj.(*akash_network_v1.Manifest), err +} + +// Update takes the representation of a manifest and updates it. Returns the server's representation of the manifest, and an error, if there is any. +func (c *FakeManifests) Update(manifest *akash_network_v1.Manifest) (result *akash_network_v1.Manifest, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(manifestsResource, c.ns, manifest), &akash_network_v1.Manifest{}) + + if obj == nil { + return nil, err + } + return obj.(*akash_network_v1.Manifest), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeManifests) UpdateStatus(manifest *akash_network_v1.Manifest) (*akash_network_v1.Manifest, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(manifestsResource, "status", c.ns, manifest), &akash_network_v1.Manifest{}) + + if obj == nil { + return nil, err + } + return obj.(*akash_network_v1.Manifest), err +} + +// Delete takes name of the manifest and deletes it. Returns an error if one occurs. +func (c *FakeManifests) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(manifestsResource, c.ns, name), &akash_network_v1.Manifest{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeManifests) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(manifestsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &akash_network_v1.ManifestList{}) + return err +} + +// Patch applies the patch and returns the patched manifest. +func (c *FakeManifests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *akash_network_v1.Manifest, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(manifestsResource, c.ns, name, data, subresources...), &akash_network_v1.Manifest{}) + + if obj == nil { + return nil, err + } + return obj.(*akash_network_v1.Manifest), err +} diff --git a/pkg/client/clientset/versioned/typed/akash.network/v1/generated_expansion.go b/pkg/client/clientset/versioned/typed/akash.network/v1/generated_expansion.go new file mode 100644 index 0000000000..06b9a0da13 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/akash.network/v1/generated_expansion.go @@ -0,0 +1,21 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +type ManifestExpansion interface{} diff --git a/pkg/client/clientset/versioned/typed/akash.network/v1/manifest.go b/pkg/client/clientset/versioned/typed/akash.network/v1/manifest.go new file mode 100644 index 0000000000..9871ea412d --- /dev/null +++ b/pkg/client/clientset/versioned/typed/akash.network/v1/manifest.go @@ -0,0 +1,174 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/ovrclk/akash/pkg/apis/akash.network/v1" + scheme "github.com/ovrclk/akash/pkg/client/clientset/versioned/scheme" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// ManifestsGetter has a method to return a ManifestInterface. +// A group's client should implement this interface. +type ManifestsGetter interface { + Manifests(namespace string) ManifestInterface +} + +// ManifestInterface has methods to work with Manifest resources. +type ManifestInterface interface { + Create(*v1.Manifest) (*v1.Manifest, error) + Update(*v1.Manifest) (*v1.Manifest, error) + UpdateStatus(*v1.Manifest) (*v1.Manifest, error) + Delete(name string, options *meta_v1.DeleteOptions) error + DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error + Get(name string, options meta_v1.GetOptions) (*v1.Manifest, error) + List(opts meta_v1.ListOptions) (*v1.ManifestList, error) + Watch(opts meta_v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Manifest, err error) + ManifestExpansion +} + +// manifests implements ManifestInterface +type manifests struct { + client rest.Interface + ns string +} + +// newManifests returns a Manifests +func newManifests(c *AkashV1Client, namespace string) *manifests { + return &manifests{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the manifest, and returns the corresponding manifest object, and an error if there is any. +func (c *manifests) Get(name string, options meta_v1.GetOptions) (result *v1.Manifest, err error) { + result = &v1.Manifest{} + err = c.client.Get(). + Namespace(c.ns). + Resource("manifests"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Manifests that match those selectors. +func (c *manifests) List(opts meta_v1.ListOptions) (result *v1.ManifestList, err error) { + result = &v1.ManifestList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("manifests"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested manifests. +func (c *manifests) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("manifests"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a manifest and creates it. Returns the server's representation of the manifest, and an error, if there is any. +func (c *manifests) Create(manifest *v1.Manifest) (result *v1.Manifest, err error) { + result = &v1.Manifest{} + err = c.client.Post(). + Namespace(c.ns). + Resource("manifests"). + Body(manifest). + Do(). + Into(result) + return +} + +// Update takes the representation of a manifest and updates it. Returns the server's representation of the manifest, and an error, if there is any. +func (c *manifests) Update(manifest *v1.Manifest) (result *v1.Manifest, err error) { + result = &v1.Manifest{} + err = c.client.Put(). + Namespace(c.ns). + Resource("manifests"). + Name(manifest.Name). + Body(manifest). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + +func (c *manifests) UpdateStatus(manifest *v1.Manifest) (result *v1.Manifest, err error) { + result = &v1.Manifest{} + err = c.client.Put(). + Namespace(c.ns). + Resource("manifests"). + Name(manifest.Name). + SubResource("status"). + Body(manifest). + Do(). + Into(result) + return +} + +// Delete takes name of the manifest and deletes it. Returns an error if one occurs. +func (c *manifests) Delete(name string, options *meta_v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("manifests"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *manifests) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("manifests"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched manifest. +func (c *manifests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Manifest, err error) { + result = &v1.Manifest{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("manifests"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/client/informers/externalversions/akash.network/interface.go b/pkg/client/informers/externalversions/akash.network/interface.go new file mode 100644 index 0000000000..b001befc00 --- /dev/null +++ b/pkg/client/informers/externalversions/akash.network/interface.go @@ -0,0 +1,46 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package akash + +import ( + v1 "github.com/ovrclk/akash/pkg/client/informers/externalversions/akash.network/v1" + internalinterfaces "github.com/ovrclk/akash/pkg/client/informers/externalversions/internalinterfaces" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1 provides access to shared informers for resources in V1. + V1() v1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1 returns a new v1.Interface. +func (g *group) V1() v1.Interface { + return v1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/pkg/client/informers/externalversions/akash.network/v1/interface.go b/pkg/client/informers/externalversions/akash.network/v1/interface.go new file mode 100644 index 0000000000..b05c9a1413 --- /dev/null +++ b/pkg/client/informers/externalversions/akash.network/v1/interface.go @@ -0,0 +1,45 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + internalinterfaces "github.com/ovrclk/akash/pkg/client/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // Manifests returns a ManifestInformer. + Manifests() ManifestInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// Manifests returns a ManifestInformer. +func (v *version) Manifests() ManifestInformer { + return &manifestInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/pkg/client/informers/externalversions/akash.network/v1/manifest.go b/pkg/client/informers/externalversions/akash.network/v1/manifest.go new file mode 100644 index 0000000000..c34ebd23cf --- /dev/null +++ b/pkg/client/informers/externalversions/akash.network/v1/manifest.go @@ -0,0 +1,89 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + time "time" + + akash_network_v1 "github.com/ovrclk/akash/pkg/apis/akash.network/v1" + versioned "github.com/ovrclk/akash/pkg/client/clientset/versioned" + internalinterfaces "github.com/ovrclk/akash/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/ovrclk/akash/pkg/client/listers/akash.network/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ManifestInformer provides access to a shared informer and lister for +// Manifests. +type ManifestInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ManifestLister +} + +type manifestInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewManifestInformer constructs a new informer for Manifest type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewManifestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredManifestInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredManifestInformer constructs a new informer for Manifest type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredManifestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AkashV1().Manifests(namespace).List(options) + }, + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AkashV1().Manifests(namespace).Watch(options) + }, + }, + &akash_network_v1.Manifest{}, + resyncPeriod, + indexers, + ) +} + +func (f *manifestInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredManifestInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *manifestInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&akash_network_v1.Manifest{}, f.defaultInformer) +} + +func (f *manifestInformer) Lister() v1.ManifestLister { + return v1.NewManifestLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go new file mode 100644 index 0000000000..f0fcec1e2e --- /dev/null +++ b/pkg/client/informers/externalversions/factory.go @@ -0,0 +1,131 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + reflect "reflect" + sync "sync" + time "time" + + versioned "github.com/ovrclk/akash/pkg/client/clientset/versioned" + akash_network "github.com/ovrclk/akash/pkg/client/informers/externalversions/akash.network" + internalinterfaces "github.com/ovrclk/akash/pkg/client/informers/externalversions/internalinterfaces" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" +) + +type sharedInformerFactory struct { + client versioned.Interface + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc + lock sync.Mutex + defaultResync time.Duration + + informers map[reflect.Type]cache.SharedIndexInformer + // startedInformers is used for tracking which informers have been started. + // This allows Start() to be called multiple times safely. + startedInformers map[reflect.Type]bool +} + +// NewSharedInformerFactory constructs a new instance of sharedInformerFactory +func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { + return NewFilteredSharedInformerFactory(client, defaultResync, v1.NamespaceAll, nil) +} + +// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. +// Listers obtained via this SharedInformerFactory will be subject to the same filters +// as specified here. +func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { + return &sharedInformerFactory{ + client: client, + namespace: namespace, + tweakListOptions: tweakListOptions, + defaultResync: defaultResync, + informers: make(map[reflect.Type]cache.SharedIndexInformer), + startedInformers: make(map[reflect.Type]bool), + } +} + +// Start initializes all requested informers. +func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { + f.lock.Lock() + defer f.lock.Unlock() + + for informerType, informer := range f.informers { + if !f.startedInformers[informerType] { + go informer.Run(stopCh) + f.startedInformers[informerType] = true + } + } +} + +// WaitForCacheSync waits for all started informers' cache were synced. +func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { + informers := func() map[reflect.Type]cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informers := map[reflect.Type]cache.SharedIndexInformer{} + for informerType, informer := range f.informers { + if f.startedInformers[informerType] { + informers[informerType] = informer + } + } + return informers + }() + + res := map[reflect.Type]bool{} + for informType, informer := range informers { + res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) + } + return res +} + +// InternalInformerFor returns the SharedIndexInformer for obj using an internal +// client. +func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informerType := reflect.TypeOf(obj) + informer, exists := f.informers[informerType] + if exists { + return informer + } + informer = newFunc(f.client, f.defaultResync) + f.informers[informerType] = informer + + return informer +} + +// SharedInformerFactory provides shared informers for resources in all known +// API group versions. +type SharedInformerFactory interface { + internalinterfaces.SharedInformerFactory + ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + + Akash() akash_network.Interface +} + +func (f *sharedInformerFactory) Akash() akash_network.Interface { + return akash_network.New(f, f.namespace, f.tweakListOptions) +} diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go new file mode 100644 index 0000000000..e589bf16b9 --- /dev/null +++ b/pkg/client/informers/externalversions/generic.go @@ -0,0 +1,62 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + "fmt" + + v1 "github.com/ovrclk/akash/pkg/apis/akash.network/v1" + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" +) + +// GenericInformer is type of SharedIndexInformer which will locate and delegate to other +// sharedInformers based on type +type GenericInformer interface { + Informer() cache.SharedIndexInformer + Lister() cache.GenericLister +} + +type genericInformer struct { + informer cache.SharedIndexInformer + resource schema.GroupResource +} + +// Informer returns the SharedIndexInformer. +func (f *genericInformer) Informer() cache.SharedIndexInformer { + return f.informer +} + +// Lister returns the GenericLister. +func (f *genericInformer) Lister() cache.GenericLister { + return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) +} + +// ForResource gives generic access to a shared informer of the matching type +// TODO extend this to unknown resources with a client pool +func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { + switch resource { + // Group=akash.network, Version=v1 + case v1.SchemeGroupVersion.WithResource("manifests"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Akash().V1().Manifests().Informer()}, nil + + } + + return nil, fmt.Errorf("no informer found for %v", resource) +} diff --git a/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go new file mode 100644 index 0000000000..12f8e36309 --- /dev/null +++ b/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -0,0 +1,38 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package internalinterfaces + +import ( + time "time" + + versioned "github.com/ovrclk/akash/pkg/client/clientset/versioned" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + cache "k8s.io/client-go/tools/cache" +) + +type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer + +// SharedInformerFactory a small interface to allow for adding an informer without an import cycle +type SharedInformerFactory interface { + Start(stopCh <-chan struct{}) + InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer +} + +type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/pkg/client/listers/akash.network/v1/expansion_generated.go b/pkg/client/listers/akash.network/v1/expansion_generated.go new file mode 100644 index 0000000000..6b32fc8420 --- /dev/null +++ b/pkg/client/listers/akash.network/v1/expansion_generated.go @@ -0,0 +1,27 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +// ManifestListerExpansion allows custom methods to be added to +// ManifestLister. +type ManifestListerExpansion interface{} + +// ManifestNamespaceListerExpansion allows custom methods to be added to +// ManifestNamespaceLister. +type ManifestNamespaceListerExpansion interface{} diff --git a/pkg/client/listers/akash.network/v1/manifest.go b/pkg/client/listers/akash.network/v1/manifest.go new file mode 100644 index 0000000000..058a049b7b --- /dev/null +++ b/pkg/client/listers/akash.network/v1/manifest.go @@ -0,0 +1,94 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/ovrclk/akash/pkg/apis/akash.network/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ManifestLister helps list Manifests. +type ManifestLister interface { + // List lists all Manifests in the indexer. + List(selector labels.Selector) (ret []*v1.Manifest, err error) + // Manifests returns an object that can list and get Manifests. + Manifests(namespace string) ManifestNamespaceLister + ManifestListerExpansion +} + +// manifestLister implements the ManifestLister interface. +type manifestLister struct { + indexer cache.Indexer +} + +// NewManifestLister returns a new ManifestLister. +func NewManifestLister(indexer cache.Indexer) ManifestLister { + return &manifestLister{indexer: indexer} +} + +// List lists all Manifests in the indexer. +func (s *manifestLister) List(selector labels.Selector) (ret []*v1.Manifest, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Manifest)) + }) + return ret, err +} + +// Manifests returns an object that can list and get Manifests. +func (s *manifestLister) Manifests(namespace string) ManifestNamespaceLister { + return manifestNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// ManifestNamespaceLister helps list and get Manifests. +type ManifestNamespaceLister interface { + // List lists all Manifests in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1.Manifest, err error) + // Get retrieves the Manifest from the indexer for a given namespace and name. + Get(name string) (*v1.Manifest, error) + ManifestNamespaceListerExpansion +} + +// manifestNamespaceLister implements the ManifestNamespaceLister +// interface. +type manifestNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all Manifests in the indexer for a given namespace. +func (s manifestNamespaceLister) List(selector labels.Selector) (ret []*v1.Manifest, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Manifest)) + }) + return ret, err +} + +// Get retrieves the Manifest from the indexer for a given namespace and name. +func (s manifestNamespaceLister) Get(name string) (*v1.Manifest, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("manifest"), name) + } + return obj.(*v1.Manifest), nil +} diff --git a/provider/cluster/kube/apply.go b/provider/cluster/kube/apply.go index ef90b49228..bf4f35b7d9 100644 --- a/provider/cluster/kube/apply.go +++ b/provider/cluster/kube/apply.go @@ -1,6 +1,7 @@ package kube import ( + 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" @@ -73,3 +74,33 @@ func applyIngress(kc kubernetes.Interface, b *ingressBuilder) error { } return err } + +func prepareEnvironment(kc kubernetes.Interface, ns string) error { + _, err := kc.CoreV1().Namespaces().Get(ns, metav1.GetOptions{}) + if errors.IsNotFound(err) { + obj := &corev1.Namespace{ + ObjectMeta: metav1.ObjectMeta{ + Name: ns, + }, + } + _, err = kc.CoreV1().Namespaces().Create(obj) + } + return err +} + +func applyManifest(c *client, b *manifestBuilder) error { + obj, err := c.mc.AkashV1().Manifests(c.ns).Get(b.name(), metav1.GetOptions{}) + switch { + case err == nil: + obj, err = b.update(obj) + if err == nil { + _, err = c.mc.AkashV1().Manifests(c.ns).Update(obj) + } + case errors.IsNotFound(err): + obj, err = b.create() + if err == nil { + _, err = c.mc.AkashV1().Manifests(c.ns).Create(obj) + } + } + return err +} diff --git a/provider/cluster/kube/builder.go b/provider/cluster/kube/builder.go index 1088eb1293..de49cfae86 100644 --- a/provider/cluster/kube/builder.go +++ b/provider/cluster/kube/builder.go @@ -6,6 +6,7 @@ import ( "strconv" "strings" + akashv1 "github.com/ovrclk/akash/pkg/apis/akash.network/v1" "github.com/ovrclk/akash/types" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" @@ -42,38 +43,22 @@ func newNSBuilder(lid types.LeaseID, group *types.ManifestGroup) *nsBuilder { return &nsBuilder{builder: builder{lid, group}} } -func (b *nsBuilder) annotations() (map[string]string, error) { - return deploymentToAnnotation(newDeployment(b.lid, b.group)) -} - func (b *nsBuilder) name() string { return b.ns() } func (b *nsBuilder) create() (*corev1.Namespace, error) { - annotations, err := b.annotations() - if err != nil { - return nil, err - } - return &corev1.Namespace{ ObjectMeta: metav1.ObjectMeta{ - Name: b.ns(), - Labels: b.labels(), - Annotations: annotations, + Name: b.ns(), + Labels: b.labels(), }, }, nil } func (b *nsBuilder) update(obj *corev1.Namespace) (*corev1.Namespace, error) { - annotations, err := b.annotations() - if err != nil { - return nil, err - } - obj.Name = b.ns() obj.Labels = b.labels() - obj.Annotations = annotations return obj, nil } @@ -137,7 +122,7 @@ func (b *deploymentBuilder) update(obj *appsv1.Deployment) (*appsv1.Deployment, func (b *deploymentBuilder) container() corev1.Container { - qcpu := resource.NewQuantity(int64(b.service.Unit.Cpu), resource.DecimalSI) + qcpu := resource.NewQuantity(int64(b.service.Unit.CPU), resource.DecimalSI) qmem := resource.NewScaledQuantity(int64(b.service.Unit.Memory), resource.Mega) kcontainer := corev1.Container{ @@ -275,3 +260,26 @@ func lidNS(lid types.LeaseID) string { sha := sha1.Sum([]byte(path)) return hex.EncodeToString(sha[:]) } + +// manifest +type manifestBuilder struct { + builder +} + +func newManifestBuilder(lid types.LeaseID, group *types.ManifestGroup) *manifestBuilder { + return &manifestBuilder{ + builder: builder{lid, group}, + } +} + +func (b *manifestBuilder) create() (*akashv1.Manifest, error) { + return akashv1.NewManifest(b.ns(), &b.lid, b.group) +} + +func (b *manifestBuilder) update(obj *akashv1.Manifest) (*akashv1.Manifest, error) { + return akashv1.NewManifest(b.ns(), &b.lid, b.group) +} + +func (b *manifestBuilder) name() string { + return b.group.Name +} diff --git a/provider/cluster/kube/client.go b/provider/cluster/kube/client.go index b651f84be5..c77261c11e 100644 --- a/provider/cluster/kube/client.go +++ b/provider/cluster/kube/client.go @@ -5,9 +5,12 @@ import ( "os" "path" + akashv1 "github.com/ovrclk/akash/pkg/apis/akash.network/v1" + manifestclient "github.com/ovrclk/akash/pkg/client/clientset/versioned" "github.com/ovrclk/akash/provider/cluster" "github.com/ovrclk/akash/types" "github.com/tendermint/tmlibs/log" + apiextcs "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" @@ -21,10 +24,12 @@ type Client interface { type client struct { kc kubernetes.Interface + mc *manifestclient.Clientset + ns string log log.Logger } -func NewClient(log log.Logger) (Client, error) { +func NewClient(log log.Logger, ns string) (Client, error) { config, err := openKubeConfig(log) if err != nil { @@ -36,6 +41,26 @@ func NewClient(log log.Logger) (Client, error) { return nil, fmt.Errorf("error creating kubernetes client: %v", err) } + mc, err := manifestclient.NewForConfig(config) + if err != nil { + return nil, fmt.Errorf("error creating manifest client: %v", err) + } + + mcr, err := apiextcs.NewForConfig(config) + if err != nil { + return nil, fmt.Errorf("error creating apiextcs client: %v", err) + } + + err = akashv1.CreateCRD(mcr) + if err != nil { + panic(err) + } + + err = prepareEnvironment(kc, ns) + if err != nil { + panic(err) + } + _, err = kc.CoreV1().Namespaces().List(metav1.ListOptions{Limit: 1}) if err != nil { return nil, fmt.Errorf("error connecting to kubernetes: %v", err) @@ -43,6 +68,8 @@ func NewClient(log log.Logger) (Client, error) { return &client{ kc: kc, + mc: mc, + ns: ns, log: log, }, nil @@ -62,23 +89,15 @@ func openKubeConfig(log log.Logger) (*rest.Config, error) { func (c *client) Deployments() ([]cluster.Deployment, error) { - // TODO: loop to more pages. - namespaces, err := c.kc.CoreV1().Namespaces().List(metav1.ListOptions{ - LabelSelector: deploymentSelector().String(), - }) - + manifests, err := c.mc.AkashV1().Manifests(c.ns).List(metav1.ListOptions{}) if err != nil { return nil, err } var deployments []cluster.Deployment - for _, ns := range namespaces.Items { - obj, err := deploymentFromAnnotation(ns.Annotations) - if err != nil { - return nil, err - } - deployments = append(deployments, obj) + for _, manifest := range manifests.Items { + deployments = append(deployments, manifest) } return deployments, nil @@ -91,6 +110,11 @@ func (c *client) Deploy(lid types.LeaseID, group *types.ManifestGroup) error { return err } + if err := applyManifest(c, newManifestBuilder(lid, group)); err != nil { + c.log.Error("applying manifest", "err", err, "lease", lid) + return err + } + for _, service := range group.Services { if err := applyDeployment(c.kc, newDeploymentBuilder(lid, group, service)); err != nil { c.log.Error("applying deployment", "err", err, "lease", lid, "service", service.Name) diff --git a/provider/cluster/kube/deployment.go b/provider/cluster/kube/deployment.go index b282292cda..1e9a597b20 100644 --- a/provider/cluster/kube/deployment.go +++ b/provider/cluster/kube/deployment.go @@ -1,9 +1,6 @@ package kube import ( - "encoding/json" - "fmt" - "github.com/ovrclk/akash/types" "k8s.io/apimachinery/pkg/labels" ) @@ -38,25 +35,3 @@ func deploymentLabels() map[string]string { func deploymentSelector() labels.Selector { return labels.SelectorFromSet(deploymentLabels()) } - -func deploymentFromAnnotation(anns map[string]string) (*deployment, error) { - buf := anns[akashDeploymentAnnotation] - if len(buf) == 0 { - return nil, fmt.Errorf("deployment annotation not found") - } - - obj := &deployment{} - - return obj, json.Unmarshal([]byte(buf), obj) -} - -func deploymentToAnnotation(obj *deployment) (map[string]string, error) { - buf, err := json.Marshal(obj) - if err != nil { - return nil, err - } - - return map[string]string{ - akashDeploymentAnnotation: string(buf), - }, nil -} diff --git a/provider/cluster/kube/deployment_test.go b/provider/cluster/kube/deployment_test.go index 17c9382dd0..0611d32a88 100644 --- a/provider/cluster/kube/deployment_test.go +++ b/provider/cluster/kube/deployment_test.go @@ -1,30 +1,30 @@ package kube import ( + "os" "testing" + "github.com/ovrclk/akash/sdl" "github.com/ovrclk/akash/testutil" - "github.com/ovrclk/akash/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/tendermint/tmlibs/log" ) -func TestDeploymentAnnotations(t *testing.T) { +func TestDeploy(t *testing.T) { + t.Skip() lease := testutil.Lease(testutil.Address(t), testutil.Address(t), 1, 2, 3) - mgroup := &types.ManifestGroup{ - Name: "foo", - Services: []*types.ManifestService{ - {Name: "bar"}, - }, - } - obj := newDeployment(lease.LeaseID, mgroup) - - anns, err := deploymentToAnnotation(obj) + sdl, err := sdl.ReadFile("../../../_run/kube/deployment.yml") require.NoError(t, err) - robj, err := deploymentFromAnnotation(anns) + mani, err := sdl.Manifest() require.NoError(t, err) - assert.Equal(t, obj, robj) + log := log.NewTMLogger(os.Stdout) + client, err := NewClient(log, "lease") + assert.NoError(t, err) + + err = client.Deploy(lease.LeaseID, mani.Groups[0]) + assert.NoError(t, err) } diff --git a/provider/manifest/http/server_test.go b/provider/manifest/http/server_test.go index d10134b958..f046255511 100644 --- a/provider/manifest/http/server_test.go +++ b/provider/manifest/http/server_test.go @@ -67,5 +67,6 @@ func withServer(t *testing.T, fn func(), h *pmanifest.Handler) { assert.Error(t, http.ErrServerClosed, err) }() + testutil.SleepForThreadStart(t) fn() } diff --git a/sdl/v1.go b/sdl/v1.go index c35a6fbdf2..7a213c4a02 100644 --- a/sdl/v1.go +++ b/sdl/v1.go @@ -119,7 +119,7 @@ func (sdl *v1) DeploymentGroups() ([]*types.GroupSpec, error) { group.Resources = append(group.Resources, types.ResourceGroup{ Unit: types.ResourceUnit{ - Cpu: compute.CPU, + CPU: compute.CPU, Memory: compute.Memory, Disk: compute.Disk, }, @@ -178,7 +178,7 @@ func (sdl *v1) Manifest() (*types.Manifest, error) { Args: svc.Args, Env: svc.Env, Unit: types.ResourceUnit{ - Cpu: compute.CPU, + CPU: compute.CPU, Memory: compute.Memory, Disk: compute.Disk, }, diff --git a/sdl/v1_test.go b/sdl/v1_test.go index b8f2d71ffe..ab72646038 100644 --- a/sdl/v1_test.go +++ b/sdl/v1_test.go @@ -42,7 +42,7 @@ func Test_v1_Parse_simple(t *testing.T) { Count: 20, Price: 8, Unit: types.ResourceUnit{ - Cpu: 2, + CPU: 2, Memory: 3, Disk: 5, }, @@ -60,7 +60,7 @@ func Test_v1_Parse_simple(t *testing.T) { Name: "web", Image: "nginx", Unit: types.ResourceUnit{ - Cpu: 2, + CPU: 2, Memory: 3, Disk: 5, }, diff --git a/testutil/deployment.go b/testutil/deployment.go index 4daac69a33..ea1bc48dae 100644 --- a/testutil/deployment.go +++ b/testutil/deployment.go @@ -109,7 +109,7 @@ func DeploymentGroups(deployment base.Bytes, nonce uint64) *types.DeploymentGrou // nonce++ runit := types.ResourceUnit{ - Cpu: RandUint32(), + CPU: RandUint32(), Memory: RandUint32(), Disk: RandUint64(), } diff --git a/types/types.pb.go b/types/types.pb.go index 9bc64ef1d2..b5e5b9538c 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -734,7 +734,7 @@ func (m *TxCreateProvider) GetNonce() uint64 { // BEGIN EXCHANGE type ResourceUnit struct { - Cpu uint32 `protobuf:"varint,1,opt,name=cpu,proto3" json:"cpu,omitempty"` + CPU uint32 `protobuf:"varint,1,opt,name=CPU,proto3" json:"CPU,omitempty"` Memory uint32 `protobuf:"varint,2,opt,name=memory,proto3" json:"memory,omitempty"` Disk uint64 `protobuf:"varint,3,opt,name=disk,proto3" json:"disk,omitempty"` } @@ -744,9 +744,9 @@ func (m *ResourceUnit) String() string { return proto.CompactTextStri func (*ResourceUnit) ProtoMessage() {} func (*ResourceUnit) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{8} } -func (m *ResourceUnit) GetCpu() uint32 { +func (m *ResourceUnit) GetCPU() uint32 { if m != nil { - return m.Cpu + return m.CPU } return 0 } @@ -1656,8 +1656,8 @@ func (this *ResourceUnit) Compare(that interface{}) int { } else if this == nil { return -1 } - if this.Cpu != that1.Cpu { - if this.Cpu < that1.Cpu { + if this.CPU != that1.CPU { + if this.CPU < that1.CPU { return -1 } return 1 @@ -2150,7 +2150,7 @@ func (this *ResourceUnit) GoString() string { } s := make([]string, 0, 7) s = append(s, "&types.ResourceUnit{") - s = append(s, "Cpu: "+fmt.Sprintf("%#v", this.Cpu)+",\n") + s = append(s, "CPU: "+fmt.Sprintf("%#v", this.CPU)+",\n") s = append(s, "Memory: "+fmt.Sprintf("%#v", this.Memory)+",\n") s = append(s, "Disk: "+fmt.Sprintf("%#v", this.Disk)+",\n") s = append(s, "}") @@ -3821,9 +3821,9 @@ func (m *ResourceUnit) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Cpu", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CPU", wireType) } - m.Cpu = 0 + m.CPU = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -3833,7 +3833,7 @@ func (m *ResourceUnit) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Cpu |= (uint32(b) & 0x7F) << shift + m.CPU |= (uint32(b) & 0x7F) << shift if b < 0x80 { break } @@ -7552,114 +7552,114 @@ var ( func init() { proto.RegisterFile("types/types.proto", fileDescriptorTypes) } var fileDescriptorTypes = []byte{ - // 1742 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0xcd, 0x6f, 0x1b, 0xc7, - 0x15, 0xe7, 0x2e, 0xbf, 0x9f, 0x48, 0x9b, 0x1a, 0xab, 0x36, 0x6b, 0x18, 0x92, 0xbb, 0x2e, 0x50, - 0x15, 0xb6, 0x25, 0x43, 0x6e, 0x51, 0x7f, 0xa1, 0xb0, 0x48, 0x51, 0xa6, 0x5c, 0x99, 0x12, 0x46, - 0x94, 0x7b, 0xe8, 0xa1, 0x58, 0x91, 0x23, 0x6a, 0x21, 0x72, 0x97, 0xde, 0x59, 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38, 0xee, 0x2a, 0xbc, 0x80, 0xb9, 0x58, 0xd5, 0x6b, 0x13, 0x2c, 0x97, 0x58, 0x0f, 0x01, 0x86, - 0x5c, 0x94, 0x87, 0xf4, 0x76, 0x63, 0xab, 0xd6, 0x2c, 0x25, 0x50, 0x09, 0x0a, 0xcd, 0x5a, 0x63, - 0xb9, 0xd1, 0xfc, 0x27, 0x47, 0x47, 0xc9, 0x60, 0x9c, 0xb5, 0xc6, 0xd6, 0xf6, 0xea, 0xea, 0x5a, - 0x75, 0xad, 0xd6, 0x68, 0x96, 0x4c, 0xeb, 0x7f, 0x06, 0x64, 0x79, 0xbb, 0xf1, 0x5e, 0xaa, 0xf6, - 0x0c, 0xa4, 0xb9, 0x27, 0x55, 0x9c, 0x39, 0xa1, 0x6a, 0x79, 0x32, 0x5e, 0xcb, 0x3f, 0x37, 0x20, - 0x2d, 0x5a, 0x9f, 0x79, 0xad, 0x82, 0xab, 0x36, 0x53, 0x5a, 0x19, 0xab, 0xdb, 0x33, 0x90, 0x26, - 0x6e, 0x7b, 0x59, 0xe4, 0x79, 0x12, 0x0b, 0x82, 0xe1, 0x5d, 0x4f, 0xda, 0x2b, 0xba, 0x0a, 0xf1, - 0xd5, 0x53, 0xd5, 0x5a, 0x04, 0x18, 0x32, 0xa3, 0x15, 0xf0, 0xd9, 0x72, 0xb3, 0x5a, 0x8f, 0x55, - 0x40, 0x95, 0x64, 0x1b, 0x50, 0x8c, 0xb4, 0x70, 0x67, 0x35, 0xdb, 0xba, 0x05, 0x19, 0x2e, 0x4e, - 0x91, 0x15, 0x4d, 0xd8, 0x82, 0xae, 0x4c, 0x65, 0xe9, 0x1b, 0x03, 0x8a, 0x5a, 0x0f, 0xf3, 0x0b, - 0x06, 0x70, 0x06, 0xd2, 0x3c, 0x31, 0x55, 0xd7, 0xc1, 0x09, 0xb4, 0x0e, 0x39, 0x75, 0x1d, 0x9d, - 0x38, 0x47, 0x43, 0x0d, 0x12, 0x12, 0x5f, 0x19, 0x30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0x81, 0xe8, 0xf7, 0xf2, 0x58, 0x10, 0x95, 0xd2, 0xab, 0x37, 0xb3, 0xc6, 0x0f, - 0x6f, 0x66, 0x8d, 0x97, 0x6f, 0x67, 0x8d, 0x57, 0x6f, 0x67, 0x8d, 0x9d, 0x0c, 0xdf, 0xe0, 0xee, - 0xcf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x75, 0xe5, 0x0d, 0xb1, 0x0e, 0x18, 0x00, 0x00, + // 1741 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0x4b, 0x6f, 0x1b, 0x47, + 0x12, 0xe6, 0x0c, 0xdf, 0x25, 0xd2, 0xa6, 0xda, 0x5a, 0x9b, 0x6b, 0x18, 0x92, 0x77, 0xbc, 0xc0, + 0x6a, 0x61, 0x5b, 0x32, 0xe4, 0x5d, 0xac, 0x5f, 0x58, 0x58, 0xa4, 0x28, 0x53, 0x5e, 0x99, 0x12, + 0x5a, 0x94, 0xf7, 0x90, 0x43, 0x30, 0x12, 0x5b, 0xd4, 0x40, 0xe4, 0x0c, 0x3d, 0x3d, 0x54, 0xa4, + 0x43, 0xae, 0x09, 0x82, 0xfc, 0x81, 0x1c, 0x12, 0x20, 0x01, 0x72, 0xc8, 0x25, 0xff, 0x23, 0x48, + 0x2e, 0x3e, 0x1a, 0x49, 0xe0, 0xc0, 0x3e, 0xe5, 0x98, 0x5b, 0x6e, 0x41, 0xd0, 0xaf, 0x61, 0xcf, + 0x90, 0x32, 0x24, 0x4a, 0xce, 0x21, 0x97, 0x41, 0x57, 0x75, 0x75, 0x75, 0x75, 0xd5, 0x57, 0x35, + 0x5d, 0x0d, 0x93, 0xc1, 0x61, 0x8f, 0xd0, 0x79, 0xfe, 0x9d, 0xeb, 0xf9, 0x5e, 0xe0, 0xa1, 0x34, + 0x27, 0x2e, 0xdf, 0x6c, 0x3b, 0xc1, 0x6e, 0x7f, 0x6b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 0x63, 0x36, 0x0c, 0x5b, 0xf4, 0xf4, 0x09, 0x5b, 0xf4, 0x8c, 0xde, 0xa2, 0xff, 0x0b, 0x32, + 0xe4, 0xa0, 0xe7, 0x51, 0x52, 0xce, 0xf2, 0xa3, 0x5d, 0x19, 0x7d, 0xb4, 0x1a, 0x97, 0xc1, 0x52, + 0x96, 0x5d, 0x46, 0xfe, 0x32, 0x52, 0x82, 0x99, 0xde, 0xf3, 0xfc, 0x40, 0xbe, 0x46, 0xf0, 0x31, + 0xb2, 0xa0, 0x40, 0x0e, 0x02, 0xe2, 0xbb, 0x76, 0x67, 0x9d, 0xcd, 0x89, 0x5c, 0x8a, 0xf0, 0x44, + 0xa2, 0x79, 0x81, 0x27, 0x5f, 0x90, 0x04, 0x81, 0xca, 0x90, 0x95, 0x2e, 0xe5, 0x28, 0xc8, 0x63, + 0x45, 0xa2, 0x8b, 0x90, 0x69, 0x77, 0xbc, 0x2d, 0xbb, 0xc3, 0x8f, 0x9f, 0xc3, 0x92, 0x62, 0x7a, + 0x76, 0x3d, 0x1a, 0x88, 0x7e, 0x2f, 0x8f, 0x05, 0x51, 0x29, 0xbd, 0x78, 0x35, 0x6d, 0xfc, 0xf2, + 0x6a, 0xda, 0x78, 0xfe, 0x7a, 0xda, 0x78, 0xf1, 0x7a, 0xda, 0xd8, 0xca, 0xf0, 0x0d, 0x6e, 0xff, + 0x1e, 0x00, 0x00, 0xff, 0xff, 0xb3, 0x8d, 0x45, 0x23, 0x0e, 0x18, 0x00, 0x00, } diff --git a/types/types.proto b/types/types.proto index eca3c59b92..7753e3c6f2 100644 --- a/types/types.proto +++ b/types/types.proto @@ -81,7 +81,7 @@ message TxCreateProvider { /* BEGIN EXCHANGE */ message ResourceUnit { option (gogoproto.compare) = true; - uint32 cpu = 1; + uint32 CPU = 1; uint32 memory = 2; uint64 disk = 3; }