Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update k8s.io/cri-api to the latest version and make the binary works on macOS #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/virtual-kubelet/virtual-kubelet/trace"
"golang.org/x/net/context"
v1 "k8s.io/api/core/v1"
criapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
criapi "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// Call RunPodSandbox on the CRI client
Expand Down
27 changes: 13 additions & 14 deletions cri.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,25 @@ import (
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
criapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
criapi "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// TODO: Make these configurable
const CriSocketPath = "/run/containerd/containerd.sock"
const PodLogRoot = "/var/log/vk-cri/"
const PodVolRoot = "/run/vk-cri/volumes/"
const PodLogRootPerms = 0755
const PodVolRootPerms = 0755
const PodVolPerms = 0755
const PodSecretVolPerms = 0755
const PodSecretVolDir = "/secrets"
const PodSecretFilePerms = 0644
const PodConfigMapVolPerms = 0755
const PodConfigMapVolDir = "/configmaps"
const PodConfigMapFilePerms = 0644
const (
PodLogRoot = "/var/log/vk-cri/"
PodLogRootPerms = 0755
PodVolRootPerms = 0755
PodVolPerms = 0755
PodSecretVolPerms = 0755
PodSecretFilePerms = 0644
PodConfigMapVolPerms = 0755
PodConfigMapFilePerms = 0644
)

// Provider implements the virtual-kubelet provider interface and manages pods in a CRI runtime
// NOTE: Provider is not inteded as an alternative to Kubelet, rather it's intended for testing and POC purposes
// As such, it is far from functionally complete and never will be. It provides the minimum function necessary
//
// As such, it is far from functionally complete and never will be. It provides the minimum function necessary
type Provider struct {
resourceManager *manager.ResourceManager
podLogRoot string
Expand Down
8 changes: 8 additions & 0 deletions cri_darwin.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package cri

const (
CriSocketPath = "/var/run/containerd/containerd.sock"
PodVolRoot = "/var/run/vk-cri/volumes/"
PodSecretVolDir = "/var/lib/vk-cri/secrets"
PodConfigMapVolDir = "/var/lib/vk-cri/configmaps"
)
10 changes: 10 additions & 0 deletions cri_other.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//go:build !darwin

package cri

const (
CriSocketPath = "/run/containerd/containerd.sock"
PodVolRoot = "/run/vk-cri/volumes/"
PodSecretVolDir = "/secrets"
PodConfigMapVolDir = "/configmaps"
)
59 changes: 50 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,24 +1,65 @@
module github.com/virtual-kubelet/cri

go 1.12
go 1.21

require (
contrib.go.opencensus.io/exporter/ocagent v0.5.0
github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c // indirect
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef // indirect
github.com/pkg/errors v0.8.1
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.4.2
github.com/virtual-kubelet/node-cli v0.1.2
github.com/virtual-kubelet/virtual-kubelet v1.2.0
go.opencensus.io v0.22.0
golang.org/x/net v0.0.0-20191004110552-13f9640d40b9
google.golang.org/grpc v1.23.1
go.opencensus.io v0.24.0
golang.org/x/net v0.19.0
google.golang.org/grpc v1.58.3
k8s.io/api v0.0.0
k8s.io/apimachinery v0.0.0
k8s.io/client-go v11.0.0+incompatible // indirect
k8s.io/cri-api v0.0.0
)

require (
github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.0.0 // indirect
github.com/googleapis/gnostic v0.1.0 // indirect
github.com/gorilla/mux v1.7.3 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 // indirect
github.com/hashicorp/golang-lru v0.5.1 // indirect
github.com/imdario/mergo v0.3.7 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/json-iterator/go v1.1.6 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/spf13/cobra v0.0.5 // indirect
github.com/spf13/pflag v1.0.3 // indirect
golang.org/x/crypto v0.16.0 // indirect
golang.org/x/oauth2 v0.10.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/api v0.126.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.2.3 // indirect
k8s.io/apiserver v0.0.0 // indirect
k8s.io/client-go v11.0.0+incompatible // indirect
k8s.io/klog v0.3.3 // indirect
k8s.io/kube-openapi v0.0.0-20190510232812-a01b7d5d6c22 // indirect
k8s.io/kubernetes v1.15.2 // indirect
k8s.io/utils v0.0.0-20190607212802-c55fbcfc754a // indirect
sigs.k8s.io/yaml v1.1.0 // indirect
)

replace k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.0.0-20190805144654-3d5bf3a310c1
Expand All @@ -31,7 +72,7 @@ replace k8s.io/apiserver => k8s.io/apiserver v0.0.0-20190805142138-368b2058237c

replace k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.0.0-20190805144531-3985229e1802

replace k8s.io/cri-api => k8s.io/cri-api v0.0.0-20190531030430-6117653b35f1
replace k8s.io/cri-api => k8s.io/cri-api v0.29.2

replace k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.0.0-20190805142416-fd821fbbb94e

Expand Down
Loading