Documentation ¶
Index ¶
- func ParseAuth(auth *runtime.AuthConfig, host string) (string, string, error)
- type CRIImageService
- func (c *CRIImageService) CheckImages(ctx context.Context) error
- func (c *CRIImageService) GRPCService() runtime.ImageServiceServer
- func (c *CRIImageService) GetImage(id string) (imagestore.Image, error)
- func (c *CRIImageService) GetSnapshot(key, snapshotter string) (snapshotstore.Snapshot, error)
- func (c *CRIImageService) ImageFSPaths() map[string]string
- func (c *CRIImageService) ImageFsInfo(ctx context.Context, r *runtime.ImageFsInfoRequest) (*runtime.ImageFsInfoResponse, error)
- func (c *CRIImageService) ImageStatus(ctx context.Context, r *runtime.ImageStatusRequest) (*runtime.ImageStatusResponse, error)
- func (c *CRIImageService) LocalResolve(refOrID string) (imagestore.Image, error)
- func (c *CRIImageService) PinnedImage(name string) string
- func (c *CRIImageService) PullImage(ctx context.Context, name string, ...) (_ string, err error)
- func (c *CRIImageService) RemoveImage(ctx context.Context, imageSpec *runtime.ImageSpec) error
- func (c *CRIImageService) RuntimeSnapshotter(ctx context.Context, ociRuntime criconfig.Runtime) string
- func (c *CRIImageService) UpdateImage(ctx context.Context, r string) error
- type CRIImageServiceOptions
- type GRPCCRIImageService
- func (c *GRPCCRIImageService) ListImages(ctx context.Context, r *runtime.ListImagesRequest) (*runtime.ListImagesResponse, error)
- func (c *GRPCCRIImageService) PullImage(ctx context.Context, r *runtime.PullImageRequest) (_ *runtime.PullImageResponse, err error)
- func (c *GRPCCRIImageService) RemoveImage(ctx context.Context, r *runtime.RemoveImageRequest) (*runtime.RemoveImageResponse, error)
- type ImagePlatform
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CRIImageService ¶
type CRIImageService struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(config criconfig.ImageConfig, options *CRIImageServiceOptions) (*CRIImageService, error)
NewService creates a new CRI Image Service
TODO:
- Generalize the image service and merge with a single higher level image service
- Update the options to remove client and imageFSPath - Platform configuration with Array/Map of snapshotter names + filesystem ID + platform matcher + runtime to snapshotter - Transfer service implementation - Image Service (from metadata) - Content store (from metadata)
- Separate image cache and snapshot cache to first class plugins, make the snapshot cache much more efficient and intelligent
func (*CRIImageService) CheckImages ¶
func (c *CRIImageService) CheckImages(ctx context.Context) error
LoadImages checks all existing images to ensure they are ready to be used for CRI. It may try to recover images which are not ready but will only log errors, not return any.
func (*CRIImageService) GRPCService ¶
func (c *CRIImageService) GRPCService() runtime.ImageServiceServer
GRPCService returns a new CRI Image Service grpc server.
func (*CRIImageService) GetImage ¶
func (c *CRIImageService) GetImage(id string) (imagestore.Image, error)
GetImage gets image metadata by image id.
func (*CRIImageService) GetSnapshot ¶
func (c *CRIImageService) GetSnapshot(key, snapshotter string) (snapshotstore.Snapshot, error)
GetSnapshot returns the snapshot with specified key.
func (*CRIImageService) ImageFSPaths ¶
func (c *CRIImageService) ImageFSPaths() map[string]string
func (*CRIImageService) ImageFsInfo ¶
func (c *CRIImageService) ImageFsInfo(ctx context.Context, r *runtime.ImageFsInfoRequest) (*runtime.ImageFsInfoResponse, error)
ImageFsInfo returns information of the filesystem that is used to store images. TODO(windows): Usage for windows is always 0 right now. Support this for windows. TODO(random-liu): Handle storage consumed by content store
func (*CRIImageService) ImageStatus ¶
func (c *CRIImageService) ImageStatus(ctx context.Context, r *runtime.ImageStatusRequest) (*runtime.ImageStatusResponse, error)
ImageStatus returns the status of the image, returns nil if the image isn't present. TODO(random-liu): We should change CRI to distinguish image id and image spec. (See kubernetes/kubernetes#46255)
func (*CRIImageService) LocalResolve ¶
func (c *CRIImageService) LocalResolve(refOrID string) (imagestore.Image, error)
LocalResolve resolves image reference locally and returns corresponding image metadata. It returns errdefs.ErrNotFound if the reference doesn't exist.
func (*CRIImageService) PinnedImage ¶
func (c *CRIImageService) PinnedImage(name string) string
PinnedImage is used to lookup a pinned image by name. Most often used to get the "sandbox" image.
func (*CRIImageService) RemoveImage ¶
func (*CRIImageService) RuntimeSnapshotter ¶
func (c *CRIImageService) RuntimeSnapshotter(ctx context.Context, ociRuntime criconfig.Runtime) string
RuntimeSnapshotter overrides the default snapshotter if Snapshotter is set for this runtime. See https://github.com/containerd/containerd/issues/6657 TODO: Pass in name and get back runtime platform
func (*CRIImageService) UpdateImage ¶
func (c *CRIImageService) UpdateImage(ctx context.Context, r string) error
updateImage updates image store to reflect the newest state of an image reference in containerd. If the reference is not managed by the cri plugin, the function also generates necessary metadata for the image and make it managed.
type CRIImageServiceOptions ¶
type GRPCCRIImageService ¶
type GRPCCRIImageService struct {
*CRIImageService
}
func (*GRPCCRIImageService) ListImages ¶
func (c *GRPCCRIImageService) ListImages(ctx context.Context, r *runtime.ListImagesRequest) (*runtime.ListImagesResponse, error)
ListImages lists existing images. TODO(random-liu): Add image list filters after CRI defines this more clear, and kubelet actually needs it.
func (*GRPCCRIImageService) PullImage ¶
func (c *GRPCCRIImageService) PullImage(ctx context.Context, r *runtime.PullImageRequest) (_ *runtime.PullImageResponse, err error)
PullImage pulls an image with authentication config.
func (*GRPCCRIImageService) RemoveImage ¶
func (c *GRPCCRIImageService) RemoveImage(ctx context.Context, r *runtime.RemoveImageRequest) (*runtime.RemoveImageResponse, error)
RemoveImage removes the image. TODO(random-liu): Update CRI to pass image reference instead of ImageSpec. (See kubernetes/kubernetes#46255) TODO(random-liu): We should change CRI to distinguish image id and image spec. Remove the whole image no matter the it's image id or reference. This is the semantic defined in CRI now.