mirror of
https://github.com/containers/podman.git
synced 2025-05-22 09:36:57 +08:00

* Added support for system service * Enabled linting on the varlinkapi source, needed to support V2 service command * Added support for PODMAN_SOCKET Skip linting deprecated code Rather than introduce bugs by correcting deprecated code, linting the code is being skipped. Code that is being ported into V2 is being checked. Signed-off-by: Jhon Honce <jhonce@redhat.com>
32 lines
731 B
Go
32 lines
731 B
Go
// +build varlink
|
|
|
|
package varlinkapi
|
|
|
|
import (
|
|
"encoding/json"
|
|
|
|
"github.com/containers/libpod/cmd/podman/shared"
|
|
iopodman "github.com/containers/libpod/pkg/varlink"
|
|
)
|
|
|
|
// GenerateKube ...
|
|
func (i *VarlinkAPI) GenerateKube(call iopodman.VarlinkCall, name string, service bool) error {
|
|
pod, serv, err := shared.GenerateKube(name, service, i.Runtime)
|
|
if err != nil {
|
|
return call.ReplyErrorOccurred(err.Error())
|
|
}
|
|
podB, err := json.Marshal(pod)
|
|
if err != nil {
|
|
return call.ReplyErrorOccurred(err.Error())
|
|
}
|
|
servB, err := json.Marshal(serv)
|
|
if err != nil {
|
|
return call.ReplyErrorOccurred(err.Error())
|
|
}
|
|
|
|
return call.ReplyGenerateKube(iopodman.KubePodService{
|
|
Pod: string(podB),
|
|
Service: string(servB),
|
|
})
|
|
}
|