Merge pull request #2656 from Random-Liu/update-cri-release-1.2
Update cri to 9f39e32895
.
This commit is contained in:
commit
ef39bba476
29
vendor.conf
29
vendor.conf
@ -43,8 +43,8 @@ github.com/google/go-cmp v0.1.0
|
|||||||
go.etcd.io/bbolt v1.3.1-etcd.8
|
go.etcd.io/bbolt v1.3.1-etcd.8
|
||||||
|
|
||||||
# cri dependencies
|
# cri dependencies
|
||||||
github.com/containerd/cri v1.11.1
|
github.com/containerd/cri 9f39e3289533fc228c5e5fcac0a6dbdd60c6047b # release/1.2 branch
|
||||||
github.com/containerd/go-cni 5882530828ecf62032409b298a3e8b19e08b6534
|
github.com/containerd/go-cni 6d7b509a054a3cb1c35ed1865d4fde2f0cb547cd
|
||||||
github.com/blang/semver v3.1.0
|
github.com/blang/semver v3.1.0
|
||||||
github.com/containernetworking/cni v0.6.0
|
github.com/containernetworking/cni v0.6.0
|
||||||
github.com/containernetworking/plugins v0.7.0
|
github.com/containernetworking/plugins v0.7.0
|
||||||
@ -52,32 +52,33 @@ github.com/davecgh/go-spew v1.1.0
|
|||||||
github.com/docker/distribution b38e5838b7b2f2ad48e06ec4b500011976080621
|
github.com/docker/distribution b38e5838b7b2f2ad48e06ec4b500011976080621
|
||||||
github.com/docker/docker 86f080cff0914e9694068ed78d503701667c4c00
|
github.com/docker/docker 86f080cff0914e9694068ed78d503701667c4c00
|
||||||
github.com/docker/spdystream 449fdfce4d962303d702fec724ef0ad181c92528
|
github.com/docker/spdystream 449fdfce4d962303d702fec724ef0ad181c92528
|
||||||
github.com/emicklei/go-restful ff4f55a206334ef123e4f79bbf348980da81ca46
|
github.com/emicklei/go-restful v2.2.1
|
||||||
github.com/ghodss/yaml 73d445a93680fa1a78ae23a5839bad48f32ba1ee
|
github.com/ghodss/yaml v1.0.0
|
||||||
github.com/golang/glog 44145f04b68cf362d9c4df2182967c2275eaefed
|
github.com/golang/glog 44145f04b68cf362d9c4df2182967c2275eaefed
|
||||||
github.com/google/gofuzz 44d81051d367757e1c7c6a5a86423ece9afcf63c
|
github.com/google/gofuzz 44d81051d367757e1c7c6a5a86423ece9afcf63c
|
||||||
github.com/hashicorp/errwrap 7554cd9344cec97297fa6649b055a8c98c2a1e55
|
github.com/hashicorp/errwrap 7554cd9344cec97297fa6649b055a8c98c2a1e55
|
||||||
github.com/hashicorp/go-multierror ed905158d87462226a13fe39ddf685ea65f1c11f
|
github.com/hashicorp/go-multierror ed905158d87462226a13fe39ddf685ea65f1c11f
|
||||||
github.com/json-iterator/go f2b4162afba35581b6d4a50d3b8f34e33c144682
|
github.com/json-iterator/go 1.1.5
|
||||||
github.com/modern-go/reflect2 05fbef0ca5da472bbf96c9322b84a53edc03c9fd
|
github.com/modern-go/reflect2 1.0.1
|
||||||
github.com/modern-go/concurrent 1.0.3
|
github.com/modern-go/concurrent 1.0.3
|
||||||
github.com/opencontainers/runtime-tools v0.6.0
|
github.com/opencontainers/runtime-tools v0.6.0
|
||||||
github.com/opencontainers/selinux 4a2974bf1ee960774ffd517717f1f45325af0206
|
github.com/opencontainers/selinux b6fa367ed7f534f9ba25391cc2d467085dbb445a
|
||||||
github.com/seccomp/libseccomp-golang 32f571b70023028bd57d9288c20efbcb237f3ce0
|
github.com/seccomp/libseccomp-golang 32f571b70023028bd57d9288c20efbcb237f3ce0
|
||||||
github.com/tchap/go-patricia 5ad6cdb7538b0097d5598c7e57f0a24072adf7dc
|
github.com/tchap/go-patricia v2.2.6
|
||||||
github.com/xeipuuv/gojsonpointer 4e3ac2762d5f479393488629ee9370b50873b3a6
|
github.com/xeipuuv/gojsonpointer 4e3ac2762d5f479393488629ee9370b50873b3a6
|
||||||
github.com/xeipuuv/gojsonreference bd5ef7bd5415a7ac448318e64f11a24cd21e594b
|
github.com/xeipuuv/gojsonreference bd5ef7bd5415a7ac448318e64f11a24cd21e594b
|
||||||
github.com/xeipuuv/gojsonschema 1d523034197ff1f222f6429836dd36a2457a1874
|
github.com/xeipuuv/gojsonschema 1d523034197ff1f222f6429836dd36a2457a1874
|
||||||
golang.org/x/crypto 49796115aa4b964c318aad4f3084fdb41e9aa067
|
golang.org/x/crypto 49796115aa4b964c318aad4f3084fdb41e9aa067
|
||||||
|
golang.org/x/oauth2 a6bd8cefa1811bd24b86f8902872e4e8225f74c4
|
||||||
golang.org/x/time f51c12702a4d776e4c1fa9b0fabab841babae631
|
golang.org/x/time f51c12702a4d776e4c1fa9b0fabab841babae631
|
||||||
gopkg.in/inf.v0 3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4
|
gopkg.in/inf.v0 3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4
|
||||||
gopkg.in/yaml.v2 v2.2.1
|
gopkg.in/yaml.v2 v2.2.1
|
||||||
k8s.io/api 9e5ffd1f1320950b238cfce291b926411f0af722
|
k8s.io/api 012f271b5d41baad56190c5f1ae19bff16df0fd8
|
||||||
k8s.io/apimachinery ed135c5b96450fd24e5e981c708114fbbd950697
|
k8s.io/apimachinery 6429050ef506887d121f3e7306e894f8900d8a63
|
||||||
k8s.io/apiserver a90e3a95c2e91b944bfca8225c4e0d12e42a9eb5
|
k8s.io/apiserver e9312c15296b6c2c923ebd5031ff5d1d5fd022d7
|
||||||
k8s.io/client-go 03bfb9bdcfe5482795b999f39ca3ed9ad42ce5bb
|
k8s.io/client-go 37c3c02ec96533daec0dbda1f39a6b1d68505c79
|
||||||
k8s.io/kubernetes v1.11.0
|
k8s.io/kubernetes v1.12.0-beta.1
|
||||||
k8s.io/utils 733eca437aa39379e4bcc25e726439dfca40fcff
|
k8s.io/utils 982821ea41da7e7c15f3d3738921eb2e7e241ccd
|
||||||
|
|
||||||
# zfs dependencies
|
# zfs dependencies
|
||||||
github.com/containerd/zfs 9a0b8b8b5982014b729cd34eb7cd7a11062aa6ec
|
github.com/containerd/zfs 9a0b8b8b5982014b729cd34eb7cd7a11062aa6ec
|
||||||
|
2
vendor/github.com/containerd/cri/README.md
generated
vendored
2
vendor/github.com/containerd/cri/README.md
generated
vendored
@ -101,7 +101,7 @@ make BUILD_TAGS='seccomp apparmor'
|
|||||||
| selinux | selinux process and mount labeling | <none> |
|
| selinux | selinux process and mount labeling | <none> |
|
||||||
| apparmor | apparmor profile support | <none> |
|
| apparmor | apparmor profile support | <none> |
|
||||||
### Validate Your `cri` Setup
|
### Validate Your `cri` Setup
|
||||||
A Kubernetes incubator project called [cri-tools](https://github.com/kubernetes-incubator/cri-tools)
|
A Kubernetes incubator project called [cri-tools](https://github.com/kubernetes-sigs/cri-tools)
|
||||||
includes programs for exercising CRI implementations such as the `cri` plugin.
|
includes programs for exercising CRI implementations such as the `cri` plugin.
|
||||||
More importantly, cri-tools includes the program `critest` which is used for running
|
More importantly, cri-tools includes the program `critest` which is used for running
|
||||||
[CRI Validation Testing](https://github.com/kubernetes/community/blob/master/contributors/devel/cri-validation.md).
|
[CRI Validation Testing](https://github.com/kubernetes/community/blob/master/contributors/devel/cri-validation.md).
|
||||||
|
16
vendor/github.com/containerd/cri/cri.go
generated
vendored
16
vendor/github.com/containerd/cri/cri.go
generated
vendored
@ -71,6 +71,10 @@ func initCRIService(ic *plugin.InitContext) (interface{}, error) {
|
|||||||
}
|
}
|
||||||
log.G(ctx).Infof("Start cri plugin with config %+v", c)
|
log.G(ctx).Infof("Start cri plugin with config %+v", c)
|
||||||
|
|
||||||
|
if err := validateConfig(&c); err != nil {
|
||||||
|
return nil, errors.Wrap(err, "invalid config")
|
||||||
|
}
|
||||||
|
|
||||||
if err := setGLogLevel(); err != nil {
|
if err := setGLogLevel(); err != nil {
|
||||||
return nil, errors.Wrap(err, "failed to set glog level")
|
return nil, errors.Wrap(err, "failed to set glog level")
|
||||||
}
|
}
|
||||||
@ -104,6 +108,18 @@ func initCRIService(ic *plugin.InitContext) (interface{}, error) {
|
|||||||
return s, nil
|
return s, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// validateConfig validates the given configuration.
|
||||||
|
func validateConfig(c *criconfig.Config) error {
|
||||||
|
// It is an error to provide both an UntrustedWorkloadRuntime & define an 'untrusted' runtime.
|
||||||
|
if _, ok := c.ContainerdConfig.Runtimes[criconfig.RuntimeUntrusted]; ok {
|
||||||
|
if c.ContainerdConfig.UntrustedWorkloadRuntime.Type != "" {
|
||||||
|
return errors.New("conflicting definitions: configuration includes untrusted_workload_runtime and runtimes['untrusted']")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// getServicesOpts get service options from plugin context.
|
// getServicesOpts get service options from plugin context.
|
||||||
func getServicesOpts(ic *plugin.InitContext) ([]containerd.ServicesOpt, error) {
|
func getServicesOpts(ic *plugin.InitContext) ([]containerd.ServicesOpt, error) {
|
||||||
plugins, err := ic.GetByType(plugin.ServicePlugin)
|
plugins, err := ic.GetByType(plugin.ServicePlugin)
|
||||||
|
37
vendor/github.com/containerd/cri/pkg/config/config.go
generated
vendored
37
vendor/github.com/containerd/cri/pkg/config/config.go
generated
vendored
@ -33,10 +33,18 @@ type Runtime struct {
|
|||||||
type ContainerdConfig struct {
|
type ContainerdConfig struct {
|
||||||
// Snapshotter is the snapshotter used by containerd.
|
// Snapshotter is the snapshotter used by containerd.
|
||||||
Snapshotter string `toml:"snapshotter" json:"snapshotter"`
|
Snapshotter string `toml:"snapshotter" json:"snapshotter"`
|
||||||
// DefaultRuntime is the runtime to use in containerd.
|
// DefaultRuntime is the default runtime to use in containerd.
|
||||||
|
// This runtime is used when no runtime handler (or the empty string) is provided.
|
||||||
DefaultRuntime Runtime `toml:"default_runtime" json:"defaultRuntime"`
|
DefaultRuntime Runtime `toml:"default_runtime" json:"defaultRuntime"`
|
||||||
// UntrustedWorkloadRuntime is a runtime to run untrusted workloads on it.
|
// UntrustedWorkloadRuntime is a runtime to run untrusted workloads on it.
|
||||||
|
// DEPRECATED: use Runtimes instead. If provided, this runtime is mapped to the runtime handler
|
||||||
|
// named 'untrusted'. It is a configuration error to provide both the (now deprecated)
|
||||||
|
// UntrustedWorkloadRuntime and a handler in the Runtimes handler map (below) for 'untrusted'
|
||||||
|
// workloads at the same time. Please provide one or the other.
|
||||||
UntrustedWorkloadRuntime Runtime `toml:"untrusted_workload_runtime" json:"untrustedWorkloadRuntime"`
|
UntrustedWorkloadRuntime Runtime `toml:"untrusted_workload_runtime" json:"untrustedWorkloadRuntime"`
|
||||||
|
// Runtimes is a map from CRI RuntimeHandler strings, which specify types of runtime
|
||||||
|
// configurations, to the matching configurations.
|
||||||
|
Runtimes map[string]Runtime `toml:"runtimes" json:"runtimes"`
|
||||||
// NoPivot disables pivot-root (linux only), required when running a container in a RamDisk with runc
|
// NoPivot disables pivot-root (linux only), required when running a container in a RamDisk with runc
|
||||||
NoPivot bool `toml:"no_pivot" json:"noPivot"`
|
NoPivot bool `toml:"no_pivot" json:"noPivot"`
|
||||||
}
|
}
|
||||||
@ -114,12 +122,22 @@ type PluginConfig struct {
|
|||||||
SystemdCgroup bool `toml:"systemd_cgroup" json:"systemdCgroup"`
|
SystemdCgroup bool `toml:"systemd_cgroup" json:"systemdCgroup"`
|
||||||
// EnableTLSStreaming indicates to enable the TLS streaming support.
|
// EnableTLSStreaming indicates to enable the TLS streaming support.
|
||||||
EnableTLSStreaming bool `toml:"enable_tls_streaming" json:"enableTLSStreaming"`
|
EnableTLSStreaming bool `toml:"enable_tls_streaming" json:"enableTLSStreaming"`
|
||||||
|
// X509KeyPairStreaming is a x509 key pair used for TLS streaming
|
||||||
|
X509KeyPairStreaming `toml:"x509_key_pair_streaming" json:"x509KeyPairStreaming"`
|
||||||
// MaxContainerLogLineSize is the maximum log line size in bytes for a container.
|
// MaxContainerLogLineSize is the maximum log line size in bytes for a container.
|
||||||
// Log line longer than the limit will be split into multiple lines. Non-positive
|
// Log line longer than the limit will be split into multiple lines. Non-positive
|
||||||
// value means no limit.
|
// value means no limit.
|
||||||
MaxContainerLogLineSize int `toml:"max_container_log_line_size" json:"maxContainerLogSize"`
|
MaxContainerLogLineSize int `toml:"max_container_log_line_size" json:"maxContainerLogSize"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// X509KeyPairStreaming contains the x509 configuration for streaming
|
||||||
|
type X509KeyPairStreaming struct {
|
||||||
|
// TLSCertFile is the path to a certificate file
|
||||||
|
TLSCertFile string `toml:"tls_cert_file" json:"tlsCertFile"`
|
||||||
|
// TLSKeyFile is the path to a private key file
|
||||||
|
TLSKeyFile string `toml:"tls_key_file" json:"tlsKeyFile"`
|
||||||
|
}
|
||||||
|
|
||||||
// Config contains all configurations for cri server.
|
// Config contains all configurations for cri server.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
// PluginConfig is the config for CRI plugin.
|
// PluginConfig is the config for CRI plugin.
|
||||||
@ -152,10 +170,14 @@ func DefaultConfig() PluginConfig {
|
|||||||
},
|
},
|
||||||
NoPivot: false,
|
NoPivot: false,
|
||||||
},
|
},
|
||||||
StreamServerAddress: "127.0.0.1",
|
StreamServerAddress: "127.0.0.1",
|
||||||
StreamServerPort: "0",
|
StreamServerPort: "0",
|
||||||
EnableSelinux: false,
|
EnableSelinux: false,
|
||||||
EnableTLSStreaming: false,
|
EnableTLSStreaming: false,
|
||||||
|
X509KeyPairStreaming: X509KeyPairStreaming{
|
||||||
|
TLSKeyFile: "",
|
||||||
|
TLSCertFile: "",
|
||||||
|
},
|
||||||
SandboxImage: "k8s.gcr.io/pause:3.1",
|
SandboxImage: "k8s.gcr.io/pause:3.1",
|
||||||
StatsCollectPeriod: 10,
|
StatsCollectPeriod: 10,
|
||||||
SystemdCgroup: false,
|
SystemdCgroup: false,
|
||||||
@ -169,3 +191,8 @@ func DefaultConfig() PluginConfig {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
// RuntimeUntrusted is the implicit runtime defined for ContainerdConfig.UntrustedWorkloadRuntime
|
||||||
|
RuntimeUntrusted = "untrusted"
|
||||||
|
)
|
||||||
|
28
vendor/github.com/containerd/cri/pkg/containerd/importer/importer.go
generated
vendored
28
vendor/github.com/containerd/cri/pkg/containerd/importer/importer.go
generated
vendored
@ -87,13 +87,33 @@ type imageConfig struct {
|
|||||||
img ocispec.Image
|
img ocispec.Image
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type importConfig struct {
|
||||||
|
unpack bool
|
||||||
|
snapshotter string
|
||||||
|
}
|
||||||
|
|
||||||
|
// ImportOption configures import behavior.
|
||||||
|
type ImportOption func(*importConfig)
|
||||||
|
|
||||||
|
// WithUnpack is used to unpack image after import.
|
||||||
|
func WithUnpack(snapshotter string) ImportOption {
|
||||||
|
return func(c *importConfig) {
|
||||||
|
c.unpack = true
|
||||||
|
c.snapshotter = snapshotter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Import implements Docker Image Spec v1.1.
|
// Import implements Docker Image Spec v1.1.
|
||||||
// An image MUST have `manifest.json`.
|
// An image MUST have `manifest.json`.
|
||||||
// `repositories` file in Docker Image Spec v1.0 is not supported (yet).
|
// `repositories` file in Docker Image Spec v1.0 is not supported (yet).
|
||||||
// Also, the current implementation assumes the implicit file name convention,
|
// Also, the current implementation assumes the implicit file name convention,
|
||||||
// which is not explicitly documented in the spec. (e.g. foobar/layer.tar)
|
// which is not explicitly documented in the spec. (e.g. foobar/layer.tar)
|
||||||
// It returns a group of image references successfully loaded.
|
// It returns a group of image references successfully loaded.
|
||||||
func Import(ctx context.Context, client *containerd.Client, reader io.Reader) (_ []string, retErr error) {
|
func Import(ctx context.Context, client *containerd.Client, reader io.Reader, opts ...ImportOption) (_ []string, retErr error) {
|
||||||
|
c := &importConfig{}
|
||||||
|
for _, o := range opts {
|
||||||
|
o(c)
|
||||||
|
}
|
||||||
ctx, done, err := client.WithLease(ctx)
|
ctx, done, err := client.WithLease(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -209,6 +229,12 @@ func Import(ctx context.Context, client *containerd.Client, reader io.Reader) (_
|
|||||||
Name: ref,
|
Name: ref,
|
||||||
Target: *desc,
|
Target: *desc,
|
||||||
}
|
}
|
||||||
|
if c.unpack {
|
||||||
|
img := containerd.NewImage(client, imgrec)
|
||||||
|
if err := img.Unpack(ctx, c.snapshotter); err != nil {
|
||||||
|
return refs, errors.Wrapf(err, "unpack image %q", ref)
|
||||||
|
}
|
||||||
|
}
|
||||||
if _, err := is.Create(ctx, imgrec); err != nil {
|
if _, err := is.Create(ctx, imgrec); err != nil {
|
||||||
if !errdefs.IsAlreadyExists(err) {
|
if !errdefs.IsAlreadyExists(err) {
|
||||||
return refs, errors.Wrapf(err, "create image ref %+v", imgrec)
|
return refs, errors.Wrapf(err, "create image ref %+v", imgrec)
|
||||||
|
51
vendor/github.com/containerd/cri/pkg/containerd/opts/spec.go
generated
vendored
Normal file
51
vendor/github.com/containerd/cri/pkg/containerd/opts/spec.go
generated
vendored
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2018 The containerd 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package opts
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"github.com/containerd/containerd/containers"
|
||||||
|
"github.com/containerd/containerd/oci"
|
||||||
|
runtimespec "github.com/opencontainers/runtime-spec/specs-go"
|
||||||
|
)
|
||||||
|
|
||||||
|
// WithAdditionalGIDs adds any additional groups listed for a particular user in the
|
||||||
|
// /etc/groups file of the image's root filesystem to the OCI spec's additionalGids array.
|
||||||
|
func WithAdditionalGIDs(userstr string) oci.SpecOpts {
|
||||||
|
return func(ctx context.Context, client oci.Client, c *containers.Container, s *runtimespec.Spec) (err error) {
|
||||||
|
gids := s.Process.User.AdditionalGids
|
||||||
|
if err := oci.WithAdditionalGIDs(userstr)(ctx, client, c, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
// Merge existing gids and new gids.
|
||||||
|
s.Process.User.AdditionalGids = mergeGids(s.Process.User.AdditionalGids, gids)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func mergeGids(gids1, gids2 []uint32) []uint32 {
|
||||||
|
for _, gid1 := range gids1 {
|
||||||
|
for i, gid2 := range gids2 {
|
||||||
|
if gid1 == gid2 {
|
||||||
|
gids2 = append(gids2[:i], gids2[i+1:]...)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return append(gids1, gids2...)
|
||||||
|
}
|
6
vendor/github.com/containerd/cri/pkg/os/os.go
generated
vendored
6
vendor/github.com/containerd/cri/pkg/os/os.go
generated
vendored
@ -43,6 +43,7 @@ type OS interface {
|
|||||||
Mount(source string, target string, fstype string, flags uintptr, data string) error
|
Mount(source string, target string, fstype string, flags uintptr, data string) error
|
||||||
Unmount(target string) error
|
Unmount(target string) error
|
||||||
LookupMount(path string) (mount.Info, error)
|
LookupMount(path string) (mount.Info, error)
|
||||||
|
Hostname() (string, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// RealOS is used to dispatch the real system level operations.
|
// RealOS is used to dispatch the real system level operations.
|
||||||
@ -134,3 +135,8 @@ func Unmount(target string) error {
|
|||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hostname will call os.Hostname to get the hostname of the host.
|
||||||
|
func (RealOS) Hostname() (string, error) {
|
||||||
|
return os.Hostname()
|
||||||
|
}
|
||||||
|
104
vendor/github.com/containerd/cri/pkg/server/container_create.go
generated
vendored
104
vendor/github.com/containerd/cri/pkg/server/container_create.go
generated
vendored
@ -19,6 +19,7 @@ package server
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@ -114,13 +115,9 @@ func (c *criService) CreateContainer(ctx context.Context, r *runtime.CreateConta
|
|||||||
|
|
||||||
// Prepare container image snapshot. For container, the image should have
|
// Prepare container image snapshot. For container, the image should have
|
||||||
// been pulled before creating the container, so do not ensure the image.
|
// been pulled before creating the container, so do not ensure the image.
|
||||||
imageRef := config.GetImage().GetImage()
|
image, err := c.localResolve(config.GetImage().GetImage())
|
||||||
image, err := c.localResolve(ctx, imageRef)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrapf(err, "failed to resolve image %q", imageRef)
|
return nil, errors.Wrapf(err, "failed to resolve image %q", config.GetImage().GetImage())
|
||||||
}
|
|
||||||
if image == nil {
|
|
||||||
return nil, errors.Errorf("image %q not found", imageRef)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run container using the same runtime with sandbox.
|
// Run container using the same runtime with sandbox.
|
||||||
@ -232,6 +229,15 @@ func (c *criService) CreateContainer(ctx context.Context, r *runtime.CreateConta
|
|||||||
specOpts = append(specOpts, oci.WithUser(userstr))
|
specOpts = append(specOpts, oci.WithUser(userstr))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if securityContext.GetRunAsUsername() != "" {
|
||||||
|
userstr = securityContext.GetRunAsUsername()
|
||||||
|
} else {
|
||||||
|
// Even if RunAsUser is not set, we still call `GetValue` to get uid 0.
|
||||||
|
// Because it is still useful to get additional gids for uid 0.
|
||||||
|
userstr = strconv.FormatInt(securityContext.GetRunAsUser().GetValue(), 10)
|
||||||
|
}
|
||||||
|
specOpts = append(specOpts, customopts.WithAdditionalGIDs(userstr))
|
||||||
|
|
||||||
apparmorSpecOpts, err := generateApparmorSpecOpts(
|
apparmorSpecOpts, err := generateApparmorSpecOpts(
|
||||||
securityContext.GetApparmorProfile(),
|
securityContext.GetApparmorProfile(),
|
||||||
securityContext.GetPrivileged(),
|
securityContext.GetPrivileged(),
|
||||||
@ -333,6 +339,17 @@ func (c *criService) generateContainerSpec(id string, sandboxID string, sandboxP
|
|||||||
g.AddProcessEnv("TERM", "xterm")
|
g.AddProcessEnv("TERM", "xterm")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add HOSTNAME env.
|
||||||
|
hostname := sandboxConfig.GetHostname()
|
||||||
|
if sandboxConfig.GetLinux().GetSecurityContext().GetNamespaceOptions().GetNetwork() == runtime.NamespaceMode_NODE &&
|
||||||
|
hostname == "" {
|
||||||
|
hostname, err = c.os.Hostname()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
g.AddProcessEnv(hostnameEnv, hostname)
|
||||||
|
|
||||||
// Apply envs from image config first, so that envs from container config
|
// Apply envs from image config first, so that envs from container config
|
||||||
// can override them.
|
// can override them.
|
||||||
if err := addImageEnvs(&g, imageConfig.Env); err != nil {
|
if err := addImageEnvs(&g, imageConfig.Env); err != nil {
|
||||||
@ -349,12 +366,30 @@ func (c *criService) generateContainerSpec(id string, sandboxID string, sandboxP
|
|||||||
return nil, errors.Wrapf(err, "failed to init selinux options %+v", securityContext.GetSelinuxOptions())
|
return nil, errors.Wrapf(err, "failed to init selinux options %+v", securityContext.GetSelinuxOptions())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add extra mounts first so that CRI specified mounts can override.
|
// Merge extra mounts and CRI mounts.
|
||||||
mounts := append(extraMounts, config.GetMounts()...)
|
mounts := mergeMounts(config.GetMounts(), extraMounts)
|
||||||
if err := c.addOCIBindMounts(&g, mounts, mountLabel); err != nil {
|
if err := c.addOCIBindMounts(&g, mounts, mountLabel); err != nil {
|
||||||
return nil, errors.Wrapf(err, "failed to set OCI bind mounts %+v", mounts)
|
return nil, errors.Wrapf(err, "failed to set OCI bind mounts %+v", mounts)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Apply masked paths if specified.
|
||||||
|
// When `MaskedPaths` is not specified, keep runtime default for backward compatibility;
|
||||||
|
// When `MaskedPaths` is specified, but length is zero, clear masked path list.
|
||||||
|
if securityContext.GetMaskedPaths() != nil {
|
||||||
|
g.Config.Linux.MaskedPaths = nil
|
||||||
|
for _, path := range securityContext.GetMaskedPaths() {
|
||||||
|
g.AddLinuxMaskedPaths(path)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Apply readonly paths if specified.
|
||||||
|
if securityContext.GetReadonlyPaths() != nil {
|
||||||
|
g.Config.Linux.ReadonlyPaths = nil
|
||||||
|
for _, path := range securityContext.GetReadonlyPaths() {
|
||||||
|
g.AddLinuxReadonlyPaths(path)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if securityContext.GetPrivileged() {
|
if securityContext.GetPrivileged() {
|
||||||
if !sandboxConfig.GetLinux().GetSecurityContext().GetPrivileged() {
|
if !sandboxConfig.GetLinux().GetSecurityContext().GetPrivileged() {
|
||||||
return nil, errors.New("no privileged container allowed in sandbox")
|
return nil, errors.New("no privileged container allowed in sandbox")
|
||||||
@ -596,6 +631,10 @@ func setOCIDevicesPrivileged(g *generate.Generator) error {
|
|||||||
|
|
||||||
// addOCIBindMounts adds bind mounts.
|
// addOCIBindMounts adds bind mounts.
|
||||||
func (c *criService) addOCIBindMounts(g *generate.Generator, mounts []*runtime.Mount, mountLabel string) error {
|
func (c *criService) addOCIBindMounts(g *generate.Generator, mounts []*runtime.Mount, mountLabel string) error {
|
||||||
|
// Sort mounts in number of parts. This ensures that high level mounts don't
|
||||||
|
// shadow other mounts.
|
||||||
|
sort.Sort(orderedMounts(mounts))
|
||||||
|
|
||||||
// Mount cgroup into the container as readonly, which inherits docker's behavior.
|
// Mount cgroup into the container as readonly, which inherits docker's behavior.
|
||||||
g.AddMount(runtimespec.Mount{
|
g.AddMount(runtimespec.Mount{
|
||||||
Source: "cgroup",
|
Source: "cgroup",
|
||||||
@ -603,6 +642,29 @@ func (c *criService) addOCIBindMounts(g *generate.Generator, mounts []*runtime.M
|
|||||||
Type: "cgroup",
|
Type: "cgroup",
|
||||||
Options: []string{"nosuid", "noexec", "nodev", "relatime", "ro"},
|
Options: []string{"nosuid", "noexec", "nodev", "relatime", "ro"},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Copy all mounts from default mounts, except for
|
||||||
|
// - mounts overriden by supplied mount;
|
||||||
|
// - all mounts under /dev if a supplied /dev is present.
|
||||||
|
mountSet := make(map[string]struct{})
|
||||||
|
for _, m := range mounts {
|
||||||
|
mountSet[filepath.Clean(m.ContainerPath)] = struct{}{}
|
||||||
|
}
|
||||||
|
defaultMounts := g.Mounts()
|
||||||
|
g.ClearMounts()
|
||||||
|
for _, m := range defaultMounts {
|
||||||
|
dst := filepath.Clean(m.Destination)
|
||||||
|
if _, ok := mountSet[dst]; ok {
|
||||||
|
// filter out mount overridden by a supplied mount
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if _, mountDev := mountSet["/dev"]; mountDev && strings.HasPrefix(dst, "/dev/") {
|
||||||
|
// filter out everything under /dev if /dev is a supplied mount
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
g.AddMount(m)
|
||||||
|
}
|
||||||
|
|
||||||
for _, mount := range mounts {
|
for _, mount := range mounts {
|
||||||
dst := mount.GetContainerPath()
|
dst := mount.GetContainerPath()
|
||||||
src := mount.GetHostPath()
|
src := mount.GetHostPath()
|
||||||
@ -821,10 +883,6 @@ func defaultRuntimeSpec(id string) (*runtimespec.Spec, error) {
|
|||||||
if mount.Destination == "/run" {
|
if mount.Destination == "/run" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// CRI plugin handles `/dev/shm` itself.
|
|
||||||
if mount.Destination == "/dev/shm" {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
mounts = append(mounts, mount)
|
mounts = append(mounts, mount)
|
||||||
}
|
}
|
||||||
spec.Mounts = mounts
|
spec.Mounts = mounts
|
||||||
@ -968,3 +1026,25 @@ func generateUserString(username string, uid, gid *runtime.Int64Value) (string,
|
|||||||
}
|
}
|
||||||
return userstr, nil
|
return userstr, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// mergeMounts merge CRI mounts with extra mounts. If a mount destination
|
||||||
|
// is mounted by both a CRI mount and an extra mount, the CRI mount will
|
||||||
|
// be kept.
|
||||||
|
func mergeMounts(criMounts, extraMounts []*runtime.Mount) []*runtime.Mount {
|
||||||
|
var mounts []*runtime.Mount
|
||||||
|
mounts = append(mounts, criMounts...)
|
||||||
|
// Copy all mounts from extra mounts, except for mounts overriden by CRI.
|
||||||
|
for _, e := range extraMounts {
|
||||||
|
found := false
|
||||||
|
for _, c := range criMounts {
|
||||||
|
if filepath.Clean(e.ContainerPath) == filepath.Clean(c.ContainerPath) {
|
||||||
|
found = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !found {
|
||||||
|
mounts = append(mounts, e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return mounts
|
||||||
|
}
|
||||||
|
10
vendor/github.com/containerd/cri/pkg/server/container_status.go
generated
vendored
10
vendor/github.com/containerd/cri/pkg/server/container_status.go
generated
vendored
@ -46,14 +46,15 @@ func (c *criService) ContainerStatus(ctx context.Context, r *runtime.ContainerSt
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrapf(err, "failed to get image %q", imageRef)
|
return nil, errors.Wrapf(err, "failed to get image %q", imageRef)
|
||||||
}
|
}
|
||||||
if len(image.RepoTags) > 0 {
|
repoTags, repoDigests := parseImageReferences(image.References)
|
||||||
|
if len(repoTags) > 0 {
|
||||||
// Based on current behavior of dockershim, this field should be
|
// Based on current behavior of dockershim, this field should be
|
||||||
// image tag.
|
// image tag.
|
||||||
spec = &runtime.ImageSpec{Image: image.RepoTags[0]}
|
spec = &runtime.ImageSpec{Image: repoTags[0]}
|
||||||
}
|
}
|
||||||
if len(image.RepoDigests) > 0 {
|
if len(repoDigests) > 0 {
|
||||||
// Based on the CRI definition, this field will be consumed by user.
|
// Based on the CRI definition, this field will be consumed by user.
|
||||||
imageRef = image.RepoDigests[0]
|
imageRef = repoDigests[0]
|
||||||
}
|
}
|
||||||
status := toCRIContainerStatus(container, spec, imageRef)
|
status := toCRIContainerStatus(container, spec, imageRef)
|
||||||
info, err := toCRIContainerInfo(ctx, container, r.GetVerbose())
|
info, err := toCRIContainerInfo(ctx, container, r.GetVerbose())
|
||||||
@ -112,7 +113,6 @@ type containerInfo struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// toCRIContainerInfo converts internal container object information to CRI container status response info map.
|
// toCRIContainerInfo converts internal container object information to CRI container status response info map.
|
||||||
// TODO(random-liu): Return error instead of logging.
|
|
||||||
func toCRIContainerInfo(ctx context.Context, container containerstore.Container, verbose bool) (map[string]string, error) {
|
func toCRIContainerInfo(ctx context.Context, container containerstore.Container, verbose bool) (map[string]string, error) {
|
||||||
if !verbose {
|
if !verbose {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
|
80
vendor/github.com/containerd/cri/pkg/server/container_stop.go
generated
vendored
80
vendor/github.com/containerd/cri/pkg/server/container_stop.go
generated
vendored
@ -33,7 +33,10 @@ import (
|
|||||||
|
|
||||||
// killContainerTimeout is the timeout that we wait for the container to
|
// killContainerTimeout is the timeout that we wait for the container to
|
||||||
// be SIGKILLed.
|
// be SIGKILLed.
|
||||||
const killContainerTimeout = 2 * time.Minute
|
// The timeout is set to 1 min, because the default CRI operation timeout
|
||||||
|
// for StopContainer is (2 min + stop timeout). Set to 1 min, so that we
|
||||||
|
// have enough time for kill(all=true) and kill(all=false).
|
||||||
|
const killContainerTimeout = 1 * time.Minute
|
||||||
|
|
||||||
// StopContainer stops a running container with a grace period (i.e., timeout).
|
// StopContainer stops a running container with a grace period (i.e., timeout).
|
||||||
func (c *criService) StopContainer(ctx context.Context, r *runtime.StopContainerRequest) (*runtime.StopContainerResponse, error) {
|
func (c *criService) StopContainer(ctx context.Context, r *runtime.StopContainerRequest) (*runtime.StopContainerResponse, error) {
|
||||||
@ -63,6 +66,16 @@ func (c *criService) stopContainer(ctx context.Context, container containerstore
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task, err := container.Container.Task(ctx, nil)
|
||||||
|
if err != nil {
|
||||||
|
if !errdefs.IsNotFound(err) {
|
||||||
|
return errors.Wrapf(err, "failed to stop container, task not found for container %q", id)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// We only need to kill the task. The event handler will Delete the
|
||||||
|
// task from containerd after it handles the Exited event.
|
||||||
if timeout > 0 {
|
if timeout > 0 {
|
||||||
stopSignal := unix.SIGTERM
|
stopSignal := unix.SIGTERM
|
||||||
image, err := c.imageStore.Get(container.ImageRef)
|
image, err := c.imageStore.Get(container.ImageRef)
|
||||||
@ -81,52 +94,47 @@ func (c *criService) stopContainer(ctx context.Context, container containerstore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
logrus.Infof("Stop container %q with signal %v", id, stopSignal)
|
logrus.Infof("Stop container %q with signal %v", id, stopSignal)
|
||||||
task, err := container.Container.Task(ctx, nil)
|
if err = task.Kill(ctx, stopSignal); err != nil && !errdefs.IsNotFound(err) {
|
||||||
if err != nil {
|
return errors.Wrapf(err, "failed to stop container %q", id)
|
||||||
if !errdefs.IsNotFound(err) {
|
|
||||||
return errors.Wrapf(err, "failed to stop container, task not found for container %q", id)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
if task != nil {
|
|
||||||
if err = task.Kill(ctx, stopSignal); err != nil {
|
|
||||||
if !errdefs.IsNotFound(err) {
|
|
||||||
return errors.Wrapf(err, "failed to stop container %q", id)
|
|
||||||
}
|
|
||||||
// Move on to make sure container status is updated.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
err = c.waitContainerStop(ctx, container, timeout)
|
if err = c.waitContainerStop(ctx, container, timeout); err == nil {
|
||||||
if err == nil {
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
logrus.WithError(err).Errorf("Stop container %q timed out", id)
|
logrus.WithError(err).Errorf("An error occurs during waiting for container %q to be stopped", id)
|
||||||
}
|
}
|
||||||
|
|
||||||
task, err := container.Container.Task(ctx, nil)
|
|
||||||
if err != nil {
|
|
||||||
if !errdefs.IsNotFound(err) {
|
|
||||||
return errors.Wrapf(err, "failed to stop container, task not found for container %q", id)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
// Event handler will Delete the container from containerd after it handles the Exited event.
|
|
||||||
logrus.Infof("Kill container %q", id)
|
logrus.Infof("Kill container %q", id)
|
||||||
if task != nil {
|
if err = task.Kill(ctx, unix.SIGKILL, containerd.WithKillAll); err != nil && !errdefs.IsNotFound(err) {
|
||||||
if err = task.Kill(ctx, unix.SIGKILL, containerd.WithKillAll); err != nil {
|
return errors.Wrapf(err, "failed to kill container %q", id)
|
||||||
if !errdefs.IsNotFound(err) {
|
|
||||||
return errors.Wrapf(err, "failed to kill container %q", id)
|
|
||||||
}
|
|
||||||
// Move on to make sure container status is updated.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait for a fixed timeout until container stop is observed by event monitor.
|
// Wait for a fixed timeout until container stop is observed by event monitor.
|
||||||
if err := c.waitContainerStop(ctx, container, killContainerTimeout); err != nil {
|
if err = c.waitContainerStop(ctx, container, killContainerTimeout); err == nil {
|
||||||
return errors.Wrapf(err, "an error occurs during waiting for container %q to stop", id)
|
return nil
|
||||||
}
|
}
|
||||||
return nil
|
logrus.WithError(err).Errorf("An error occurs during waiting for container %q to be killed", id)
|
||||||
|
|
||||||
|
// This is a fix for `runc`, and should not break other runtimes. With
|
||||||
|
// containerd.WithKillAll, `runc` will get all processes from the container
|
||||||
|
// cgroups, and kill them. However, sometimes the processes may be moved
|
||||||
|
// out from the container cgroup, e.g. users manually move them by mistake,
|
||||||
|
// or systemd.Delegate=true is not set.
|
||||||
|
// In these cases, we should try our best to do cleanup, kill the container
|
||||||
|
// without containerd.WithKillAll, so that runc can kill the container init
|
||||||
|
// process directly.
|
||||||
|
// NOTE(random-liu): If pid namespace is shared inside the pod, non-init processes
|
||||||
|
// of this container will be left running until the pause container is stopped.
|
||||||
|
logrus.Infof("Kill container %q init process", id)
|
||||||
|
if err = task.Kill(ctx, unix.SIGKILL); err != nil && !errdefs.IsNotFound(err) {
|
||||||
|
return errors.Wrapf(err, "failed to kill container %q init process", id)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wait for a fixed timeout until container stop is observed by event monitor.
|
||||||
|
if err = c.waitContainerStop(ctx, container, killContainerTimeout); err == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return errors.Wrapf(err, "an error occurs during waiting for container %q init process to be killed", id)
|
||||||
}
|
}
|
||||||
|
|
||||||
// waitContainerStop waits for container to be stopped until timeout exceeds or context is cancelled.
|
// waitContainerStop waits for container to be stopped until timeout exceeds or context is cancelled.
|
||||||
|
66
vendor/github.com/containerd/cri/pkg/server/events.go
generated
vendored
66
vendor/github.com/containerd/cri/pkg/server/events.go
generated
vendored
@ -34,6 +34,7 @@ import (
|
|||||||
ctrdutil "github.com/containerd/cri/pkg/containerd/util"
|
ctrdutil "github.com/containerd/cri/pkg/containerd/util"
|
||||||
"github.com/containerd/cri/pkg/store"
|
"github.com/containerd/cri/pkg/store"
|
||||||
containerstore "github.com/containerd/cri/pkg/store/container"
|
containerstore "github.com/containerd/cri/pkg/store/container"
|
||||||
|
imagestore "github.com/containerd/cri/pkg/store/image"
|
||||||
sandboxstore "github.com/containerd/cri/pkg/store/sandbox"
|
sandboxstore "github.com/containerd/cri/pkg/store/sandbox"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -49,6 +50,7 @@ const (
|
|||||||
type eventMonitor struct {
|
type eventMonitor struct {
|
||||||
containerStore *containerstore.Store
|
containerStore *containerstore.Store
|
||||||
sandboxStore *sandboxstore.Store
|
sandboxStore *sandboxstore.Store
|
||||||
|
imageStore *imagestore.Store
|
||||||
ch <-chan *events.Envelope
|
ch <-chan *events.Envelope
|
||||||
errCh <-chan error
|
errCh <-chan error
|
||||||
ctx context.Context
|
ctx context.Context
|
||||||
@ -76,12 +78,13 @@ type backOffQueue struct {
|
|||||||
|
|
||||||
// Create new event monitor. New event monitor will start subscribing containerd event. All events
|
// Create new event monitor. New event monitor will start subscribing containerd event. All events
|
||||||
// happen after it should be monitored.
|
// happen after it should be monitored.
|
||||||
func newEventMonitor(c *containerstore.Store, s *sandboxstore.Store) *eventMonitor {
|
func newEventMonitor(c *containerstore.Store, s *sandboxstore.Store, i *imagestore.Store) *eventMonitor {
|
||||||
// event subscribe doesn't need namespace.
|
// event subscribe doesn't need namespace.
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
return &eventMonitor{
|
return &eventMonitor{
|
||||||
containerStore: c,
|
containerStore: c,
|
||||||
sandboxStore: s,
|
sandboxStore: s,
|
||||||
|
imageStore: i,
|
||||||
ctx: ctx,
|
ctx: ctx,
|
||||||
cancel: cancel,
|
cancel: cancel,
|
||||||
backOff: newBackOff(),
|
backOff: newBackOff(),
|
||||||
@ -93,12 +96,13 @@ func (em *eventMonitor) subscribe(subscriber events.Subscriber) {
|
|||||||
filters := []string{
|
filters := []string{
|
||||||
`topic=="/tasks/exit"`,
|
`topic=="/tasks/exit"`,
|
||||||
`topic=="/tasks/oom"`,
|
`topic=="/tasks/oom"`,
|
||||||
|
`topic~="/images/"`,
|
||||||
}
|
}
|
||||||
em.ch, em.errCh = subscriber.Subscribe(em.ctx, filters...)
|
em.ch, em.errCh = subscriber.Subscribe(em.ctx, filters...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func convertEvent(e *gogotypes.Any) (string, interface{}, error) {
|
func convertEvent(e *gogotypes.Any) (string, interface{}, error) {
|
||||||
containerID := ""
|
id := ""
|
||||||
evt, err := typeurl.UnmarshalAny(e)
|
evt, err := typeurl.UnmarshalAny(e)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", nil, errors.Wrap(err, "failed to unmarshalany")
|
return "", nil, errors.Wrap(err, "failed to unmarshalany")
|
||||||
@ -106,16 +110,22 @@ func convertEvent(e *gogotypes.Any) (string, interface{}, error) {
|
|||||||
|
|
||||||
switch evt.(type) {
|
switch evt.(type) {
|
||||||
case *eventtypes.TaskExit:
|
case *eventtypes.TaskExit:
|
||||||
containerID = evt.(*eventtypes.TaskExit).ContainerID
|
id = evt.(*eventtypes.TaskExit).ContainerID
|
||||||
case *eventtypes.TaskOOM:
|
case *eventtypes.TaskOOM:
|
||||||
containerID = evt.(*eventtypes.TaskOOM).ContainerID
|
id = evt.(*eventtypes.TaskOOM).ContainerID
|
||||||
|
case *eventtypes.ImageCreate:
|
||||||
|
id = evt.(*eventtypes.ImageCreate).Name
|
||||||
|
case *eventtypes.ImageUpdate:
|
||||||
|
id = evt.(*eventtypes.ImageUpdate).Name
|
||||||
|
case *eventtypes.ImageDelete:
|
||||||
|
id = evt.(*eventtypes.ImageDelete).Name
|
||||||
default:
|
default:
|
||||||
return "", nil, errors.New("unsupported event")
|
return "", nil, errors.New("unsupported event")
|
||||||
}
|
}
|
||||||
return containerID, evt, nil
|
return id, evt, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// start starts the event monitor which monitors and handles all container events. It returns
|
// start starts the event monitor which monitors and handles all subscribed events. It returns
|
||||||
// an error channel for the caller to wait for stop errors from the event monitor.
|
// an error channel for the caller to wait for stop errors from the event monitor.
|
||||||
// start must be called after subscribe.
|
// start must be called after subscribe.
|
||||||
func (em *eventMonitor) start() <-chan error {
|
func (em *eventMonitor) start() <-chan error {
|
||||||
@ -130,19 +140,19 @@ func (em *eventMonitor) start() <-chan error {
|
|||||||
select {
|
select {
|
||||||
case e := <-em.ch:
|
case e := <-em.ch:
|
||||||
logrus.Debugf("Received containerd event timestamp - %v, namespace - %q, topic - %q", e.Timestamp, e.Namespace, e.Topic)
|
logrus.Debugf("Received containerd event timestamp - %v, namespace - %q, topic - %q", e.Timestamp, e.Namespace, e.Topic)
|
||||||
cID, evt, err := convertEvent(e.Event)
|
id, evt, err := convertEvent(e.Event)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.WithError(err).Errorf("Failed to convert event %+v", e)
|
logrus.WithError(err).Errorf("Failed to convert event %+v", e)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
if em.backOff.isInBackOff(cID) {
|
if em.backOff.isInBackOff(id) {
|
||||||
logrus.Infof("Events for container %q is in backoff, enqueue event %+v", cID, evt)
|
logrus.Infof("Events for %q is in backoff, enqueue event %+v", id, evt)
|
||||||
em.backOff.enBackOff(cID, evt)
|
em.backOff.enBackOff(id, evt)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
if err := em.handleEvent(evt); err != nil {
|
if err := em.handleEvent(evt); err != nil {
|
||||||
logrus.WithError(err).Errorf("Failed to handle event %+v for container %s", evt, cID)
|
logrus.WithError(err).Errorf("Failed to handle event %+v for %s", evt, id)
|
||||||
em.backOff.enBackOff(cID, evt)
|
em.backOff.enBackOff(id, evt)
|
||||||
}
|
}
|
||||||
case err := <-em.errCh:
|
case err := <-em.errCh:
|
||||||
// Close errCh in defer directly if there is no error.
|
// Close errCh in defer directly if there is no error.
|
||||||
@ -152,13 +162,13 @@ func (em *eventMonitor) start() <-chan error {
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
case <-backOffCheckCh:
|
case <-backOffCheckCh:
|
||||||
cIDs := em.backOff.getExpiredContainers()
|
ids := em.backOff.getExpiredIDs()
|
||||||
for _, cID := range cIDs {
|
for _, id := range ids {
|
||||||
queue := em.backOff.deBackOff(cID)
|
queue := em.backOff.deBackOff(id)
|
||||||
for i, any := range queue.events {
|
for i, any := range queue.events {
|
||||||
if err := em.handleEvent(any); err != nil {
|
if err := em.handleEvent(any); err != nil {
|
||||||
logrus.WithError(err).Errorf("Failed to handle backOff event %+v for container %s", any, cID)
|
logrus.WithError(err).Errorf("Failed to handle backOff event %+v for %s", any, id)
|
||||||
em.backOff.reBackOff(cID, queue.events[i:], queue.duration)
|
em.backOff.reBackOff(id, queue.events[i:], queue.duration)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -230,6 +240,18 @@ func (em *eventMonitor) handleEvent(any interface{}) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "failed to update container status for TaskOOM event")
|
return errors.Wrap(err, "failed to update container status for TaskOOM event")
|
||||||
}
|
}
|
||||||
|
case *eventtypes.ImageCreate:
|
||||||
|
e := any.(*eventtypes.ImageCreate)
|
||||||
|
logrus.Infof("ImageCreate event %+v", e)
|
||||||
|
return em.imageStore.Update(ctx, e.Name)
|
||||||
|
case *eventtypes.ImageUpdate:
|
||||||
|
e := any.(*eventtypes.ImageUpdate)
|
||||||
|
logrus.Infof("ImageUpdate event %+v", e)
|
||||||
|
return em.imageStore.Update(ctx, e.Name)
|
||||||
|
case *eventtypes.ImageDelete:
|
||||||
|
e := any.(*eventtypes.ImageDelete)
|
||||||
|
logrus.Infof("ImageDelete event %+v", e)
|
||||||
|
return em.imageStore.Update(ctx, e.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
@ -331,14 +353,14 @@ func newBackOff() *backOff {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *backOff) getExpiredContainers() []string {
|
func (b *backOff) getExpiredIDs() []string {
|
||||||
var containers []string
|
var ids []string
|
||||||
for c, q := range b.queuePool {
|
for id, q := range b.queuePool {
|
||||||
if q.isExpire() {
|
if q.isExpire() {
|
||||||
containers = append(containers, c)
|
ids = append(ids, id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return containers
|
return ids
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *backOff) isInBackOff(key string) bool {
|
func (b *backOff) isInBackOff(key string) bool {
|
||||||
|
156
vendor/github.com/containerd/cri/pkg/server/helpers.go
generated
vendored
156
vendor/github.com/containerd/cri/pkg/server/helpers.go
generated
vendored
@ -17,22 +17,19 @@ limitations under the License.
|
|||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/containerd/containerd"
|
|
||||||
"github.com/containerd/containerd/containers"
|
"github.com/containerd/containerd/containers"
|
||||||
"github.com/containerd/containerd/content"
|
|
||||||
"github.com/containerd/containerd/runtime/linux/runctypes"
|
"github.com/containerd/containerd/runtime/linux/runctypes"
|
||||||
"github.com/containerd/typeurl"
|
"github.com/containerd/typeurl"
|
||||||
"github.com/docker/distribution/reference"
|
"github.com/docker/distribution/reference"
|
||||||
imagedigest "github.com/opencontainers/go-digest"
|
imagedigest "github.com/opencontainers/go-digest"
|
||||||
"github.com/opencontainers/image-spec/identity"
|
|
||||||
imagespec "github.com/opencontainers/image-spec/specs-go/v1"
|
|
||||||
runtimespec "github.com/opencontainers/runtime-spec/specs-go"
|
runtimespec "github.com/opencontainers/runtime-spec/specs-go"
|
||||||
"github.com/opencontainers/runtime-tools/generate"
|
"github.com/opencontainers/runtime-tools/generate"
|
||||||
"github.com/opencontainers/selinux/go-selinux"
|
"github.com/opencontainers/selinux/go-selinux"
|
||||||
@ -95,6 +92,8 @@ const (
|
|||||||
etcHosts = "/etc/hosts"
|
etcHosts = "/etc/hosts"
|
||||||
// resolvConfPath is the abs path of resolv.conf on host or container.
|
// resolvConfPath is the abs path of resolv.conf on host or container.
|
||||||
resolvConfPath = "/etc/resolv.conf"
|
resolvConfPath = "/etc/resolv.conf"
|
||||||
|
// hostnameEnv is the key for HOSTNAME env.
|
||||||
|
hostnameEnv = "HOSTNAME"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -234,28 +233,25 @@ func getRepoDigestAndTag(namedRef reference.Named, digest imagedigest.Digest, sc
|
|||||||
return repoDigest, repoTag
|
return repoDigest, repoTag
|
||||||
}
|
}
|
||||||
|
|
||||||
// localResolve resolves image reference locally and returns corresponding image metadata. It returns
|
// localResolve resolves image reference locally and returns corresponding image metadata. It
|
||||||
// nil without error if the reference doesn't exist.
|
// returns store.ErrNotExist if the reference doesn't exist.
|
||||||
func (c *criService) localResolve(ctx context.Context, refOrID string) (*imagestore.Image, error) {
|
func (c *criService) localResolve(refOrID string) (imagestore.Image, error) {
|
||||||
getImageID := func(refOrId string) string {
|
getImageID := func(refOrId string) string {
|
||||||
if _, err := imagedigest.Parse(refOrID); err == nil {
|
if _, err := imagedigest.Parse(refOrID); err == nil {
|
||||||
return refOrID
|
return refOrID
|
||||||
}
|
}
|
||||||
return func(ref string) string {
|
return func(ref string) string {
|
||||||
// ref is not image id, try to resolve it locally.
|
// ref is not image id, try to resolve it locally.
|
||||||
|
// TODO(random-liu): Handle this error better for debugging.
|
||||||
normalized, err := util.NormalizeImageRef(ref)
|
normalized, err := util.NormalizeImageRef(ref)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
image, err := c.client.GetImage(ctx, normalized.String())
|
id, err := c.imageStore.Resolve(normalized.String())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
desc, err := image.Config(ctx)
|
return id
|
||||||
if err != nil {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
return desc.Digest.String()
|
|
||||||
}(refOrID)
|
}(refOrID)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -264,14 +260,7 @@ func (c *criService) localResolve(ctx context.Context, refOrID string) (*imagest
|
|||||||
// Try to treat ref as imageID
|
// Try to treat ref as imageID
|
||||||
imageID = refOrID
|
imageID = refOrID
|
||||||
}
|
}
|
||||||
image, err := c.imageStore.Get(imageID)
|
return c.imageStore.Get(imageID)
|
||||||
if err != nil {
|
|
||||||
if err == store.ErrNotExist {
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
return nil, errors.Wrapf(err, "failed to get image %q", imageID)
|
|
||||||
}
|
|
||||||
return &image, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// getUserFromImage gets uid or user name of the image user.
|
// getUserFromImage gets uid or user name of the image user.
|
||||||
@ -296,12 +285,12 @@ func getUserFromImage(user string) (*int64, string) {
|
|||||||
// ensureImageExists returns corresponding metadata of the image reference, if image is not
|
// ensureImageExists returns corresponding metadata of the image reference, if image is not
|
||||||
// pulled yet, the function will pull the image.
|
// pulled yet, the function will pull the image.
|
||||||
func (c *criService) ensureImageExists(ctx context.Context, ref string) (*imagestore.Image, error) {
|
func (c *criService) ensureImageExists(ctx context.Context, ref string) (*imagestore.Image, error) {
|
||||||
image, err := c.localResolve(ctx, ref)
|
image, err := c.localResolve(ref)
|
||||||
if err != nil {
|
if err != nil && err != store.ErrNotExist {
|
||||||
return nil, errors.Wrapf(err, "failed to resolve image %q", ref)
|
return nil, errors.Wrapf(err, "failed to get image %q", ref)
|
||||||
}
|
}
|
||||||
if image != nil {
|
if err == nil {
|
||||||
return image, nil
|
return &image, nil
|
||||||
}
|
}
|
||||||
// Pull image to ensure the image exists
|
// Pull image to ensure the image exists
|
||||||
resp, err := c.PullImage(ctx, &runtime.PullImageRequest{Image: &runtime.ImageSpec{Image: ref}})
|
resp, err := c.PullImage(ctx, &runtime.PullImageRequest{Image: &runtime.ImageSpec{Image: ref}})
|
||||||
@ -312,56 +301,11 @@ func (c *criService) ensureImageExists(ctx context.Context, ref string) (*images
|
|||||||
newImage, err := c.imageStore.Get(imageID)
|
newImage, err := c.imageStore.Get(imageID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// It's still possible that someone removed the image right after it is pulled.
|
// It's still possible that someone removed the image right after it is pulled.
|
||||||
return nil, errors.Wrapf(err, "failed to get image %q metadata after pulling", imageID)
|
return nil, errors.Wrapf(err, "failed to get image %q after pulling", imageID)
|
||||||
}
|
}
|
||||||
return &newImage, nil
|
return &newImage, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// imageInfo is the information about the image got from containerd.
|
|
||||||
type imageInfo struct {
|
|
||||||
id string
|
|
||||||
chainID imagedigest.Digest
|
|
||||||
size int64
|
|
||||||
imagespec imagespec.Image
|
|
||||||
}
|
|
||||||
|
|
||||||
// getImageInfo gets image info from containerd.
|
|
||||||
func getImageInfo(ctx context.Context, image containerd.Image) (*imageInfo, error) {
|
|
||||||
// Get image information.
|
|
||||||
diffIDs, err := image.RootFS(ctx)
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.Wrap(err, "failed to get image diffIDs")
|
|
||||||
}
|
|
||||||
chainID := identity.ChainID(diffIDs)
|
|
||||||
|
|
||||||
size, err := image.Size(ctx)
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.Wrap(err, "failed to get image compressed resource size")
|
|
||||||
}
|
|
||||||
|
|
||||||
desc, err := image.Config(ctx)
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.Wrap(err, "failed to get image config descriptor")
|
|
||||||
}
|
|
||||||
id := desc.Digest.String()
|
|
||||||
|
|
||||||
rb, err := content.ReadBlob(ctx, image.ContentStore(), desc)
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.Wrap(err, "failed to read image config from content store")
|
|
||||||
}
|
|
||||||
var ociimage imagespec.Image
|
|
||||||
if err := json.Unmarshal(rb, &ociimage); err != nil {
|
|
||||||
return nil, errors.Wrapf(err, "failed to unmarshal image config %s", rb)
|
|
||||||
}
|
|
||||||
|
|
||||||
return &imageInfo{
|
|
||||||
id: id,
|
|
||||||
chainID: chainID,
|
|
||||||
size: size,
|
|
||||||
imagespec: ociimage,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func initSelinuxOpts(selinuxOpt *runtime.SELinuxOption) (string, string, error) {
|
func initSelinuxOpts(selinuxOpt *runtime.SELinuxOption) (string, string, error) {
|
||||||
if selinuxOpt == nil {
|
if selinuxOpt == nil {
|
||||||
return "", "", nil
|
return "", "", nil
|
||||||
@ -370,11 +314,16 @@ func initSelinuxOpts(selinuxOpt *runtime.SELinuxOption) (string, string, error)
|
|||||||
// Should ignored selinuxOpts if they are incomplete.
|
// Should ignored selinuxOpts if they are incomplete.
|
||||||
if selinuxOpt.GetUser() == "" ||
|
if selinuxOpt.GetUser() == "" ||
|
||||||
selinuxOpt.GetRole() == "" ||
|
selinuxOpt.GetRole() == "" ||
|
||||||
selinuxOpt.GetType() == "" ||
|
selinuxOpt.GetType() == "" {
|
||||||
selinuxOpt.GetLevel() == "" {
|
|
||||||
return "", "", nil
|
return "", "", nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// make sure the format of "level" is correct.
|
||||||
|
ok, err := checkSelinuxLevel(selinuxOpt.GetLevel())
|
||||||
|
if err != nil || !ok {
|
||||||
|
return "", "", err
|
||||||
|
}
|
||||||
|
|
||||||
labelOpts := fmt.Sprintf("%s:%s:%s:%s",
|
labelOpts := fmt.Sprintf("%s:%s:%s:%s",
|
||||||
selinuxOpt.GetUser(),
|
selinuxOpt.GetUser(),
|
||||||
selinuxOpt.GetRole(),
|
selinuxOpt.GetRole(),
|
||||||
@ -383,6 +332,18 @@ func initSelinuxOpts(selinuxOpt *runtime.SELinuxOption) (string, string, error)
|
|||||||
return label.InitLabels(selinux.DupSecOpt(labelOpts))
|
return label.InitLabels(selinux.DupSecOpt(labelOpts))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func checkSelinuxLevel(level string) (bool, error) {
|
||||||
|
if len(level) == 0 {
|
||||||
|
return true, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
matched, err := regexp.MatchString(`^s\d(-s\d)??(:c\d{1,4}((.c\d{1,4})?,c\d{1,4})*(.c\d{1,4})?(,c\d{1,4}(.c\d{1,4})?)*)?$`, level)
|
||||||
|
if err != nil || !matched {
|
||||||
|
return false, fmt.Errorf("the format of 'level' %q is not correct: %v", level, err)
|
||||||
|
}
|
||||||
|
return true, nil
|
||||||
|
}
|
||||||
|
|
||||||
// isInCRIMounts checks whether a destination is in CRI mount list.
|
// isInCRIMounts checks whether a destination is in CRI mount list.
|
||||||
func isInCRIMounts(dst string, mounts []*runtime.Mount) bool {
|
func isInCRIMounts(dst string, mounts []*runtime.Mount) bool {
|
||||||
for _, m := range mounts {
|
for _, m := range mounts {
|
||||||
@ -454,3 +415,48 @@ func toRuntimeAuthConfig(a criconfig.AuthConfig) *runtime.AuthConfig {
|
|||||||
IdentityToken: a.IdentityToken,
|
IdentityToken: a.IdentityToken,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// mounts defines how to sort runtime.Mount.
|
||||||
|
// This is the same with the Docker implementation:
|
||||||
|
// https://github.com/moby/moby/blob/17.05.x/daemon/volumes.go#L26
|
||||||
|
type orderedMounts []*runtime.Mount
|
||||||
|
|
||||||
|
// Len returns the number of mounts. Used in sorting.
|
||||||
|
func (m orderedMounts) Len() int {
|
||||||
|
return len(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Less returns true if the number of parts (a/b/c would be 3 parts) in the
|
||||||
|
// mount indexed by parameter 1 is less than that of the mount indexed by
|
||||||
|
// parameter 2. Used in sorting.
|
||||||
|
func (m orderedMounts) Less(i, j int) bool {
|
||||||
|
return m.parts(i) < m.parts(j)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Swap swaps two items in an array of mounts. Used in sorting
|
||||||
|
func (m orderedMounts) Swap(i, j int) {
|
||||||
|
m[i], m[j] = m[j], m[i]
|
||||||
|
}
|
||||||
|
|
||||||
|
// parts returns the number of parts in the destination of a mount. Used in sorting.
|
||||||
|
func (m orderedMounts) parts(i int) int {
|
||||||
|
return strings.Count(filepath.Clean(m[i].ContainerPath), string(os.PathSeparator))
|
||||||
|
}
|
||||||
|
|
||||||
|
// parseImageReferences parses a list of arbitrary image references and returns
|
||||||
|
// the repotags and repodigests
|
||||||
|
func parseImageReferences(refs []string) ([]string, []string) {
|
||||||
|
var tags, digests []string
|
||||||
|
for _, ref := range refs {
|
||||||
|
parsed, err := reference.ParseAnyReference(ref)
|
||||||
|
if err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if _, ok := parsed.(reference.Canonical); ok {
|
||||||
|
digests = append(digests, parsed.String())
|
||||||
|
} else if _, ok := parsed.(reference.Tagged); ok {
|
||||||
|
tags = append(tags, parsed.String())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return tags, digests
|
||||||
|
}
|
||||||
|
18
vendor/github.com/containerd/cri/pkg/server/image_list.go
generated
vendored
18
vendor/github.com/containerd/cri/pkg/server/image_list.go
generated
vendored
@ -19,8 +19,6 @@ package server
|
|||||||
import (
|
import (
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
|
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
|
||||||
|
|
||||||
imagestore "github.com/containerd/cri/pkg/store/image"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// ListImages lists existing images.
|
// ListImages lists existing images.
|
||||||
@ -38,19 +36,3 @@ func (c *criService) ListImages(ctx context.Context, r *runtime.ListImagesReques
|
|||||||
|
|
||||||
return &runtime.ListImagesResponse{Images: images}, nil
|
return &runtime.ListImagesResponse{Images: images}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// toCRIImage converts image to CRI image type.
|
|
||||||
func toCRIImage(image imagestore.Image) *runtime.Image {
|
|
||||||
runtimeImage := &runtime.Image{
|
|
||||||
Id: image.ID,
|
|
||||||
RepoTags: image.RepoTags,
|
|
||||||
RepoDigests: image.RepoDigests,
|
|
||||||
Size_: uint64(image.Size),
|
|
||||||
}
|
|
||||||
uid, username := getUserFromImage(image.ImageSpec.Config.User)
|
|
||||||
if uid != nil {
|
|
||||||
runtimeImage.Uid = &runtime.Int64Value{Value: *uid}
|
|
||||||
}
|
|
||||||
runtimeImage.Username = username
|
|
||||||
return runtimeImage
|
|
||||||
}
|
|
||||||
|
37
vendor/github.com/containerd/cri/pkg/server/image_load.go
generated
vendored
37
vendor/github.com/containerd/cri/pkg/server/image_load.go
generated
vendored
@ -26,7 +26,6 @@ import (
|
|||||||
|
|
||||||
api "github.com/containerd/cri/pkg/api/v1"
|
api "github.com/containerd/cri/pkg/api/v1"
|
||||||
"github.com/containerd/cri/pkg/containerd/importer"
|
"github.com/containerd/cri/pkg/containerd/importer"
|
||||||
imagestore "github.com/containerd/cri/pkg/store/image"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// LoadImage loads a image into containerd.
|
// LoadImage loads a image into containerd.
|
||||||
@ -39,42 +38,16 @@ func (c *criService) LoadImage(ctx context.Context, r *api.LoadImageRequest) (*a
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "failed to open file")
|
return nil, errors.Wrap(err, "failed to open file")
|
||||||
}
|
}
|
||||||
repoTags, err := importer.Import(ctx, c.client, f)
|
repoTags, err := importer.Import(ctx, c.client, f, importer.WithUnpack(c.config.ContainerdConfig.Snapshotter))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "failed to import image")
|
return nil, errors.Wrap(err, "failed to import image")
|
||||||
}
|
}
|
||||||
for _, repoTag := range repoTags {
|
for _, repoTag := range repoTags {
|
||||||
image, err := c.client.GetImage(ctx, repoTag)
|
// Update image store to reflect the newest state in containerd.
|
||||||
if err != nil {
|
if err := c.imageStore.Update(ctx, repoTag); err != nil {
|
||||||
return nil, errors.Wrapf(err, "failed to get image %q", repoTag)
|
return nil, errors.Wrapf(err, "failed to update image store %q", repoTag)
|
||||||
}
|
}
|
||||||
if err := image.Unpack(ctx, c.config.ContainerdConfig.Snapshotter); err != nil {
|
logrus.Debugf("Imported image %q", repoTag)
|
||||||
logrus.WithError(err).Warnf("Failed to unpack image %q", repoTag)
|
|
||||||
// Do not fail image importing. Unpack will be retried when container creation.
|
|
||||||
}
|
|
||||||
info, err := getImageInfo(ctx, image)
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.Wrapf(err, "failed to get image %q info", repoTag)
|
|
||||||
}
|
|
||||||
id := info.id
|
|
||||||
|
|
||||||
if err := c.createImageReference(ctx, id, image.Target()); err != nil {
|
|
||||||
return nil, errors.Wrapf(err, "failed to create image reference %q", id)
|
|
||||||
}
|
|
||||||
|
|
||||||
img := imagestore.Image{
|
|
||||||
ID: id,
|
|
||||||
RepoTags: []string{repoTag},
|
|
||||||
ChainID: info.chainID.String(),
|
|
||||||
Size: info.size,
|
|
||||||
ImageSpec: info.imagespec,
|
|
||||||
Image: image,
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := c.imageStore.Add(img); err != nil {
|
|
||||||
return nil, errors.Wrapf(err, "failed to add image %q into store", id)
|
|
||||||
}
|
|
||||||
logrus.Debugf("Imported image with id %q, repo tag %q", id, repoTag)
|
|
||||||
}
|
}
|
||||||
return &api.LoadImageResponse{Images: repoTags}, nil
|
return &api.LoadImageResponse{Images: repoTags}, nil
|
||||||
}
|
}
|
||||||
|
34
vendor/github.com/containerd/cri/pkg/server/image_pull.go
generated
vendored
34
vendor/github.com/containerd/cri/pkg/server/image_pull.go
generated
vendored
@ -34,7 +34,6 @@ import (
|
|||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
|
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
|
||||||
|
|
||||||
imagestore "github.com/containerd/cri/pkg/store/image"
|
|
||||||
"github.com/containerd/cri/pkg/util"
|
"github.com/containerd/cri/pkg/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -108,49 +107,34 @@ func (c *criService) PullImage(ctx context.Context, r *runtime.PullImageRequest)
|
|||||||
return nil, errors.Wrapf(err, "failed to pull and unpack image %q", ref)
|
return nil, errors.Wrapf(err, "failed to pull and unpack image %q", ref)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get image information.
|
configDesc, err := image.Config(ctx)
|
||||||
info, err := getImageInfo(ctx, image)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "failed to get image information")
|
return nil, errors.Wrap(err, "get image config descriptor")
|
||||||
}
|
}
|
||||||
imageID := info.id
|
imageID := configDesc.Digest.String()
|
||||||
|
|
||||||
repoDigest, repoTag := getRepoDigestAndTag(namedRef, image.Target().Digest, isSchema1)
|
repoDigest, repoTag := getRepoDigestAndTag(namedRef, image.Target().Digest, isSchema1)
|
||||||
for _, r := range []string{repoTag, repoDigest, imageID} {
|
for _, r := range []string{repoTag, repoDigest} {
|
||||||
if r == "" {
|
if r == "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if err := c.createImageReference(ctx, r, image.Target()); err != nil {
|
if err := c.createImageReference(ctx, r, image.Target()); err != nil {
|
||||||
return nil, errors.Wrapf(err, "failed to update image reference %q", r)
|
return nil, errors.Wrapf(err, "failed to update image reference %q", r)
|
||||||
}
|
}
|
||||||
|
// Update image store to reflect the newest state in containerd.
|
||||||
|
if err := c.imageStore.Update(ctx, r); err != nil {
|
||||||
|
return nil, errors.Wrapf(err, "failed to update image store %q", r)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logrus.Debugf("Pulled image %q with image id %q, repo tag %q, repo digest %q", imageRef, imageID,
|
logrus.Debugf("Pulled image %q with image id %q, repo tag %q, repo digest %q", imageRef, imageID,
|
||||||
repoTag, repoDigest)
|
repoTag, repoDigest)
|
||||||
img := imagestore.Image{
|
|
||||||
ID: imageID,
|
|
||||||
ChainID: info.chainID.String(),
|
|
||||||
Size: info.size,
|
|
||||||
ImageSpec: info.imagespec,
|
|
||||||
Image: image,
|
|
||||||
}
|
|
||||||
if repoDigest != "" {
|
|
||||||
img.RepoDigests = []string{repoDigest}
|
|
||||||
}
|
|
||||||
if repoTag != "" {
|
|
||||||
img.RepoTags = []string{repoTag}
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := c.imageStore.Add(img); err != nil {
|
|
||||||
return nil, errors.Wrapf(err, "failed to add image %q into store", img.ID)
|
|
||||||
}
|
|
||||||
|
|
||||||
// NOTE(random-liu): the actual state in containerd is the source of truth, even we maintain
|
// NOTE(random-liu): the actual state in containerd is the source of truth, even we maintain
|
||||||
// in-memory image store, it's only for in-memory indexing. The image could be removed
|
// in-memory image store, it's only for in-memory indexing. The image could be removed
|
||||||
// by someone else anytime, before/during/after we create the metadata. We should always
|
// by someone else anytime, before/during/after we create the metadata. We should always
|
||||||
// check the actual state in containerd before using the image or returning status of the
|
// check the actual state in containerd before using the image or returning status of the
|
||||||
// image.
|
// image.
|
||||||
return &runtime.PullImageResponse{ImageRef: img.ID}, nil
|
return &runtime.PullImageResponse{ImageRef: imageID}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParseAuth parses AuthConfig and returns username and password/secret required by containerd.
|
// ParseAuth parses AuthConfig and returns username and password/secret required by containerd.
|
||||||
|
70
vendor/github.com/containerd/cri/pkg/server/image_remove.go
generated
vendored
70
vendor/github.com/containerd/cri/pkg/server/image_remove.go
generated
vendored
@ -20,9 +20,10 @@ import (
|
|||||||
"github.com/containerd/containerd/errdefs"
|
"github.com/containerd/containerd/errdefs"
|
||||||
"github.com/containerd/containerd/images"
|
"github.com/containerd/containerd/images"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
|
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
|
||||||
|
|
||||||
|
"github.com/containerd/cri/pkg/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// RemoveImage removes the image.
|
// RemoveImage removes the image.
|
||||||
@ -32,62 +33,33 @@ import (
|
|||||||
// Remove the whole image no matter the it's image id or reference. This is the
|
// Remove the whole image no matter the it's image id or reference. This is the
|
||||||
// semantic defined in CRI now.
|
// semantic defined in CRI now.
|
||||||
func (c *criService) RemoveImage(ctx context.Context, r *runtime.RemoveImageRequest) (*runtime.RemoveImageResponse, error) {
|
func (c *criService) RemoveImage(ctx context.Context, r *runtime.RemoveImageRequest) (*runtime.RemoveImageResponse, error) {
|
||||||
image, err := c.localResolve(ctx, r.GetImage().GetImage())
|
image, err := c.localResolve(r.GetImage().GetImage())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if err == store.ErrNotExist {
|
||||||
|
// return empty without error when image not found.
|
||||||
|
return &runtime.RemoveImageResponse{}, nil
|
||||||
|
}
|
||||||
return nil, errors.Wrapf(err, "can not resolve %q locally", r.GetImage().GetImage())
|
return nil, errors.Wrapf(err, "can not resolve %q locally", r.GetImage().GetImage())
|
||||||
}
|
}
|
||||||
if image == nil {
|
|
||||||
// return empty without error when image not found.
|
|
||||||
return &runtime.RemoveImageResponse{}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Exclude outdated image tag.
|
// Remove all image references.
|
||||||
for i, tag := range image.RepoTags {
|
for i, ref := range image.References {
|
||||||
cImage, err := c.client.GetImage(ctx, tag)
|
var opts []images.DeleteOpt
|
||||||
if err != nil {
|
if i == len(image.References)-1 {
|
||||||
if errdefs.IsNotFound(err) {
|
// Delete the last image reference synchronously to trigger garbage collection.
|
||||||
continue
|
// This is best effort. It is possible that the image reference is deleted by
|
||||||
}
|
// someone else before this point.
|
||||||
return nil, errors.Wrapf(err, "failed to get image %q", tag)
|
opts = []images.DeleteOpt{images.SynchronousDelete()}
|
||||||
}
|
}
|
||||||
desc, err := cImage.Config(ctx)
|
err = c.client.ImageService().Delete(ctx, ref, opts...)
|
||||||
if err != nil {
|
|
||||||
// We can only get image id by reading Config from content.
|
|
||||||
// If the config is missing, we will fail to get image id,
|
|
||||||
// So we won't be able to remove the image forever,
|
|
||||||
// and the cri plugin always reports the image is ok.
|
|
||||||
// But we also don't check it by manifest,
|
|
||||||
// It's possible that two manifest digests have the same image ID in theory.
|
|
||||||
// In theory it's possible that an image is compressed with different algorithms,
|
|
||||||
// then they'll have the same uncompressed id - image id,
|
|
||||||
// but different ids generated from compressed contents - manifest digest.
|
|
||||||
// So we decide to leave it.
|
|
||||||
// After all, the user can override the repoTag by pulling image again.
|
|
||||||
logrus.WithError(err).Errorf("Can't remove image,failed to get config for Image tag %q,id %q", tag, image.ID)
|
|
||||||
image.RepoTags = append(image.RepoTags[:i], image.RepoTags[i+1:]...)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
cID := desc.Digest.String()
|
|
||||||
if cID != image.ID {
|
|
||||||
logrus.Debugf("Image tag %q for %q is outdated, it's currently used by %q", tag, image.ID, cID)
|
|
||||||
image.RepoTags = append(image.RepoTags[:i], image.RepoTags[i+1:]...)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Include all image references, including RepoTag, RepoDigest and id.
|
|
||||||
for _, ref := range append(image.RepoTags, image.RepoDigests...) {
|
|
||||||
err = c.client.ImageService().Delete(ctx, ref)
|
|
||||||
if err == nil || errdefs.IsNotFound(err) {
|
if err == nil || errdefs.IsNotFound(err) {
|
||||||
|
// Update image store to reflect the newest state in containerd.
|
||||||
|
if err := c.imageStore.Update(ctx, ref); err != nil {
|
||||||
|
return nil, errors.Wrapf(err, "failed to update image reference %q for %q", ref, image.ID)
|
||||||
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
return nil, errors.Wrapf(err, "failed to delete image reference %q for image %q", ref, image.ID)
|
return nil, errors.Wrapf(err, "failed to delete image reference %q for %q", ref, image.ID)
|
||||||
}
|
}
|
||||||
// Delete image id synchronously to trigger garbage collection.
|
|
||||||
err = c.client.ImageService().Delete(ctx, image.ID, images.SynchronousDelete())
|
|
||||||
if err != nil && !errdefs.IsNotFound(err) {
|
|
||||||
return nil, errors.Wrapf(err, "failed to delete image id %q", image.ID)
|
|
||||||
}
|
|
||||||
c.imageStore.Delete(image.ID)
|
|
||||||
return &runtime.RemoveImageResponse{}, nil
|
return &runtime.RemoveImageResponse{}, nil
|
||||||
}
|
}
|
||||||
|
24
vendor/github.com/containerd/cri/pkg/server/image_status.go
generated
vendored
24
vendor/github.com/containerd/cri/pkg/server/image_status.go
generated
vendored
@ -24,6 +24,7 @@ import (
|
|||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
|
runtime "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
|
||||||
|
|
||||||
|
"github.com/containerd/cri/pkg/store"
|
||||||
imagestore "github.com/containerd/cri/pkg/store/image"
|
imagestore "github.com/containerd/cri/pkg/store/image"
|
||||||
imagespec "github.com/opencontainers/image-spec/specs-go/v1"
|
imagespec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
)
|
)
|
||||||
@ -32,19 +33,19 @@ import (
|
|||||||
// TODO(random-liu): We should change CRI to distinguish image id and image spec. (See
|
// TODO(random-liu): We should change CRI to distinguish image id and image spec. (See
|
||||||
// kubernetes/kubernetes#46255)
|
// kubernetes/kubernetes#46255)
|
||||||
func (c *criService) ImageStatus(ctx context.Context, r *runtime.ImageStatusRequest) (*runtime.ImageStatusResponse, error) {
|
func (c *criService) ImageStatus(ctx context.Context, r *runtime.ImageStatusRequest) (*runtime.ImageStatusResponse, error) {
|
||||||
image, err := c.localResolve(ctx, r.GetImage().GetImage())
|
image, err := c.localResolve(r.GetImage().GetImage())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if err == store.ErrNotExist {
|
||||||
|
// return empty without error when image not found.
|
||||||
|
return &runtime.ImageStatusResponse{}, nil
|
||||||
|
}
|
||||||
return nil, errors.Wrapf(err, "can not resolve %q locally", r.GetImage().GetImage())
|
return nil, errors.Wrapf(err, "can not resolve %q locally", r.GetImage().GetImage())
|
||||||
}
|
}
|
||||||
if image == nil {
|
|
||||||
// return empty without error when image not found.
|
|
||||||
return &runtime.ImageStatusResponse{}, nil
|
|
||||||
}
|
|
||||||
// TODO(random-liu): [P0] Make sure corresponding snapshot exists. What if snapshot
|
// TODO(random-liu): [P0] Make sure corresponding snapshot exists. What if snapshot
|
||||||
// doesn't exist?
|
// doesn't exist?
|
||||||
|
|
||||||
runtimeImage := toCRIRuntimeImage(image)
|
runtimeImage := toCRIImage(image)
|
||||||
info, err := c.toCRIImageInfo(ctx, image, r.GetVerbose())
|
info, err := c.toCRIImageInfo(ctx, &image, r.GetVerbose())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "failed to generate image info")
|
return nil, errors.Wrap(err, "failed to generate image info")
|
||||||
}
|
}
|
||||||
@ -55,12 +56,13 @@ func (c *criService) ImageStatus(ctx context.Context, r *runtime.ImageStatusRequ
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// toCRIRuntimeImage converts internal image object to CRI runtime.Image.
|
// toCRIImage converts internal image object to CRI runtime.Image.
|
||||||
func toCRIRuntimeImage(image *imagestore.Image) *runtime.Image {
|
func toCRIImage(image imagestore.Image) *runtime.Image {
|
||||||
|
repoTags, repoDigests := parseImageReferences(image.References)
|
||||||
runtimeImage := &runtime.Image{
|
runtimeImage := &runtime.Image{
|
||||||
Id: image.ID,
|
Id: image.ID,
|
||||||
RepoTags: image.RepoTags,
|
RepoTags: repoTags,
|
||||||
RepoDigests: image.RepoDigests,
|
RepoDigests: repoDigests,
|
||||||
Size_: uint64(image.Size),
|
Size_: uint64(image.Size),
|
||||||
}
|
}
|
||||||
uid, username := getUserFromImage(image.ImageSpec.Config.User)
|
uid, username := getUserFromImage(image.ImageSpec.Config.User)
|
||||||
|
70
vendor/github.com/containerd/cri/pkg/server/restart.go
generated
vendored
70
vendor/github.com/containerd/cri/pkg/server/restart.go
generated
vendored
@ -28,7 +28,6 @@ import (
|
|||||||
containerdimages "github.com/containerd/containerd/images"
|
containerdimages "github.com/containerd/containerd/images"
|
||||||
"github.com/containerd/containerd/platforms"
|
"github.com/containerd/containerd/platforms"
|
||||||
"github.com/containerd/typeurl"
|
"github.com/containerd/typeurl"
|
||||||
"github.com/docker/distribution/reference"
|
|
||||||
"github.com/docker/docker/pkg/system"
|
"github.com/docker/docker/pkg/system"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
@ -97,16 +96,7 @@ func (c *criService) recover(ctx context.Context) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "failed to list images")
|
return errors.Wrap(err, "failed to list images")
|
||||||
}
|
}
|
||||||
images, err := loadImages(ctx, cImages, c.config.ContainerdConfig.Snapshotter)
|
loadImages(ctx, c.imageStore, cImages, c.config.ContainerdConfig.Snapshotter)
|
||||||
if err != nil {
|
|
||||||
return errors.Wrap(err, "failed to load images")
|
|
||||||
}
|
|
||||||
for _, image := range images {
|
|
||||||
logrus.Debugf("Loaded image %+v", image)
|
|
||||||
if err := c.imageStore.Add(image); err != nil {
|
|
||||||
return errors.Wrapf(err, "failed to add image %q to store", image.ID)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// It's possible that containerd containers are deleted unexpectedly. In that case,
|
// It's possible that containerd containers are deleted unexpectedly. In that case,
|
||||||
// we can't even get metadata, we should cleanup orphaned sandbox/container directories
|
// we can't even get metadata, we should cleanup orphaned sandbox/container directories
|
||||||
@ -404,26 +394,9 @@ func loadSandbox(ctx context.Context, cntr containerd.Container) (sandboxstore.S
|
|||||||
}
|
}
|
||||||
|
|
||||||
// loadImages loads images from containerd.
|
// loadImages loads images from containerd.
|
||||||
// TODO(random-liu): Check whether image is unpacked, because containerd put image reference
|
func loadImages(ctx context.Context, store *imagestore.Store, cImages []containerd.Image,
|
||||||
// into store before image is unpacked.
|
snapshotter string) {
|
||||||
func loadImages(ctx context.Context, cImages []containerd.Image,
|
|
||||||
snapshotter string) ([]imagestore.Image, error) {
|
|
||||||
// Group images by image id.
|
|
||||||
imageMap := make(map[string][]containerd.Image)
|
|
||||||
for _, i := range cImages {
|
for _, i := range cImages {
|
||||||
desc, err := i.Config(ctx)
|
|
||||||
if err != nil {
|
|
||||||
logrus.WithError(err).Warnf("Failed to get image config for %q", i.Name())
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
id := desc.Digest.String()
|
|
||||||
imageMap[id] = append(imageMap[id], i)
|
|
||||||
}
|
|
||||||
var images []imagestore.Image
|
|
||||||
for id, imgs := range imageMap {
|
|
||||||
// imgs len must be > 0, or else the entry will not be created in
|
|
||||||
// previous loop.
|
|
||||||
i := imgs[0]
|
|
||||||
ok, _, _, _, err := containerdimages.Check(ctx, i.ContentStore(), i.Target(), platforms.Default())
|
ok, _, _, _, err := containerdimages.Check(ctx, i.ContentStore(), i.Target(), platforms.Default())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.WithError(err).Errorf("Failed to check image content readiness for %q", i.Name())
|
logrus.WithError(err).Errorf("Failed to check image content readiness for %q", i.Name())
|
||||||
@ -436,48 +409,19 @@ func loadImages(ctx context.Context, cImages []containerd.Image,
|
|||||||
// Checking existence of top-level snapshot for each image being recovered.
|
// Checking existence of top-level snapshot for each image being recovered.
|
||||||
unpacked, err := i.IsUnpacked(ctx, snapshotter)
|
unpacked, err := i.IsUnpacked(ctx, snapshotter)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.WithError(err).Warnf("Failed to Check whether image is unpacked for image %s", i.Name())
|
logrus.WithError(err).Warnf("Failed to check whether image is unpacked for image %s", i.Name())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if !unpacked {
|
if !unpacked {
|
||||||
logrus.Warnf("The image %s is not unpacked.", i.Name())
|
logrus.Warnf("The image %s is not unpacked.", i.Name())
|
||||||
// TODO(random-liu): Consider whether we should try unpack here.
|
// TODO(random-liu): Consider whether we should try unpack here.
|
||||||
}
|
}
|
||||||
|
if err := store.Update(ctx, i.Name()); err != nil {
|
||||||
info, err := getImageInfo(ctx, i)
|
logrus.WithError(err).Warnf("Failed to update reference for image %q", i.Name())
|
||||||
if err != nil {
|
|
||||||
logrus.WithError(err).Warnf("Failed to get image info for %q", i.Name())
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
image := imagestore.Image{
|
logrus.Debugf("Loaded image %q", i.Name())
|
||||||
ID: id,
|
|
||||||
ChainID: info.chainID.String(),
|
|
||||||
Size: info.size,
|
|
||||||
ImageSpec: info.imagespec,
|
|
||||||
Image: i,
|
|
||||||
}
|
|
||||||
// Recover repo digests and repo tags.
|
|
||||||
for _, i := range imgs {
|
|
||||||
name := i.Name()
|
|
||||||
r, err := reference.ParseAnyReference(name)
|
|
||||||
if err != nil {
|
|
||||||
logrus.WithError(err).Warnf("Failed to parse image reference %q", name)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if _, ok := r.(reference.Canonical); ok {
|
|
||||||
image.RepoDigests = append(image.RepoDigests, name)
|
|
||||||
} else if _, ok := r.(reference.Tagged); ok {
|
|
||||||
image.RepoTags = append(image.RepoTags, name)
|
|
||||||
} else if _, ok := r.(reference.Digested); ok {
|
|
||||||
// This is an image id.
|
|
||||||
continue
|
|
||||||
} else {
|
|
||||||
logrus.Warnf("Invalid image reference %q", name)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
images = append(images, image)
|
|
||||||
}
|
}
|
||||||
return images, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func cleanupOrphanedIDDirs(cntrs []containerd.Container, base string) error {
|
func cleanupOrphanedIDDirs(cntrs []containerd.Container, base string) error {
|
||||||
|
42
vendor/github.com/containerd/cri/pkg/server/sandbox_run.go
generated
vendored
42
vendor/github.com/containerd/cri/pkg/server/sandbox_run.go
generated
vendored
@ -74,9 +74,10 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox
|
|||||||
// Create initial internal sandbox object.
|
// Create initial internal sandbox object.
|
||||||
sandbox := sandboxstore.NewSandbox(
|
sandbox := sandboxstore.NewSandbox(
|
||||||
sandboxstore.Metadata{
|
sandboxstore.Metadata{
|
||||||
ID: id,
|
ID: id,
|
||||||
Name: name,
|
Name: name,
|
||||||
Config: config,
|
Config: config,
|
||||||
|
RuntimeHandler: r.GetRuntimeHandler(),
|
||||||
},
|
},
|
||||||
sandboxstore.Status{
|
sandboxstore.Status{
|
||||||
State: sandboxstore.StateUnknown,
|
State: sandboxstore.StateUnknown,
|
||||||
@ -131,7 +132,7 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox
|
|||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
ociRuntime, err := c.getSandboxRuntime(config)
|
ociRuntime, err := c.getSandboxRuntime(config, r.GetRuntimeHandler())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "failed to get sandbox runtime")
|
return nil, errors.Wrap(err, "failed to get sandbox runtime")
|
||||||
}
|
}
|
||||||
@ -558,6 +559,9 @@ func toCNIPortMappings(criPortMappings []*runtime.PortMapping) []cni.PortMapping
|
|||||||
if mapping.HostPort <= 0 {
|
if mapping.HostPort <= 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if mapping.Protocol != runtime.Protocol_TCP && mapping.Protocol != runtime.Protocol_UDP {
|
||||||
|
continue
|
||||||
|
}
|
||||||
portMappings = append(portMappings, cni.PortMapping{
|
portMappings = append(portMappings, cni.PortMapping{
|
||||||
HostPort: mapping.HostPort,
|
HostPort: mapping.HostPort,
|
||||||
ContainerPort: mapping.ContainerPort,
|
ContainerPort: mapping.ContainerPort,
|
||||||
@ -601,9 +605,13 @@ func hostAccessingSandbox(config *runtime.PodSandboxConfig) bool {
|
|||||||
// getSandboxRuntime returns the runtime configuration for sandbox.
|
// getSandboxRuntime returns the runtime configuration for sandbox.
|
||||||
// If the sandbox contains untrusted workload, runtime for untrusted workload will be returned,
|
// If the sandbox contains untrusted workload, runtime for untrusted workload will be returned,
|
||||||
// or else default runtime will be returned.
|
// or else default runtime will be returned.
|
||||||
func (c *criService) getSandboxRuntime(config *runtime.PodSandboxConfig) (criconfig.Runtime, error) {
|
func (c *criService) getSandboxRuntime(config *runtime.PodSandboxConfig, runtimeHandler string) (criconfig.Runtime, error) {
|
||||||
untrusted := false
|
|
||||||
if untrustedWorkload(config) {
|
if untrustedWorkload(config) {
|
||||||
|
// If the untrusted annotation is provided, runtimeHandler MUST be empty.
|
||||||
|
if runtimeHandler != "" && runtimeHandler != criconfig.RuntimeUntrusted {
|
||||||
|
return criconfig.Runtime{}, errors.New("untrusted workload with explicit runtime handler is not allowed")
|
||||||
|
}
|
||||||
|
|
||||||
// If the untrusted workload is requesting access to the host/node, this request will fail.
|
// If the untrusted workload is requesting access to the host/node, this request will fail.
|
||||||
//
|
//
|
||||||
// Note: If the workload is marked untrusted but requests privileged, this can be granted, as the
|
// Note: If the workload is marked untrusted but requests privileged, this can be granted, as the
|
||||||
@ -612,14 +620,22 @@ func (c *criService) getSandboxRuntime(config *runtime.PodSandboxConfig) (cricon
|
|||||||
if hostAccessingSandbox(config) {
|
if hostAccessingSandbox(config) {
|
||||||
return criconfig.Runtime{}, errors.New("untrusted workload with host access is not allowed")
|
return criconfig.Runtime{}, errors.New("untrusted workload with host access is not allowed")
|
||||||
}
|
}
|
||||||
untrusted = true
|
|
||||||
|
// Handle the deprecated UntrustedWorkloadRuntime.
|
||||||
|
if c.config.ContainerdConfig.UntrustedWorkloadRuntime.Type != "" {
|
||||||
|
return c.config.ContainerdConfig.UntrustedWorkloadRuntime, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
runtimeHandler = criconfig.RuntimeUntrusted
|
||||||
}
|
}
|
||||||
|
|
||||||
if untrusted {
|
if runtimeHandler == "" {
|
||||||
if c.config.ContainerdConfig.UntrustedWorkloadRuntime.Type == "" {
|
return c.config.ContainerdConfig.DefaultRuntime, nil
|
||||||
return criconfig.Runtime{}, errors.New("no runtime for untrusted workload is configured")
|
|
||||||
}
|
|
||||||
return c.config.ContainerdConfig.UntrustedWorkloadRuntime, nil
|
|
||||||
}
|
}
|
||||||
return c.config.ContainerdConfig.DefaultRuntime, nil
|
|
||||||
|
handler, ok := c.config.ContainerdConfig.Runtimes[runtimeHandler]
|
||||||
|
if !ok {
|
||||||
|
return criconfig.Runtime{}, errors.Errorf("no runtime for %q is configured", runtimeHandler)
|
||||||
|
}
|
||||||
|
return handler, nil
|
||||||
}
|
}
|
||||||
|
26
vendor/github.com/containerd/cri/pkg/server/sandbox_status.go
generated
vendored
26
vendor/github.com/containerd/cri/pkg/server/sandbox_status.go
generated
vendored
@ -102,15 +102,16 @@ func toCRISandboxStatus(meta sandboxstore.Metadata, status sandboxstore.Status,
|
|||||||
|
|
||||||
// TODO (mikebrow): discuss predefining constants structures for some or all of these field names in CRI
|
// TODO (mikebrow): discuss predefining constants structures for some or all of these field names in CRI
|
||||||
type sandboxInfo struct {
|
type sandboxInfo struct {
|
||||||
Pid uint32 `json:"pid"`
|
Pid uint32 `json:"pid"`
|
||||||
Status string `json:"processStatus"`
|
Status string `json:"processStatus"`
|
||||||
NetNSClosed bool `json:"netNamespaceClosed"`
|
NetNSClosed bool `json:"netNamespaceClosed"`
|
||||||
Image string `json:"image"`
|
Image string `json:"image"`
|
||||||
SnapshotKey string `json:"snapshotKey"`
|
SnapshotKey string `json:"snapshotKey"`
|
||||||
Snapshotter string `json:"snapshotter"`
|
Snapshotter string `json:"snapshotter"`
|
||||||
Runtime *criconfig.Runtime `json:"runtime"`
|
RuntimeHandler string `json:"runtimeHandler"`
|
||||||
Config *runtime.PodSandboxConfig `json:"config"`
|
Runtime *criconfig.Runtime `json:"runtime"`
|
||||||
RuntimeSpec *runtimespec.Spec `json:"runtimeSpec"`
|
Config *runtime.PodSandboxConfig `json:"config"`
|
||||||
|
RuntimeSpec *runtimespec.Spec `json:"runtimeSpec"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// toCRISandboxInfo converts internal container object information to CRI sandbox status response info map.
|
// toCRISandboxInfo converts internal container object information to CRI sandbox status response info map.
|
||||||
@ -132,9 +133,10 @@ func toCRISandboxInfo(ctx context.Context, sandbox sandboxstore.Sandbox) (map[st
|
|||||||
}
|
}
|
||||||
|
|
||||||
si := &sandboxInfo{
|
si := &sandboxInfo{
|
||||||
Pid: sandbox.Status.Get().Pid,
|
Pid: sandbox.Status.Get().Pid,
|
||||||
Status: string(processStatus),
|
RuntimeHandler: sandbox.RuntimeHandler,
|
||||||
Config: sandbox.Config,
|
Status: string(processStatus),
|
||||||
|
Config: sandbox.Config,
|
||||||
}
|
}
|
||||||
|
|
||||||
if si.Status == "" {
|
if si.Status == "" {
|
||||||
|
13
vendor/github.com/containerd/cri/pkg/server/sandbox_stop.go
generated
vendored
13
vendor/github.com/containerd/cri/pkg/server/sandbox_stop.go
generated
vendored
@ -109,11 +109,20 @@ func (c *criService) stopSandboxContainer(ctx context.Context, sandbox sandboxst
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Kill the sandbox container.
|
// Kill the sandbox container.
|
||||||
err = task.Kill(ctx, unix.SIGKILL, containerd.WithKillAll)
|
if err = task.Kill(ctx, unix.SIGKILL, containerd.WithKillAll); err != nil && !errdefs.IsNotFound(err) {
|
||||||
if err != nil && !errdefs.IsNotFound(err) {
|
|
||||||
return errors.Wrap(err, "failed to kill sandbox container")
|
return errors.Wrap(err, "failed to kill sandbox container")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err = c.waitSandboxStop(ctx, sandbox, killContainerTimeout); err == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
logrus.WithError(err).Errorf("An error occurs during waiting for sandbox %q to be killed", sandbox.ID)
|
||||||
|
|
||||||
|
// Kill the sandbox container init process.
|
||||||
|
if err = task.Kill(ctx, unix.SIGKILL); err != nil && !errdefs.IsNotFound(err) {
|
||||||
|
return errors.Wrap(err, "failed to kill sandbox container init process")
|
||||||
|
}
|
||||||
|
|
||||||
return c.waitSandboxStop(ctx, sandbox, killContainerTimeout)
|
return c.waitSandboxStop(ctx, sandbox, killContainerTimeout)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
vendor/github.com/containerd/cri/pkg/server/service.go
generated
vendored
4
vendor/github.com/containerd/cri/pkg/server/service.go
generated
vendored
@ -113,7 +113,7 @@ func NewCRIService(config criconfig.Config, client *containerd.Client) (CRIServi
|
|||||||
os: osinterface.RealOS{},
|
os: osinterface.RealOS{},
|
||||||
sandboxStore: sandboxstore.NewStore(),
|
sandboxStore: sandboxstore.NewStore(),
|
||||||
containerStore: containerstore.NewStore(),
|
containerStore: containerstore.NewStore(),
|
||||||
imageStore: imagestore.NewStore(),
|
imageStore: imagestore.NewStore(client),
|
||||||
snapshotStore: snapshotstore.NewStore(),
|
snapshotStore: snapshotstore.NewStore(),
|
||||||
sandboxNameIndex: registrar.NewRegistrar(),
|
sandboxNameIndex: registrar.NewRegistrar(),
|
||||||
containerNameIndex: registrar.NewRegistrar(),
|
containerNameIndex: registrar.NewRegistrar(),
|
||||||
@ -157,7 +157,7 @@ func NewCRIService(config criconfig.Config, client *containerd.Client) (CRIServi
|
|||||||
return nil, errors.Wrap(err, "failed to create stream server")
|
return nil, errors.Wrap(err, "failed to create stream server")
|
||||||
}
|
}
|
||||||
|
|
||||||
c.eventMonitor = newEventMonitor(c.containerStore, c.sandboxStore)
|
c.eventMonitor = newEventMonitor(c.containerStore, c.sandboxStore, c.imageStore)
|
||||||
|
|
||||||
return c, nil
|
return c, nil
|
||||||
}
|
}
|
||||||
|
54
vendor/github.com/containerd/cri/pkg/server/streaming.go
generated
vendored
54
vendor/github.com/containerd/cri/pkg/server/streaming.go
generated
vendored
@ -34,6 +34,36 @@ import (
|
|||||||
ctrdutil "github.com/containerd/cri/pkg/containerd/util"
|
ctrdutil "github.com/containerd/cri/pkg/containerd/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type streamListenerMode int
|
||||||
|
|
||||||
|
const (
|
||||||
|
x509KeyPairTLS streamListenerMode = iota
|
||||||
|
selfSignTLS
|
||||||
|
withoutTLS
|
||||||
|
)
|
||||||
|
|
||||||
|
func getStreamListenerMode(c *criService) (streamListenerMode, error) {
|
||||||
|
if c.config.EnableTLSStreaming {
|
||||||
|
if c.config.X509KeyPairStreaming.TLSCertFile != "" && c.config.X509KeyPairStreaming.TLSKeyFile != "" {
|
||||||
|
return x509KeyPairTLS, nil
|
||||||
|
}
|
||||||
|
if c.config.X509KeyPairStreaming.TLSCertFile != "" && c.config.X509KeyPairStreaming.TLSKeyFile == "" {
|
||||||
|
return -1, errors.New("must set X509KeyPairStreaming.TLSKeyFile")
|
||||||
|
}
|
||||||
|
if c.config.X509KeyPairStreaming.TLSCertFile == "" && c.config.X509KeyPairStreaming.TLSKeyFile != "" {
|
||||||
|
return -1, errors.New("must set X509KeyPairStreaming.TLSCertFile")
|
||||||
|
}
|
||||||
|
return selfSignTLS, nil
|
||||||
|
}
|
||||||
|
if c.config.X509KeyPairStreaming.TLSCertFile != "" {
|
||||||
|
return -1, errors.New("X509KeyPairStreaming.TLSCertFile is set but EnableTLSStreaming is not set")
|
||||||
|
}
|
||||||
|
if c.config.X509KeyPairStreaming.TLSKeyFile != "" {
|
||||||
|
return -1, errors.New("X509KeyPairStreaming.TLSKeyFile is set but EnableTLSStreaming is not set")
|
||||||
|
}
|
||||||
|
return withoutTLS, nil
|
||||||
|
}
|
||||||
|
|
||||||
func newStreamServer(c *criService, addr, port string) (streaming.Server, error) {
|
func newStreamServer(c *criService, addr, port string) (streaming.Server, error) {
|
||||||
if addr == "" {
|
if addr == "" {
|
||||||
a, err := k8snet.ChooseBindAddress(nil)
|
a, err := k8snet.ChooseBindAddress(nil)
|
||||||
@ -44,8 +74,22 @@ func newStreamServer(c *criService, addr, port string) (streaming.Server, error)
|
|||||||
}
|
}
|
||||||
config := streaming.DefaultConfig
|
config := streaming.DefaultConfig
|
||||||
config.Addr = net.JoinHostPort(addr, port)
|
config.Addr = net.JoinHostPort(addr, port)
|
||||||
runtime := newStreamRuntime(c)
|
run := newStreamRuntime(c)
|
||||||
if c.config.EnableTLSStreaming {
|
tlsMode, err := getStreamListenerMode(c)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrapf(err, "invalid stream server configuration")
|
||||||
|
}
|
||||||
|
switch tlsMode {
|
||||||
|
case x509KeyPairTLS:
|
||||||
|
tlsCert, err := tls.LoadX509KeyPair(c.config.X509KeyPairStreaming.TLSCertFile, c.config.X509KeyPairStreaming.TLSKeyFile)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrap(err, "failed to load x509 key pair for stream server")
|
||||||
|
}
|
||||||
|
config.TLSConfig = &tls.Config{
|
||||||
|
Certificates: []tls.Certificate{tlsCert},
|
||||||
|
}
|
||||||
|
return streaming.NewServer(config, run)
|
||||||
|
case selfSignTLS:
|
||||||
tlsCert, err := newTLSCert()
|
tlsCert, err := newTLSCert()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "failed to generate tls certificate for stream server")
|
return nil, errors.Wrap(err, "failed to generate tls certificate for stream server")
|
||||||
@ -54,8 +98,12 @@ func newStreamServer(c *criService, addr, port string) (streaming.Server, error)
|
|||||||
Certificates: []tls.Certificate{tlsCert},
|
Certificates: []tls.Certificate{tlsCert},
|
||||||
InsecureSkipVerify: true,
|
InsecureSkipVerify: true,
|
||||||
}
|
}
|
||||||
|
return streaming.NewServer(config, run)
|
||||||
|
case withoutTLS:
|
||||||
|
return streaming.NewServer(config, run)
|
||||||
|
default:
|
||||||
|
return nil, errors.New("invalid configuration for the stream listener")
|
||||||
}
|
}
|
||||||
return streaming.NewServer(config, runtime)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type streamRuntime struct {
|
type streamRuntime struct {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2014 The Kubernetes Authors.
|
Copyright 2018 The Containerd Authors.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
@ -14,6 +14,21 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Package wait provides tools for polling or listening for changes
|
package image
|
||||||
// to a condition.
|
|
||||||
package wait // import "k8s.io/apimachinery/pkg/util/wait"
|
import "github.com/pkg/errors"
|
||||||
|
|
||||||
|
// NewFakeStore returns an image store with predefined images.
|
||||||
|
// Update is not allowed for this fake store.
|
||||||
|
func NewFakeStore(images []Image) (*Store, error) {
|
||||||
|
s := NewStore(nil)
|
||||||
|
for _, i := range images {
|
||||||
|
for _, ref := range i.References {
|
||||||
|
s.refCache[ref] = i.ID
|
||||||
|
}
|
||||||
|
if err := s.store.add(i); err != nil {
|
||||||
|
return nil, errors.Wrapf(err, "add image %q", i)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return s, nil
|
||||||
|
}
|
214
vendor/github.com/containerd/cri/pkg/store/image/image.go
generated
vendored
214
vendor/github.com/containerd/cri/pkg/store/image/image.go
generated
vendored
@ -17,14 +17,21 @@ limitations under the License.
|
|||||||
package image
|
package image
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/containerd/containerd"
|
"github.com/containerd/containerd"
|
||||||
|
"github.com/containerd/containerd/content"
|
||||||
|
"github.com/containerd/containerd/errdefs"
|
||||||
"github.com/docker/distribution/digestset"
|
"github.com/docker/distribution/digestset"
|
||||||
godigest "github.com/opencontainers/go-digest"
|
imagedigest "github.com/opencontainers/go-digest"
|
||||||
|
imageidentity "github.com/opencontainers/image-spec/identity"
|
||||||
imagespec "github.com/opencontainers/image-spec/specs-go/v1"
|
imagespec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"github.com/containerd/cri/pkg/store"
|
storeutil "github.com/containerd/cri/pkg/store"
|
||||||
|
"github.com/containerd/cri/pkg/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Image contains all resources associated with the image. All fields
|
// Image contains all resources associated with the image. All fields
|
||||||
@ -32,10 +39,8 @@ import (
|
|||||||
type Image struct {
|
type Image struct {
|
||||||
// Id of the image. Normally the digest of image config.
|
// Id of the image. Normally the digest of image config.
|
||||||
ID string
|
ID string
|
||||||
// Other names by which this image is known.
|
// References are references to the image, e.g. RepoTag and RepoDigest.
|
||||||
RepoTags []string
|
References []string
|
||||||
// Digests by which this image is known.
|
|
||||||
RepoDigests []string
|
|
||||||
// ChainID is the chainID of the image.
|
// ChainID is the chainID of the image.
|
||||||
ChainID string
|
ChainID string
|
||||||
// Size is the compressed size of the image.
|
// Size is the compressed size of the image.
|
||||||
@ -48,28 +53,156 @@ type Image struct {
|
|||||||
|
|
||||||
// Store stores all images.
|
// Store stores all images.
|
||||||
type Store struct {
|
type Store struct {
|
||||||
|
lock sync.RWMutex
|
||||||
|
// refCache is a containerd image reference to image id cache.
|
||||||
|
refCache map[string]string
|
||||||
|
// client is the containerd client.
|
||||||
|
client *containerd.Client
|
||||||
|
// store is the internal image store indexed by image id.
|
||||||
|
store *store
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewStore creates an image store.
|
||||||
|
func NewStore(client *containerd.Client) *Store {
|
||||||
|
return &Store{
|
||||||
|
refCache: make(map[string]string),
|
||||||
|
client: client,
|
||||||
|
store: &store{
|
||||||
|
images: make(map[string]Image),
|
||||||
|
digestSet: digestset.NewSet(),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update updates cache for a reference.
|
||||||
|
func (s *Store) Update(ctx context.Context, ref string) error {
|
||||||
|
s.lock.Lock()
|
||||||
|
defer s.lock.Unlock()
|
||||||
|
i, err := s.client.GetImage(ctx, ref)
|
||||||
|
if err != nil && !errdefs.IsNotFound(err) {
|
||||||
|
return errors.Wrap(err, "get image from containerd")
|
||||||
|
}
|
||||||
|
var img *Image
|
||||||
|
if err == nil {
|
||||||
|
img, err = getImage(ctx, i)
|
||||||
|
if err != nil {
|
||||||
|
return errors.Wrap(err, "get image info from containerd")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return s.update(ref, img)
|
||||||
|
}
|
||||||
|
|
||||||
|
// update updates the internal cache. img == nil means that
|
||||||
|
// the image does not exist in containerd.
|
||||||
|
func (s *Store) update(ref string, img *Image) error {
|
||||||
|
oldID, oldExist := s.refCache[ref]
|
||||||
|
if img == nil {
|
||||||
|
// The image reference doesn't exist in containerd.
|
||||||
|
if oldExist {
|
||||||
|
// Remove the reference from the store.
|
||||||
|
s.store.delete(oldID, ref)
|
||||||
|
delete(s.refCache, ref)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if oldExist {
|
||||||
|
if oldID == img.ID {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
// Updated. Remove tag from old image.
|
||||||
|
s.store.delete(oldID, ref)
|
||||||
|
}
|
||||||
|
// New image. Add new image.
|
||||||
|
s.refCache[ref] = img.ID
|
||||||
|
return s.store.add(*img)
|
||||||
|
}
|
||||||
|
|
||||||
|
// getImage gets image information from containerd.
|
||||||
|
func getImage(ctx context.Context, i containerd.Image) (*Image, error) {
|
||||||
|
// Get image information.
|
||||||
|
diffIDs, err := i.RootFS(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrap(err, "get image diffIDs")
|
||||||
|
}
|
||||||
|
chainID := imageidentity.ChainID(diffIDs)
|
||||||
|
|
||||||
|
size, err := i.Size(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrap(err, "get image compressed resource size")
|
||||||
|
}
|
||||||
|
|
||||||
|
desc, err := i.Config(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrap(err, "get image config descriptor")
|
||||||
|
}
|
||||||
|
id := desc.Digest.String()
|
||||||
|
|
||||||
|
rb, err := content.ReadBlob(ctx, i.ContentStore(), desc)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrap(err, "read image config from content store")
|
||||||
|
}
|
||||||
|
var ociimage imagespec.Image
|
||||||
|
if err := json.Unmarshal(rb, &ociimage); err != nil {
|
||||||
|
return nil, errors.Wrapf(err, "unmarshal image config %s", rb)
|
||||||
|
}
|
||||||
|
|
||||||
|
return &Image{
|
||||||
|
ID: id,
|
||||||
|
References: []string{i.Name()},
|
||||||
|
ChainID: chainID.String(),
|
||||||
|
Size: size,
|
||||||
|
ImageSpec: ociimage,
|
||||||
|
Image: i,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Resolve resolves a image reference to image id.
|
||||||
|
func (s *Store) Resolve(ref string) (string, error) {
|
||||||
|
s.lock.RLock()
|
||||||
|
defer s.lock.RUnlock()
|
||||||
|
id, ok := s.refCache[ref]
|
||||||
|
if !ok {
|
||||||
|
return "", storeutil.ErrNotExist
|
||||||
|
}
|
||||||
|
return id, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get gets image metadata by image id. The id can be truncated.
|
||||||
|
// Returns various validation errors if the image id is invalid.
|
||||||
|
// Returns storeutil.ErrNotExist if the image doesn't exist.
|
||||||
|
func (s *Store) Get(id string) (Image, error) {
|
||||||
|
return s.store.get(id)
|
||||||
|
}
|
||||||
|
|
||||||
|
// List lists all images.
|
||||||
|
func (s *Store) List() []Image {
|
||||||
|
return s.store.list()
|
||||||
|
}
|
||||||
|
|
||||||
|
type store struct {
|
||||||
lock sync.RWMutex
|
lock sync.RWMutex
|
||||||
images map[string]Image
|
images map[string]Image
|
||||||
digestSet *digestset.Set
|
digestSet *digestset.Set
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewStore creates an image store.
|
func (s *store) list() []Image {
|
||||||
func NewStore() *Store {
|
s.lock.RLock()
|
||||||
return &Store{
|
defer s.lock.RUnlock()
|
||||||
images: make(map[string]Image),
|
var images []Image
|
||||||
digestSet: digestset.NewSet(),
|
for _, i := range s.images {
|
||||||
|
images = append(images, i)
|
||||||
}
|
}
|
||||||
|
return images
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add an image into the store.
|
func (s *store) add(img Image) error {
|
||||||
func (s *Store) Add(img Image) error {
|
|
||||||
s.lock.Lock()
|
s.lock.Lock()
|
||||||
defer s.lock.Unlock()
|
defer s.lock.Unlock()
|
||||||
if _, err := s.digestSet.Lookup(img.ID); err != nil {
|
if _, err := s.digestSet.Lookup(img.ID); err != nil {
|
||||||
if err != digestset.ErrDigestNotFound {
|
if err != digestset.ErrDigestNotFound {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := s.digestSet.Add(godigest.Digest(img.ID)); err != nil {
|
if err := s.digestSet.Add(imagedigest.Digest(img.ID)); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -80,44 +213,29 @@ func (s *Store) Add(img Image) error {
|
|||||||
s.images[img.ID] = img
|
s.images[img.ID] = img
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
// Or else, merge the repo tags/digests.
|
// Or else, merge the references.
|
||||||
i.RepoTags = mergeStringSlices(i.RepoTags, img.RepoTags)
|
i.References = util.MergeStringSlices(i.References, img.References)
|
||||||
i.RepoDigests = mergeStringSlices(i.RepoDigests, img.RepoDigests)
|
|
||||||
s.images[img.ID] = i
|
s.images[img.ID] = i
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get returns the image with specified id. Returns store.ErrNotExist if the
|
func (s *store) get(id string) (Image, error) {
|
||||||
// image doesn't exist.
|
|
||||||
func (s *Store) Get(id string) (Image, error) {
|
|
||||||
s.lock.RLock()
|
s.lock.RLock()
|
||||||
defer s.lock.RUnlock()
|
defer s.lock.RUnlock()
|
||||||
digest, err := s.digestSet.Lookup(id)
|
digest, err := s.digestSet.Lookup(id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == digestset.ErrDigestNotFound {
|
if err == digestset.ErrDigestNotFound {
|
||||||
err = store.ErrNotExist
|
err = storeutil.ErrNotExist
|
||||||
}
|
}
|
||||||
return Image{}, err
|
return Image{}, err
|
||||||
}
|
}
|
||||||
if i, ok := s.images[digest.String()]; ok {
|
if i, ok := s.images[digest.String()]; ok {
|
||||||
return i, nil
|
return i, nil
|
||||||
}
|
}
|
||||||
return Image{}, store.ErrNotExist
|
return Image{}, storeutil.ErrNotExist
|
||||||
}
|
}
|
||||||
|
|
||||||
// List lists all images.
|
func (s *store) delete(id, ref string) {
|
||||||
func (s *Store) List() []Image {
|
|
||||||
s.lock.RLock()
|
|
||||||
defer s.lock.RUnlock()
|
|
||||||
var images []Image
|
|
||||||
for _, i := range s.images {
|
|
||||||
images = append(images, i)
|
|
||||||
}
|
|
||||||
return images
|
|
||||||
}
|
|
||||||
|
|
||||||
// Delete deletes the image with specified id.
|
|
||||||
func (s *Store) Delete(id string) {
|
|
||||||
s.lock.Lock()
|
s.lock.Lock()
|
||||||
defer s.lock.Unlock()
|
defer s.lock.Unlock()
|
||||||
digest, err := s.digestSet.Lookup(id)
|
digest, err := s.digestSet.Lookup(id)
|
||||||
@ -126,22 +244,16 @@ func (s *Store) Delete(id string) {
|
|||||||
// So we need to return if there are error.
|
// So we need to return if there are error.
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
i, ok := s.images[digest.String()]
|
||||||
|
if !ok {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
i.References = util.SubtractStringSlice(i.References, ref)
|
||||||
|
if len(i.References) != 0 {
|
||||||
|
s.images[digest.String()] = i
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// Remove the image if it is not referenced any more.
|
||||||
s.digestSet.Remove(digest) // nolint: errcheck
|
s.digestSet.Remove(digest) // nolint: errcheck
|
||||||
delete(s.images, digest.String())
|
delete(s.images, digest.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
// mergeStringSlices merges 2 string slices into one and remove duplicated elements.
|
|
||||||
func mergeStringSlices(a []string, b []string) []string {
|
|
||||||
set := map[string]struct{}{}
|
|
||||||
for _, s := range a {
|
|
||||||
set[s] = struct{}{}
|
|
||||||
}
|
|
||||||
for _, s := range b {
|
|
||||||
set[s] = struct{}{}
|
|
||||||
}
|
|
||||||
var ss []string
|
|
||||||
for s := range set {
|
|
||||||
ss = append(ss, s)
|
|
||||||
}
|
|
||||||
return ss
|
|
||||||
}
|
|
||||||
|
2
vendor/github.com/containerd/cri/pkg/store/sandbox/metadata.go
generated
vendored
2
vendor/github.com/containerd/cri/pkg/store/sandbox/metadata.go
generated
vendored
@ -54,6 +54,8 @@ type Metadata struct {
|
|||||||
NetNSPath string
|
NetNSPath string
|
||||||
// IP of Pod if it is attached to non host network
|
// IP of Pod if it is attached to non host network
|
||||||
IP string
|
IP string
|
||||||
|
// RuntimeHandler is the runtime handler name of the pod.
|
||||||
|
RuntimeHandler string
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalJSON encodes Metadata into bytes in json format.
|
// MarshalJSON encodes Metadata into bytes in json format.
|
||||||
|
9
vendor/github.com/containerd/cri/pkg/util/id.go
generated
vendored
9
vendor/github.com/containerd/cri/pkg/util/id.go
generated
vendored
@ -16,9 +16,14 @@ limitations under the License.
|
|||||||
|
|
||||||
package util
|
package util
|
||||||
|
|
||||||
import "github.com/docker/docker/pkg/stringid"
|
import (
|
||||||
|
"encoding/hex"
|
||||||
|
"math/rand"
|
||||||
|
)
|
||||||
|
|
||||||
// GenerateID generates a random unique id.
|
// GenerateID generates a random unique id.
|
||||||
func GenerateID() string {
|
func GenerateID() string {
|
||||||
return stringid.GenerateNonCryptoID()
|
b := make([]byte, 32)
|
||||||
|
rand.Read(b)
|
||||||
|
return hex.EncodeToString(b)
|
||||||
}
|
}
|
||||||
|
16
vendor/github.com/containerd/cri/pkg/util/strings.go
generated
vendored
16
vendor/github.com/containerd/cri/pkg/util/strings.go
generated
vendored
@ -41,3 +41,19 @@ func SubtractStringSlice(ss []string, str string) []string {
|
|||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MergeStringSlices merges 2 string slices into one and remove duplicated elements.
|
||||||
|
func MergeStringSlices(a []string, b []string) []string {
|
||||||
|
set := map[string]struct{}{}
|
||||||
|
for _, s := range a {
|
||||||
|
set[s] = struct{}{}
|
||||||
|
}
|
||||||
|
for _, s := range b {
|
||||||
|
set[s] = struct{}{}
|
||||||
|
}
|
||||||
|
var ss []string
|
||||||
|
for s := range set {
|
||||||
|
ss = append(ss, s)
|
||||||
|
}
|
||||||
|
return ss
|
||||||
|
}
|
||||||
|
49
vendor/github.com/containerd/cri/vendor.conf
generated
vendored
49
vendor/github.com/containerd/cri/vendor.conf
generated
vendored
@ -1,19 +1,19 @@
|
|||||||
github.com/beorn7/perks 4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9
|
github.com/beorn7/perks 4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9
|
||||||
github.com/blang/semver v3.1.0
|
github.com/blang/semver v3.1.0
|
||||||
github.com/boltdb/bolt e9cf4fae01b5a8ff89d0ec6b32f0d9c9f79aefdd
|
github.com/boltdb/bolt v1.3.1
|
||||||
github.com/BurntSushi/toml a368813c5e648fee92e5f6c30e3944ff9d5e8895
|
github.com/BurntSushi/toml a368813c5e648fee92e5f6c30e3944ff9d5e8895
|
||||||
github.com/containerd/cgroups 5e610833b72089b37d0e615de9a92dfc043757c2
|
github.com/containerd/cgroups 5e610833b72089b37d0e615de9a92dfc043757c2
|
||||||
github.com/containerd/console 4d8a41f4ce5b9bae77c41786ea2458330f43f081
|
github.com/containerd/console c12b1e7919c14469339a5d38f2f8ed9b64a9de23
|
||||||
github.com/containerd/containerd b9eeaa1ce83dd9970605ddbd0b35d4d3fa5f87bd
|
github.com/containerd/containerd 1950f791d9225ffe061c77e74e292bcb3c428a04
|
||||||
github.com/containerd/continuity d3c23511c1bf5851696cba83143d9cbcd666869b
|
github.com/containerd/continuity f44b615e492bdfb371aae2f76ec694d9da1db537
|
||||||
github.com/containerd/fifo 3d5202aec260678c48179c56f40e6f38a095738c
|
github.com/containerd/fifo 3d5202aec260678c48179c56f40e6f38a095738c
|
||||||
github.com/containerd/go-cni 5882530828ecf62032409b298a3e8b19e08b6534
|
github.com/containerd/go-cni 6d7b509a054a3cb1c35ed1865d4fde2f0cb547cd
|
||||||
github.com/containerd/go-runc edcf3de1f4971445c42d61f20d506b30612aa031
|
github.com/containerd/go-runc 5a6d9f37cfa36b15efba46dc7ea349fa9b7143c3
|
||||||
github.com/containerd/ttrpc 94dde388801693c54f88a6596f713b51a8b30b2d
|
github.com/containerd/ttrpc 94dde388801693c54f88a6596f713b51a8b30b2d
|
||||||
github.com/containerd/typeurl a93fcdb778cd272c6e9b3028b2f42d813e785d40
|
github.com/containerd/typeurl a93fcdb778cd272c6e9b3028b2f42d813e785d40
|
||||||
github.com/containernetworking/cni v0.6.0
|
github.com/containernetworking/cni v0.6.0
|
||||||
github.com/containernetworking/plugins v0.7.0
|
github.com/containernetworking/plugins v0.7.0
|
||||||
github.com/coreos/go-systemd 48702e0da86bd25e76cfef347e2adeb434a0d0a6
|
github.com/coreos/go-systemd v14
|
||||||
github.com/davecgh/go-spew v1.1.0
|
github.com/davecgh/go-spew v1.1.0
|
||||||
github.com/docker/distribution b38e5838b7b2f2ad48e06ec4b500011976080621
|
github.com/docker/distribution b38e5838b7b2f2ad48e06ec4b500011976080621
|
||||||
github.com/docker/docker 86f080cff0914e9694068ed78d503701667c4c00
|
github.com/docker/docker 86f080cff0914e9694068ed78d503701667c4c00
|
||||||
@ -21,29 +21,29 @@ github.com/docker/go-events 9461782956ad83b30282bf90e31fa6a70c255ba9
|
|||||||
github.com/docker/go-metrics 4ea375f7759c82740c893fc030bc37088d2ec098
|
github.com/docker/go-metrics 4ea375f7759c82740c893fc030bc37088d2ec098
|
||||||
github.com/docker/go-units v0.3.1
|
github.com/docker/go-units v0.3.1
|
||||||
github.com/docker/spdystream 449fdfce4d962303d702fec724ef0ad181c92528
|
github.com/docker/spdystream 449fdfce4d962303d702fec724ef0ad181c92528
|
||||||
github.com/emicklei/go-restful ff4f55a206334ef123e4f79bbf348980da81ca46
|
github.com/emicklei/go-restful v2.2.1
|
||||||
github.com/ghodss/yaml 73d445a93680fa1a78ae23a5839bad48f32ba1ee
|
github.com/ghodss/yaml v1.0.0
|
||||||
github.com/godbus/dbus c7fdd8b5cd55e87b4e1f4e372cdb1db61dd6c66f
|
github.com/godbus/dbus v3
|
||||||
github.com/gogo/googleapis 08a7655d27152912db7aaf4f983275eaf8d128ef
|
github.com/gogo/googleapis 08a7655d27152912db7aaf4f983275eaf8d128ef
|
||||||
github.com/gogo/protobuf v1.0.0
|
github.com/gogo/protobuf v1.0.0
|
||||||
github.com/golang/glog 44145f04b68cf362d9c4df2182967c2275eaefed
|
github.com/golang/glog 44145f04b68cf362d9c4df2182967c2275eaefed
|
||||||
github.com/golang/protobuf v1.1.0
|
github.com/golang/protobuf v1.1.0
|
||||||
github.com/google/gofuzz 44d81051d367757e1c7c6a5a86423ece9afcf63c
|
github.com/google/gofuzz 44d81051d367757e1c7c6a5a86423ece9afcf63c
|
||||||
github.com/grpc-ecosystem/go-grpc-prometheus 6b7015e65d366bf3f19b2b2a000a831940f0f7e0
|
github.com/grpc-ecosystem/go-grpc-prometheus v1.1
|
||||||
github.com/hashicorp/errwrap 7554cd9344cec97297fa6649b055a8c98c2a1e55
|
github.com/hashicorp/errwrap 7554cd9344cec97297fa6649b055a8c98c2a1e55
|
||||||
github.com/hashicorp/go-multierror ed905158d87462226a13fe39ddf685ea65f1c11f
|
github.com/hashicorp/go-multierror ed905158d87462226a13fe39ddf685ea65f1c11f
|
||||||
github.com/json-iterator/go f2b4162afba35581b6d4a50d3b8f34e33c144682
|
github.com/json-iterator/go 1.1.5
|
||||||
github.com/matttproud/golang_protobuf_extensions v1.0.0
|
github.com/matttproud/golang_protobuf_extensions v1.0.0
|
||||||
github.com/Microsoft/go-winio v0.4.7
|
github.com/Microsoft/go-winio v0.4.10
|
||||||
github.com/Microsoft/hcsshim v0.6.11
|
github.com/Microsoft/hcsshim 44c060121b68e8bdc40b411beba551f3b4ee9e55
|
||||||
github.com/modern-go/concurrent 1.0.3
|
github.com/modern-go/concurrent 1.0.3
|
||||||
github.com/modern-go/reflect2 05fbef0ca5da472bbf96c9322b84a53edc03c9fd
|
github.com/modern-go/reflect2 1.0.1
|
||||||
github.com/opencontainers/go-digest c9281466c8b2f606084ac71339773efd177436e7
|
github.com/opencontainers/go-digest c9281466c8b2f606084ac71339773efd177436e7
|
||||||
github.com/opencontainers/image-spec v1.0.1
|
github.com/opencontainers/image-spec v1.0.1
|
||||||
github.com/opencontainers/runc 69663f0bd4b60df09991c08812a60108003fa340
|
github.com/opencontainers/runc 20aff4f0488c6d4b8df4d85b4f63f1f704c11abd
|
||||||
github.com/opencontainers/runtime-spec d810dbc60d8c5aeeb3d054bd1132fab2121968ce
|
github.com/opencontainers/runtime-spec d810dbc60d8c5aeeb3d054bd1132fab2121968ce
|
||||||
github.com/opencontainers/runtime-tools v0.6.0
|
github.com/opencontainers/runtime-tools v0.6.0
|
||||||
github.com/opencontainers/selinux 4a2974bf1ee960774ffd517717f1f45325af0206
|
github.com/opencontainers/selinux b6fa367ed7f534f9ba25391cc2d467085dbb445a
|
||||||
github.com/pkg/errors v0.8.0
|
github.com/pkg/errors v0.8.0
|
||||||
github.com/pmezard/go-difflib v1.0.0
|
github.com/pmezard/go-difflib v1.0.0
|
||||||
github.com/prometheus/client_golang f4fb1b73fb099f396a7f0036bf86aa8def4ed823
|
github.com/prometheus/client_golang f4fb1b73fb099f396a7f0036bf86aa8def4ed823
|
||||||
@ -54,13 +54,14 @@ github.com/seccomp/libseccomp-golang 32f571b70023028bd57d9288c20efbcb237f3ce0
|
|||||||
github.com/sirupsen/logrus v1.0.0
|
github.com/sirupsen/logrus v1.0.0
|
||||||
github.com/stretchr/testify v1.1.4
|
github.com/stretchr/testify v1.1.4
|
||||||
github.com/syndtr/gocapability db04d3cc01c8b54962a58ec7e491717d06cfcc16
|
github.com/syndtr/gocapability db04d3cc01c8b54962a58ec7e491717d06cfcc16
|
||||||
github.com/tchap/go-patricia 5ad6cdb7538b0097d5598c7e57f0a24072adf7dc
|
github.com/tchap/go-patricia v2.2.6
|
||||||
github.com/urfave/cli 7bc6a0acffa589f415f88aca16cc1de5ffd66f9c
|
github.com/urfave/cli 7bc6a0acffa589f415f88aca16cc1de5ffd66f9c
|
||||||
github.com/xeipuuv/gojsonpointer 4e3ac2762d5f479393488629ee9370b50873b3a6
|
github.com/xeipuuv/gojsonpointer 4e3ac2762d5f479393488629ee9370b50873b3a6
|
||||||
github.com/xeipuuv/gojsonreference bd5ef7bd5415a7ac448318e64f11a24cd21e594b
|
github.com/xeipuuv/gojsonreference bd5ef7bd5415a7ac448318e64f11a24cd21e594b
|
||||||
github.com/xeipuuv/gojsonschema 1d523034197ff1f222f6429836dd36a2457a1874
|
github.com/xeipuuv/gojsonschema 1d523034197ff1f222f6429836dd36a2457a1874
|
||||||
golang.org/x/crypto 49796115aa4b964c318aad4f3084fdb41e9aa067
|
golang.org/x/crypto 49796115aa4b964c318aad4f3084fdb41e9aa067
|
||||||
golang.org/x/net b3756b4b77d7b13260a0a2ec658753cf48922eac
|
golang.org/x/net b3756b4b77d7b13260a0a2ec658753cf48922eac
|
||||||
|
golang.org/x/oauth2 a6bd8cefa1811bd24b86f8902872e4e8225f74c4
|
||||||
golang.org/x/sync 450f422ab23cf9881c94e2db30cac0eb1b7cf80c
|
golang.org/x/sync 450f422ab23cf9881c94e2db30cac0eb1b7cf80c
|
||||||
golang.org/x/sys 1b2967e3c290b7c545b3db0deeda16e9be4f98a2 https://github.com/golang/sys
|
golang.org/x/sys 1b2967e3c290b7c545b3db0deeda16e9be4f98a2 https://github.com/golang/sys
|
||||||
golang.org/x/text 19e51611da83d6be54ddafce4a4af510cb3e9ea4
|
golang.org/x/text 19e51611da83d6be54ddafce4a4af510cb3e9ea4
|
||||||
@ -69,9 +70,9 @@ google.golang.org/genproto d80a6e20e776b0b17a324d0ba1ab50a39c8e8944
|
|||||||
google.golang.org/grpc v1.12.0
|
google.golang.org/grpc v1.12.0
|
||||||
gopkg.in/inf.v0 3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4
|
gopkg.in/inf.v0 3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4
|
||||||
gopkg.in/yaml.v2 53feefa2559fb8dfa8d81baad31be332c97d6c77
|
gopkg.in/yaml.v2 53feefa2559fb8dfa8d81baad31be332c97d6c77
|
||||||
k8s.io/api 9e5ffd1f1320950b238cfce291b926411f0af722
|
k8s.io/api 012f271b5d41baad56190c5f1ae19bff16df0fd8
|
||||||
k8s.io/apimachinery ed135c5b96450fd24e5e981c708114fbbd950697
|
k8s.io/apimachinery 6429050ef506887d121f3e7306e894f8900d8a63
|
||||||
k8s.io/apiserver a90e3a95c2e91b944bfca8225c4e0d12e42a9eb5
|
k8s.io/apiserver e9312c15296b6c2c923ebd5031ff5d1d5fd022d7
|
||||||
k8s.io/client-go 03bfb9bdcfe5482795b999f39ca3ed9ad42ce5bb
|
k8s.io/client-go 37c3c02ec96533daec0dbda1f39a6b1d68505c79
|
||||||
k8s.io/kubernetes v1.11.0
|
k8s.io/kubernetes v1.12.0-beta.1
|
||||||
k8s.io/utils 733eca437aa39379e4bcc25e726439dfca40fcff
|
k8s.io/utils 982821ea41da7e7c15f3d3738921eb2e7e241ccd
|
||||||
|
33
vendor/github.com/containerd/go-cni/opts.go
generated
vendored
33
vendor/github.com/containerd/go-cni/opts.go
generated
vendored
@ -136,19 +136,37 @@ func WithConfListFile(fileName string) CNIOpt {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
i := len(c.networks)
|
||||||
c.networks = append(c.networks, &Network{
|
c.networks = append(c.networks, &Network{
|
||||||
cni: c.cniConfig,
|
cni: c.cniConfig,
|
||||||
config: confList,
|
config: confList,
|
||||||
ifName: getIfName(c.prefix, 0),
|
ifName: getIfName(c.prefix, i),
|
||||||
})
|
})
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithDefaultConf can be used to detect network config
|
// WithDefaultConf can be used to detect the default network
|
||||||
|
// config file from the configured cni config directory and load
|
||||||
|
// it.
|
||||||
|
// Since the CNI spec does not specify a way to detect default networks,
|
||||||
|
// the convention chosen is - the first network configuration in the sorted
|
||||||
|
// list of network conf files as the default network.
|
||||||
|
func WithDefaultConf(c *libcni) error {
|
||||||
|
return loadFromConfDir(c, 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithAllConf can be used to detect all network config
|
||||||
// files from the configured cni config directory and load
|
// files from the configured cni config directory and load
|
||||||
// them.
|
// them.
|
||||||
func WithDefaultConf(c *libcni) error {
|
func WithAllConf(c *libcni) error {
|
||||||
|
return loadFromConfDir(c, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
// loadFromConfDir detects network config files from the
|
||||||
|
// configured cni config directory and load them. max is
|
||||||
|
// the maximum network config to load (max i<= 0 means no limit).
|
||||||
|
func loadFromConfDir(c *libcni, max int) error {
|
||||||
files, err := cnilibrary.ConfFiles(c.pluginConfDir, []string{".conf", ".conflist", ".json"})
|
files, err := cnilibrary.ConfFiles(c.pluginConfDir, []string{".conf", ".conflist", ".json"})
|
||||||
switch {
|
switch {
|
||||||
case err != nil:
|
case err != nil:
|
||||||
@ -166,6 +184,7 @@ func WithDefaultConf(c *libcni) error {
|
|||||||
// interface provided during init as the network interface for this default
|
// interface provided during init as the network interface for this default
|
||||||
// network. For every other network use a generated interface id.
|
// network. For every other network use a generated interface id.
|
||||||
i := 0
|
i := 0
|
||||||
|
var networks []*Network
|
||||||
for _, confFile := range files {
|
for _, confFile := range files {
|
||||||
var confList *cnilibrary.NetworkConfigList
|
var confList *cnilibrary.NetworkConfigList
|
||||||
if strings.HasSuffix(confFile, ".conflist") {
|
if strings.HasSuffix(confFile, ".conflist") {
|
||||||
@ -193,15 +212,19 @@ func WithDefaultConf(c *libcni) error {
|
|||||||
return errors.Wrapf(ErrInvalidConfig, "CNI config list %s has no networks, skipping", confFile)
|
return errors.Wrapf(ErrInvalidConfig, "CNI config list %s has no networks, skipping", confFile)
|
||||||
|
|
||||||
}
|
}
|
||||||
c.networks = append(c.networks, &Network{
|
networks = append(networks, &Network{
|
||||||
cni: c.cniConfig,
|
cni: c.cniConfig,
|
||||||
config: confList,
|
config: confList,
|
||||||
ifName: getIfName(c.prefix, i),
|
ifName: getIfName(c.prefix, i),
|
||||||
})
|
})
|
||||||
i++
|
i++
|
||||||
|
if i == max {
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if len(c.networks) == 0 {
|
if len(networks) == 0 {
|
||||||
return errors.Wrapf(ErrCNINotInitialized, "no valid networks found in %s", c.pluginDirs)
|
return errors.Wrapf(ErrCNINotInitialized, "no valid networks found in %s", c.pluginDirs)
|
||||||
}
|
}
|
||||||
|
c.networks = append(c.networks, networks...)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
1
vendor/github.com/docker/docker/pkg/stringid/README.md
generated
vendored
1
vendor/github.com/docker/docker/pkg/stringid/README.md
generated
vendored
@ -1 +0,0 @@
|
|||||||
This package provides helper functions for dealing with string identifiers
|
|
99
vendor/github.com/docker/docker/pkg/stringid/stringid.go
generated
vendored
99
vendor/github.com/docker/docker/pkg/stringid/stringid.go
generated
vendored
@ -1,99 +0,0 @@
|
|||||||
// Package stringid provides helper functions for dealing with string identifiers
|
|
||||||
package stringid
|
|
||||||
|
|
||||||
import (
|
|
||||||
cryptorand "crypto/rand"
|
|
||||||
"encoding/hex"
|
|
||||||
"fmt"
|
|
||||||
"io"
|
|
||||||
"math"
|
|
||||||
"math/big"
|
|
||||||
"math/rand"
|
|
||||||
"regexp"
|
|
||||||
"strconv"
|
|
||||||
"strings"
|
|
||||||
"time"
|
|
||||||
)
|
|
||||||
|
|
||||||
const shortLen = 12
|
|
||||||
|
|
||||||
var (
|
|
||||||
validShortID = regexp.MustCompile("^[a-f0-9]{12}$")
|
|
||||||
validHex = regexp.MustCompile(`^[a-f0-9]{64}$`)
|
|
||||||
)
|
|
||||||
|
|
||||||
// IsShortID determines if an arbitrary string *looks like* a short ID.
|
|
||||||
func IsShortID(id string) bool {
|
|
||||||
return validShortID.MatchString(id)
|
|
||||||
}
|
|
||||||
|
|
||||||
// TruncateID returns a shorthand version of a string identifier for convenience.
|
|
||||||
// A collision with other shorthands is very unlikely, but possible.
|
|
||||||
// In case of a collision a lookup with TruncIndex.Get() will fail, and the caller
|
|
||||||
// will need to use a longer prefix, or the full-length Id.
|
|
||||||
func TruncateID(id string) string {
|
|
||||||
if i := strings.IndexRune(id, ':'); i >= 0 {
|
|
||||||
id = id[i+1:]
|
|
||||||
}
|
|
||||||
if len(id) > shortLen {
|
|
||||||
id = id[:shortLen]
|
|
||||||
}
|
|
||||||
return id
|
|
||||||
}
|
|
||||||
|
|
||||||
func generateID(r io.Reader) string {
|
|
||||||
b := make([]byte, 32)
|
|
||||||
for {
|
|
||||||
if _, err := io.ReadFull(r, b); err != nil {
|
|
||||||
panic(err) // This shouldn't happen
|
|
||||||
}
|
|
||||||
id := hex.EncodeToString(b)
|
|
||||||
// if we try to parse the truncated for as an int and we don't have
|
|
||||||
// an error then the value is all numeric and causes issues when
|
|
||||||
// used as a hostname. ref #3869
|
|
||||||
if _, err := strconv.ParseInt(TruncateID(id), 10, 64); err == nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
return id
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// GenerateRandomID returns a unique id.
|
|
||||||
func GenerateRandomID() string {
|
|
||||||
return generateID(cryptorand.Reader)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GenerateNonCryptoID generates unique id without using cryptographically
|
|
||||||
// secure sources of random.
|
|
||||||
// It helps you to save entropy.
|
|
||||||
func GenerateNonCryptoID() string {
|
|
||||||
return generateID(readerFunc(rand.Read))
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateID checks whether an ID string is a valid image ID.
|
|
||||||
func ValidateID(id string) error {
|
|
||||||
if ok := validHex.MatchString(id); !ok {
|
|
||||||
return fmt.Errorf("image ID %q is invalid", id)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
// safely set the seed globally so we generate random ids. Tries to use a
|
|
||||||
// crypto seed before falling back to time.
|
|
||||||
var seed int64
|
|
||||||
if cryptoseed, err := cryptorand.Int(cryptorand.Reader, big.NewInt(math.MaxInt64)); err != nil {
|
|
||||||
// This should not happen, but worst-case fallback to time-based seed.
|
|
||||||
seed = time.Now().UnixNano()
|
|
||||||
} else {
|
|
||||||
seed = cryptoseed.Int64()
|
|
||||||
}
|
|
||||||
|
|
||||||
rand.Seed(seed)
|
|
||||||
}
|
|
||||||
|
|
||||||
type readerFunc func(p []byte) (int, error)
|
|
||||||
|
|
||||||
func (fn readerFunc) Read(p []byte) (int, error) {
|
|
||||||
return fn(p)
|
|
||||||
}
|
|
3
vendor/github.com/emicklei/go-restful/README.md
generated
vendored
3
vendor/github.com/emicklei/go-restful/README.md
generated
vendored
@ -67,8 +67,9 @@ func (u UserResource) findUser(request *restful.Request, response *restful.Respo
|
|||||||
- [Example posted on blog](http://ernestmicklei.com/2012/11/go-restful-first-working-example/)
|
- [Example posted on blog](http://ernestmicklei.com/2012/11/go-restful-first-working-example/)
|
||||||
- [Design explained on blog](http://ernestmicklei.com/2012/11/go-restful-api-design/)
|
- [Design explained on blog](http://ernestmicklei.com/2012/11/go-restful-api-design/)
|
||||||
- [sourcegraph](https://sourcegraph.com/github.com/emicklei/go-restful)
|
- [sourcegraph](https://sourcegraph.com/github.com/emicklei/go-restful)
|
||||||
|
- [showcase: Zazkia - tcp proxy for testing resiliency](https://github.com/emicklei/zazkia)
|
||||||
- [showcase: Mora - MongoDB REST Api server](https://github.com/emicklei/mora)
|
- [showcase: Mora - MongoDB REST Api server](https://github.com/emicklei/mora)
|
||||||
|
|
||||||
Type ```git shortlog -s``` for a full list of contributors.
|
Type ```git shortlog -s``` for a full list of contributors.
|
||||||
|
|
||||||
© 2012 - 2017, http://ernestmicklei.com. MIT License. Contributions are welcome.
|
© 2012 - 2017, http://ernestmicklei.com. MIT License. Contributions are welcome.
|
||||||
|
8
vendor/github.com/emicklei/go-restful/compressors.go
generated
vendored
8
vendor/github.com/emicklei/go-restful/compressors.go
generated
vendored
@ -15,20 +15,20 @@ type CompressorProvider interface {
|
|||||||
// Before using it, call Reset().
|
// Before using it, call Reset().
|
||||||
AcquireGzipWriter() *gzip.Writer
|
AcquireGzipWriter() *gzip.Writer
|
||||||
|
|
||||||
// Releases an aqcuired *gzip.Writer.
|
// Releases an acquired *gzip.Writer.
|
||||||
ReleaseGzipWriter(w *gzip.Writer)
|
ReleaseGzipWriter(w *gzip.Writer)
|
||||||
|
|
||||||
// Returns a *gzip.Reader which needs to be released later.
|
// Returns a *gzip.Reader which needs to be released later.
|
||||||
AcquireGzipReader() *gzip.Reader
|
AcquireGzipReader() *gzip.Reader
|
||||||
|
|
||||||
// Releases an aqcuired *gzip.Reader.
|
// Releases an acquired *gzip.Reader.
|
||||||
ReleaseGzipReader(w *gzip.Reader)
|
ReleaseGzipReader(w *gzip.Reader)
|
||||||
|
|
||||||
// Returns a *zlib.Writer which needs to be released later.
|
// Returns a *zlib.Writer which needs to be released later.
|
||||||
// Before using it, call Reset().
|
// Before using it, call Reset().
|
||||||
AcquireZlibWriter() *zlib.Writer
|
AcquireZlibWriter() *zlib.Writer
|
||||||
|
|
||||||
// Releases an aqcuired *zlib.Writer.
|
// Releases an acquired *zlib.Writer.
|
||||||
ReleaseZlibWriter(w *zlib.Writer)
|
ReleaseZlibWriter(w *zlib.Writer)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ func CurrentCompressorProvider() CompressorProvider {
|
|||||||
return currentCompressorProvider
|
return currentCompressorProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
// CompressorProvider sets the actual provider of compressors (zlib or gzip).
|
// SetCompressorProvider sets the actual provider of compressors (zlib or gzip).
|
||||||
func SetCompressorProvider(p CompressorProvider) {
|
func SetCompressorProvider(p CompressorProvider) {
|
||||||
if p == nil {
|
if p == nil {
|
||||||
panic("cannot set compressor provider to nil")
|
panic("cannot set compressor provider to nil")
|
||||||
|
2
vendor/github.com/emicklei/go-restful/container.go
generated
vendored
2
vendor/github.com/emicklei/go-restful/container.go
generated
vendored
@ -140,7 +140,7 @@ func (c *Container) addHandler(service *WebService, serveMux *http.ServeMux) boo
|
|||||||
func (c *Container) Remove(ws *WebService) error {
|
func (c *Container) Remove(ws *WebService) error {
|
||||||
if c.ServeMux == http.DefaultServeMux {
|
if c.ServeMux == http.DefaultServeMux {
|
||||||
errMsg := fmt.Sprintf("[restful] cannot remove a WebService from a Container using the DefaultServeMux: ['%v']", ws)
|
errMsg := fmt.Sprintf("[restful] cannot remove a WebService from a Container using the DefaultServeMux: ['%v']", ws)
|
||||||
log.Printf(errMsg)
|
log.Print(errMsg)
|
||||||
return errors.New(errMsg)
|
return errors.New(errMsg)
|
||||||
}
|
}
|
||||||
c.webServicesLock.Lock()
|
c.webServicesLock.Lock()
|
||||||
|
2
vendor/github.com/emicklei/go-restful/logger.go
generated
vendored
2
vendor/github.com/emicklei/go-restful/logger.go
generated
vendored
@ -21,7 +21,7 @@ func TraceLogger(logger log.StdLogger) {
|
|||||||
EnableTracing(logger != nil)
|
EnableTracing(logger != nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
// expose the setter for the global logger on the top-level package
|
// SetLogger exposes the setter for the global logger on the top-level package
|
||||||
func SetLogger(customLogger log.StdLogger) {
|
func SetLogger(customLogger log.StdLogger) {
|
||||||
log.SetLogger(customLogger)
|
log.SetLogger(customLogger)
|
||||||
}
|
}
|
||||||
|
2
vendor/github.com/emicklei/go-restful/response.go
generated
vendored
2
vendor/github.com/emicklei/go-restful/response.go
generated
vendored
@ -21,7 +21,7 @@ type Response struct {
|
|||||||
http.ResponseWriter
|
http.ResponseWriter
|
||||||
requestAccept string // mime-type what the Http Request says it wants to receive
|
requestAccept string // mime-type what the Http Request says it wants to receive
|
||||||
routeProduces []string // mime-types what the Route says it can produce
|
routeProduces []string // mime-types what the Route says it can produce
|
||||||
statusCode int // HTTP status code that has been written explicity (if zero then net/http has written 200)
|
statusCode int // HTTP status code that has been written explicitly (if zero then net/http has written 200)
|
||||||
contentLength int // number of bytes written for the response body
|
contentLength int // number of bytes written for the response body
|
||||||
prettyPrint bool // controls the indentation feature of XML and JSON serialization. It is initialized using var PrettyPrintResponses.
|
prettyPrint bool // controls the indentation feature of XML and JSON serialization. It is initialized using var PrettyPrintResponses.
|
||||||
err error // err property is kept when WriteError is called
|
err error // err property is kept when WriteError is called
|
||||||
|
2
vendor/github.com/emicklei/go-restful/route.go
generated
vendored
2
vendor/github.com/emicklei/go-restful/route.go
generated
vendored
@ -100,7 +100,7 @@ func (r Route) matchesContentType(mimeTypes string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(mimeTypes) == 0 {
|
if len(mimeTypes) == 0 {
|
||||||
// idempotent methods with (most-likely or garanteed) empty content match missing Content-Type
|
// idempotent methods with (most-likely or guaranteed) empty content match missing Content-Type
|
||||||
m := r.Method
|
m := r.Method
|
||||||
if m == "GET" || m == "HEAD" || m == "OPTIONS" || m == "DELETE" || m == "TRACE" {
|
if m == "GET" || m == "HEAD" || m == "OPTIONS" || m == "DELETE" || m == "TRACE" {
|
||||||
return true
|
return true
|
||||||
|
2
vendor/github.com/emicklei/go-restful/route_builder.go
generated
vendored
2
vendor/github.com/emicklei/go-restful/route_builder.go
generated
vendored
@ -89,7 +89,7 @@ func (b *RouteBuilder) Doc(documentation string) *RouteBuilder {
|
|||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// A verbose explanation of the operation behavior. Optional.
|
// Notes is a verbose explanation of the operation behavior. Optional.
|
||||||
func (b *RouteBuilder) Notes(notes string) *RouteBuilder {
|
func (b *RouteBuilder) Notes(notes string) *RouteBuilder {
|
||||||
b.notes = notes
|
b.notes = notes
|
||||||
return b
|
return b
|
||||||
|
2
vendor/github.com/emicklei/go-restful/web_service.go
generated
vendored
2
vendor/github.com/emicklei/go-restful/web_service.go
generated
vendored
@ -233,7 +233,7 @@ func (w *WebService) RootPath() string {
|
|||||||
return w.rootPath
|
return w.rootPath
|
||||||
}
|
}
|
||||||
|
|
||||||
// PathParameters return the path parameter names for (shared amoung its Routes)
|
// PathParameters return the path parameter names for (shared among its Routes)
|
||||||
func (w *WebService) PathParameters() []*Parameter {
|
func (w *WebService) PathParameters() []*Parameter {
|
||||||
return w.pathParameters
|
return w.pathParameters
|
||||||
}
|
}
|
||||||
|
17
vendor/github.com/ghodss/yaml/README.md
generated
vendored
17
vendor/github.com/ghodss/yaml/README.md
generated
vendored
@ -4,13 +4,13 @@
|
|||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
A wrapper around [go-yaml](https://github.com/go-yaml/yaml) designed to enable a better way of handling YAML when marshaling to and from structs.
|
A wrapper around [go-yaml](https://github.com/go-yaml/yaml) designed to enable a better way of handling YAML when marshaling to and from structs.
|
||||||
|
|
||||||
In short, this library first converts YAML to JSON using go-yaml and then uses `json.Marshal` and `json.Unmarshal` to convert to or from the struct. This means that it effectively reuses the JSON struct tags as well as the custom JSON methods `MarshalJSON` and `UnmarshalJSON` unlike go-yaml. For a detailed overview of the rationale behind this method, [see this blog post](http://ghodss.com/2014/the-right-way-to-handle-yaml-in-golang/).
|
In short, this library first converts YAML to JSON using go-yaml and then uses `json.Marshal` and `json.Unmarshal` to convert to or from the struct. This means that it effectively reuses the JSON struct tags as well as the custom JSON methods `MarshalJSON` and `UnmarshalJSON` unlike go-yaml. For a detailed overview of the rationale behind this method, [see this blog post](http://ghodss.com/2014/the-right-way-to-handle-yaml-in-golang/).
|
||||||
|
|
||||||
## Compatibility
|
## Compatibility
|
||||||
|
|
||||||
This package uses [go-yaml v2](https://github.com/go-yaml/yaml) and therefore supports [everything go-yaml supports](https://github.com/go-yaml/yaml#compatibility).
|
This package uses [go-yaml](https://github.com/go-yaml/yaml) and therefore supports [everything go-yaml supports](https://github.com/go-yaml/yaml#compatibility).
|
||||||
|
|
||||||
## Caveats
|
## Caveats
|
||||||
|
|
||||||
@ -44,6 +44,8 @@ import "github.com/ghodss/yaml"
|
|||||||
Usage is very similar to the JSON library:
|
Usage is very similar to the JSON library:
|
||||||
|
|
||||||
```go
|
```go
|
||||||
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
@ -51,8 +53,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Person struct {
|
type Person struct {
|
||||||
Name string `json:"name"` // Affects YAML field names too.
|
Name string `json:"name"` // Affects YAML field names too.
|
||||||
Age int `json:"name"`
|
Age int `json:"age"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@ -65,13 +67,13 @@ func main() {
|
|||||||
}
|
}
|
||||||
fmt.Println(string(y))
|
fmt.Println(string(y))
|
||||||
/* Output:
|
/* Output:
|
||||||
name: John
|
|
||||||
age: 30
|
age: 30
|
||||||
|
name: John
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Unmarshal the YAML back into a Person struct.
|
// Unmarshal the YAML back into a Person struct.
|
||||||
var p2 Person
|
var p2 Person
|
||||||
err := yaml.Unmarshal(y, &p2)
|
err = yaml.Unmarshal(y, &p2)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("err: %v\n", err)
|
fmt.Printf("err: %v\n", err)
|
||||||
return
|
return
|
||||||
@ -86,11 +88,14 @@ func main() {
|
|||||||
`yaml.YAMLToJSON` and `yaml.JSONToYAML` methods are also available:
|
`yaml.YAMLToJSON` and `yaml.JSONToYAML` methods are also available:
|
||||||
|
|
||||||
```go
|
```go
|
||||||
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/ghodss/yaml"
|
"github.com/ghodss/yaml"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
j := []byte(`{"name": "John", "age": 30}`)
|
j := []byte(`{"name": "John", "age": 30}`)
|
||||||
y, err := yaml.JSONToYAML(j)
|
y, err := yaml.JSONToYAML(j)
|
||||||
|
6
vendor/github.com/ghodss/yaml/fields.go
generated
vendored
6
vendor/github.com/ghodss/yaml/fields.go
generated
vendored
@ -45,7 +45,11 @@ func indirect(v reflect.Value, decodingNull bool) (json.Unmarshaler, encoding.Te
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
if v.IsNil() {
|
if v.IsNil() {
|
||||||
v.Set(reflect.New(v.Type().Elem()))
|
if v.CanSet() {
|
||||||
|
v.Set(reflect.New(v.Type().Elem()))
|
||||||
|
} else {
|
||||||
|
v = reflect.New(v.Type().Elem())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if v.Type().NumMethod() > 0 {
|
if v.Type().NumMethod() > 0 {
|
||||||
if u, ok := v.Interface().(json.Unmarshaler); ok {
|
if u, ok := v.Interface().(json.Unmarshaler); ok {
|
||||||
|
6
vendor/github.com/ghodss/yaml/yaml.go
generated
vendored
6
vendor/github.com/ghodss/yaml/yaml.go
generated
vendored
@ -15,12 +15,12 @@ import (
|
|||||||
func Marshal(o interface{}) ([]byte, error) {
|
func Marshal(o interface{}) ([]byte, error) {
|
||||||
j, err := json.Marshal(o)
|
j, err := json.Marshal(o)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error marshaling into JSON: ", err)
|
return nil, fmt.Errorf("error marshaling into JSON: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
y, err := JSONToYAML(j)
|
y, err := JSONToYAML(j)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error converting JSON to YAML: ", err)
|
return nil, fmt.Errorf("error converting JSON to YAML: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return y, nil
|
return y, nil
|
||||||
@ -48,7 +48,7 @@ func JSONToYAML(j []byte) ([]byte, error) {
|
|||||||
var jsonObj interface{}
|
var jsonObj interface{}
|
||||||
// We are using yaml.Unmarshal here (instead of json.Unmarshal) because the
|
// We are using yaml.Unmarshal here (instead of json.Unmarshal) because the
|
||||||
// Go JSON library doesn't try to pick the right number type (int, float,
|
// Go JSON library doesn't try to pick the right number type (int, float,
|
||||||
// etc.) when unmarshling to interface{}, it just picks float64
|
// etc.) when unmarshalling to interface{}, it just picks float64
|
||||||
// universally. go-yaml does go through the effort of picking the right
|
// universally. go-yaml does go through the effort of picking the right
|
||||||
// number type, so we can preserve number type throughout this process.
|
// number type, so we can preserve number type throughout this process.
|
||||||
err := yaml.Unmarshal(j, &jsonObj)
|
err := yaml.Unmarshal(j, &jsonObj)
|
||||||
|
16
vendor/github.com/json-iterator/go/adapter.go
generated
vendored
16
vendor/github.com/json-iterator/go/adapter.go
generated
vendored
@ -81,10 +81,12 @@ func (adapter *Decoder) More() bool {
|
|||||||
if iter.Error != nil {
|
if iter.Error != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if iter.head != iter.tail {
|
c := iter.nextToken()
|
||||||
return true
|
if c == 0 {
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
return iter.loadMore()
|
iter.unreadByte()
|
||||||
|
return c != ']' && c != '}'
|
||||||
}
|
}
|
||||||
|
|
||||||
// Buffered remaining buffer
|
// Buffered remaining buffer
|
||||||
@ -98,7 +100,7 @@ func (adapter *Decoder) Buffered() io.Reader {
|
|||||||
func (adapter *Decoder) UseNumber() {
|
func (adapter *Decoder) UseNumber() {
|
||||||
cfg := adapter.iter.cfg.configBeforeFrozen
|
cfg := adapter.iter.cfg.configBeforeFrozen
|
||||||
cfg.UseNumber = true
|
cfg.UseNumber = true
|
||||||
adapter.iter.cfg = cfg.frozeWithCacheReuse()
|
adapter.iter.cfg = cfg.frozeWithCacheReuse(adapter.iter.cfg.extraExtensions)
|
||||||
}
|
}
|
||||||
|
|
||||||
// DisallowUnknownFields causes the Decoder to return an error when the destination
|
// DisallowUnknownFields causes the Decoder to return an error when the destination
|
||||||
@ -107,7 +109,7 @@ func (adapter *Decoder) UseNumber() {
|
|||||||
func (adapter *Decoder) DisallowUnknownFields() {
|
func (adapter *Decoder) DisallowUnknownFields() {
|
||||||
cfg := adapter.iter.cfg.configBeforeFrozen
|
cfg := adapter.iter.cfg.configBeforeFrozen
|
||||||
cfg.DisallowUnknownFields = true
|
cfg.DisallowUnknownFields = true
|
||||||
adapter.iter.cfg = cfg.frozeWithCacheReuse()
|
adapter.iter.cfg = cfg.frozeWithCacheReuse(adapter.iter.cfg.extraExtensions)
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewEncoder same as json.NewEncoder
|
// NewEncoder same as json.NewEncoder
|
||||||
@ -132,14 +134,14 @@ func (adapter *Encoder) Encode(val interface{}) error {
|
|||||||
func (adapter *Encoder) SetIndent(prefix, indent string) {
|
func (adapter *Encoder) SetIndent(prefix, indent string) {
|
||||||
config := adapter.stream.cfg.configBeforeFrozen
|
config := adapter.stream.cfg.configBeforeFrozen
|
||||||
config.IndentionStep = len(indent)
|
config.IndentionStep = len(indent)
|
||||||
adapter.stream.cfg = config.frozeWithCacheReuse()
|
adapter.stream.cfg = config.frozeWithCacheReuse(adapter.stream.cfg.extraExtensions)
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetEscapeHTML escape html by default, set to false to disable
|
// SetEscapeHTML escape html by default, set to false to disable
|
||||||
func (adapter *Encoder) SetEscapeHTML(escapeHTML bool) {
|
func (adapter *Encoder) SetEscapeHTML(escapeHTML bool) {
|
||||||
config := adapter.stream.cfg.configBeforeFrozen
|
config := adapter.stream.cfg.configBeforeFrozen
|
||||||
config.EscapeHTML = escapeHTML
|
config.EscapeHTML = escapeHTML
|
||||||
adapter.stream.cfg = config.frozeWithCacheReuse()
|
adapter.stream.cfg = config.frozeWithCacheReuse(adapter.stream.cfg.extraExtensions)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Valid reports whether data is a valid JSON encoding.
|
// Valid reports whether data is a valid JSON encoding.
|
||||||
|
25
vendor/github.com/json-iterator/go/config.go
generated
vendored
25
vendor/github.com/json-iterator/go/config.go
generated
vendored
@ -74,7 +74,9 @@ type frozenConfig struct {
|
|||||||
disallowUnknownFields bool
|
disallowUnknownFields bool
|
||||||
decoderCache *concurrent.Map
|
decoderCache *concurrent.Map
|
||||||
encoderCache *concurrent.Map
|
encoderCache *concurrent.Map
|
||||||
extensions []Extension
|
encoderExtension Extension
|
||||||
|
decoderExtension Extension
|
||||||
|
extraExtensions []Extension
|
||||||
streamPool *sync.Pool
|
streamPool *sync.Pool
|
||||||
iteratorPool *sync.Pool
|
iteratorPool *sync.Pool
|
||||||
caseSensitive bool
|
caseSensitive bool
|
||||||
@ -158,22 +160,21 @@ func (cfg Config) Froze() API {
|
|||||||
if cfg.ValidateJsonRawMessage {
|
if cfg.ValidateJsonRawMessage {
|
||||||
api.validateJsonRawMessage(encoderExtension)
|
api.validateJsonRawMessage(encoderExtension)
|
||||||
}
|
}
|
||||||
if len(encoderExtension) > 0 {
|
api.encoderExtension = encoderExtension
|
||||||
api.extensions = append(api.extensions, encoderExtension)
|
api.decoderExtension = decoderExtension
|
||||||
}
|
|
||||||
if len(decoderExtension) > 0 {
|
|
||||||
api.extensions = append(api.extensions, decoderExtension)
|
|
||||||
}
|
|
||||||
api.configBeforeFrozen = cfg
|
api.configBeforeFrozen = cfg
|
||||||
return api
|
return api
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cfg Config) frozeWithCacheReuse() *frozenConfig {
|
func (cfg Config) frozeWithCacheReuse(extraExtensions []Extension) *frozenConfig {
|
||||||
api := getFrozenConfigFromCache(cfg)
|
api := getFrozenConfigFromCache(cfg)
|
||||||
if api != nil {
|
if api != nil {
|
||||||
return api
|
return api
|
||||||
}
|
}
|
||||||
api = cfg.Froze().(*frozenConfig)
|
api = cfg.Froze().(*frozenConfig)
|
||||||
|
for _, extension := range extraExtensions {
|
||||||
|
api.RegisterExtension(extension)
|
||||||
|
}
|
||||||
addFrozenConfigToCache(cfg, api)
|
addFrozenConfigToCache(cfg, api)
|
||||||
return api
|
return api
|
||||||
}
|
}
|
||||||
@ -190,7 +191,7 @@ func (cfg *frozenConfig) validateJsonRawMessage(extension EncoderExtension) {
|
|||||||
stream.WriteRaw(string(rawMessage))
|
stream.WriteRaw(string(rawMessage))
|
||||||
}
|
}
|
||||||
}, func(ptr unsafe.Pointer) bool {
|
}, func(ptr unsafe.Pointer) bool {
|
||||||
return false
|
return len(*((*json.RawMessage)(ptr))) == 0
|
||||||
}}
|
}}
|
||||||
extension[reflect2.TypeOfPtr((*json.RawMessage)(nil)).Elem()] = encoder
|
extension[reflect2.TypeOfPtr((*json.RawMessage)(nil)).Elem()] = encoder
|
||||||
extension[reflect2.TypeOfPtr((*RawMessage)(nil)).Elem()] = encoder
|
extension[reflect2.TypeOfPtr((*RawMessage)(nil)).Elem()] = encoder
|
||||||
@ -219,7 +220,9 @@ func (cfg *frozenConfig) getTagKey() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (cfg *frozenConfig) RegisterExtension(extension Extension) {
|
func (cfg *frozenConfig) RegisterExtension(extension Extension) {
|
||||||
cfg.extensions = append(cfg.extensions, extension)
|
cfg.extraExtensions = append(cfg.extraExtensions, extension)
|
||||||
|
copied := cfg.configBeforeFrozen
|
||||||
|
cfg.configBeforeFrozen = copied
|
||||||
}
|
}
|
||||||
|
|
||||||
type lossyFloat32Encoder struct {
|
type lossyFloat32Encoder struct {
|
||||||
@ -314,7 +317,7 @@ func (cfg *frozenConfig) MarshalIndent(v interface{}, prefix, indent string) ([]
|
|||||||
}
|
}
|
||||||
newCfg := cfg.configBeforeFrozen
|
newCfg := cfg.configBeforeFrozen
|
||||||
newCfg.IndentionStep = len(indent)
|
newCfg.IndentionStep = len(indent)
|
||||||
return newCfg.frozeWithCacheReuse().Marshal(v)
|
return newCfg.frozeWithCacheReuse(cfg.extraExtensions).Marshal(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cfg *frozenConfig) UnmarshalFromString(str string, v interface{}) error {
|
func (cfg *frozenConfig) UnmarshalFromString(str string, v interface{}) error {
|
||||||
|
13
vendor/github.com/json-iterator/go/iter_object.go
generated
vendored
13
vendor/github.com/json-iterator/go/iter_object.go
generated
vendored
@ -2,7 +2,7 @@ package jsoniter
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"unicode"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ReadObject read one field from object.
|
// ReadObject read one field from object.
|
||||||
@ -96,13 +96,12 @@ func (iter *Iterator) readFieldHash() int64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func calcHash(str string, caseSensitive bool) int64 {
|
func calcHash(str string, caseSensitive bool) int64 {
|
||||||
|
if !caseSensitive {
|
||||||
|
str = strings.ToLower(str)
|
||||||
|
}
|
||||||
hash := int64(0x811c9dc5)
|
hash := int64(0x811c9dc5)
|
||||||
for _, b := range str {
|
for _, b := range []byte(str) {
|
||||||
if caseSensitive {
|
hash ^= int64(b)
|
||||||
hash ^= int64(b)
|
|
||||||
} else {
|
|
||||||
hash ^= int64(unicode.ToLower(b))
|
|
||||||
}
|
|
||||||
hash *= 0x1000193
|
hash *= 0x1000193
|
||||||
}
|
}
|
||||||
return int64(hash)
|
return int64(hash)
|
||||||
|
6
vendor/github.com/json-iterator/go/reflect.go
generated
vendored
6
vendor/github.com/json-iterator/go/reflect.go
generated
vendored
@ -120,7 +120,8 @@ func decoderOfType(ctx *ctx, typ reflect2.Type) ValDecoder {
|
|||||||
for _, extension := range extensions {
|
for _, extension := range extensions {
|
||||||
decoder = extension.DecorateDecoder(typ, decoder)
|
decoder = extension.DecorateDecoder(typ, decoder)
|
||||||
}
|
}
|
||||||
for _, extension := range ctx.extensions {
|
decoder = ctx.decoderExtension.DecorateDecoder(typ, decoder)
|
||||||
|
for _, extension := range ctx.extraExtensions {
|
||||||
decoder = extension.DecorateDecoder(typ, decoder)
|
decoder = extension.DecorateDecoder(typ, decoder)
|
||||||
}
|
}
|
||||||
return decoder
|
return decoder
|
||||||
@ -222,7 +223,8 @@ func encoderOfType(ctx *ctx, typ reflect2.Type) ValEncoder {
|
|||||||
for _, extension := range extensions {
|
for _, extension := range extensions {
|
||||||
encoder = extension.DecorateEncoder(typ, encoder)
|
encoder = extension.DecorateEncoder(typ, encoder)
|
||||||
}
|
}
|
||||||
for _, extension := range ctx.extensions {
|
encoder = ctx.encoderExtension.DecorateEncoder(typ, encoder)
|
||||||
|
for _, extension := range ctx.extraExtensions {
|
||||||
encoder = extension.DecorateEncoder(typ, encoder)
|
encoder = extension.DecorateEncoder(typ, encoder)
|
||||||
}
|
}
|
||||||
return encoder
|
return encoder
|
||||||
|
26
vendor/github.com/json-iterator/go/reflect_extension.go
generated
vendored
26
vendor/github.com/json-iterator/go/reflect_extension.go
generated
vendored
@ -246,7 +246,8 @@ func getTypeDecoderFromExtension(ctx *ctx, typ reflect2.Type) ValDecoder {
|
|||||||
for _, extension := range extensions {
|
for _, extension := range extensions {
|
||||||
decoder = extension.DecorateDecoder(typ, decoder)
|
decoder = extension.DecorateDecoder(typ, decoder)
|
||||||
}
|
}
|
||||||
for _, extension := range ctx.extensions {
|
decoder = ctx.decoderExtension.DecorateDecoder(typ, decoder)
|
||||||
|
for _, extension := range ctx.extraExtensions {
|
||||||
decoder = extension.DecorateDecoder(typ, decoder)
|
decoder = extension.DecorateDecoder(typ, decoder)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -259,14 +260,18 @@ func _getTypeDecoderFromExtension(ctx *ctx, typ reflect2.Type) ValDecoder {
|
|||||||
return decoder
|
return decoder
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, extension := range ctx.extensions {
|
decoder := ctx.decoderExtension.CreateDecoder(typ)
|
||||||
|
if decoder != nil {
|
||||||
|
return decoder
|
||||||
|
}
|
||||||
|
for _, extension := range ctx.extraExtensions {
|
||||||
decoder := extension.CreateDecoder(typ)
|
decoder := extension.CreateDecoder(typ)
|
||||||
if decoder != nil {
|
if decoder != nil {
|
||||||
return decoder
|
return decoder
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
typeName := typ.String()
|
typeName := typ.String()
|
||||||
decoder := typeDecoders[typeName]
|
decoder = typeDecoders[typeName]
|
||||||
if decoder != nil {
|
if decoder != nil {
|
||||||
return decoder
|
return decoder
|
||||||
}
|
}
|
||||||
@ -286,7 +291,8 @@ func getTypeEncoderFromExtension(ctx *ctx, typ reflect2.Type) ValEncoder {
|
|||||||
for _, extension := range extensions {
|
for _, extension := range extensions {
|
||||||
encoder = extension.DecorateEncoder(typ, encoder)
|
encoder = extension.DecorateEncoder(typ, encoder)
|
||||||
}
|
}
|
||||||
for _, extension := range ctx.extensions {
|
encoder = ctx.encoderExtension.DecorateEncoder(typ, encoder)
|
||||||
|
for _, extension := range ctx.extraExtensions {
|
||||||
encoder = extension.DecorateEncoder(typ, encoder)
|
encoder = extension.DecorateEncoder(typ, encoder)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -300,14 +306,18 @@ func _getTypeEncoderFromExtension(ctx *ctx, typ reflect2.Type) ValEncoder {
|
|||||||
return encoder
|
return encoder
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, extension := range ctx.extensions {
|
encoder := ctx.encoderExtension.CreateEncoder(typ)
|
||||||
|
if encoder != nil {
|
||||||
|
return encoder
|
||||||
|
}
|
||||||
|
for _, extension := range ctx.extraExtensions {
|
||||||
encoder := extension.CreateEncoder(typ)
|
encoder := extension.CreateEncoder(typ)
|
||||||
if encoder != nil {
|
if encoder != nil {
|
||||||
return encoder
|
return encoder
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
typeName := typ.String()
|
typeName := typ.String()
|
||||||
encoder := typeEncoders[typeName]
|
encoder = typeEncoders[typeName]
|
||||||
if encoder != nil {
|
if encoder != nil {
|
||||||
return encoder
|
return encoder
|
||||||
}
|
}
|
||||||
@ -393,7 +403,9 @@ func createStructDescriptor(ctx *ctx, typ reflect2.Type, bindings []*Binding, em
|
|||||||
for _, extension := range extensions {
|
for _, extension := range extensions {
|
||||||
extension.UpdateStructDescriptor(structDescriptor)
|
extension.UpdateStructDescriptor(structDescriptor)
|
||||||
}
|
}
|
||||||
for _, extension := range ctx.extensions {
|
ctx.encoderExtension.UpdateStructDescriptor(structDescriptor)
|
||||||
|
ctx.decoderExtension.UpdateStructDescriptor(structDescriptor)
|
||||||
|
for _, extension := range ctx.extraExtensions {
|
||||||
extension.UpdateStructDescriptor(structDescriptor)
|
extension.UpdateStructDescriptor(structDescriptor)
|
||||||
}
|
}
|
||||||
processTags(structDescriptor, ctx.frozenConfig)
|
processTags(structDescriptor, ctx.frozenConfig)
|
||||||
|
12
vendor/github.com/json-iterator/go/reflect_map.go
generated
vendored
12
vendor/github.com/json-iterator/go/reflect_map.go
generated
vendored
@ -39,7 +39,11 @@ func encoderOfMap(ctx *ctx, typ reflect2.Type) ValEncoder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func decoderOfMapKey(ctx *ctx, typ reflect2.Type) ValDecoder {
|
func decoderOfMapKey(ctx *ctx, typ reflect2.Type) ValDecoder {
|
||||||
for _, extension := range ctx.extensions {
|
decoder := ctx.decoderExtension.CreateMapKeyDecoder(typ)
|
||||||
|
if decoder != nil {
|
||||||
|
return decoder
|
||||||
|
}
|
||||||
|
for _, extension := range ctx.extraExtensions {
|
||||||
decoder := extension.CreateMapKeyDecoder(typ)
|
decoder := extension.CreateMapKeyDecoder(typ)
|
||||||
if decoder != nil {
|
if decoder != nil {
|
||||||
return decoder
|
return decoder
|
||||||
@ -77,7 +81,11 @@ func decoderOfMapKey(ctx *ctx, typ reflect2.Type) ValDecoder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func encoderOfMapKey(ctx *ctx, typ reflect2.Type) ValEncoder {
|
func encoderOfMapKey(ctx *ctx, typ reflect2.Type) ValEncoder {
|
||||||
for _, extension := range ctx.extensions {
|
encoder := ctx.encoderExtension.CreateMapKeyEncoder(typ)
|
||||||
|
if encoder != nil {
|
||||||
|
return encoder
|
||||||
|
}
|
||||||
|
for _, extension := range ctx.extraExtensions {
|
||||||
encoder := extension.CreateMapKeyEncoder(typ)
|
encoder := extension.CreateMapKeyEncoder(typ)
|
||||||
if encoder != nil {
|
if encoder != nil {
|
||||||
return encoder
|
return encoder
|
||||||
|
3
vendor/github.com/modern-go/reflect2/reflect2.go
generated
vendored
3
vendor/github.com/modern-go/reflect2/reflect2.go
generated
vendored
@ -150,6 +150,9 @@ func (cfg *frozenConfig) TypeOf(obj interface{}) Type {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (cfg *frozenConfig) Type2(type1 reflect.Type) Type {
|
func (cfg *frozenConfig) Type2(type1 reflect.Type) Type {
|
||||||
|
if type1 == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
cacheKey := uintptr(unpackEFace(type1).data)
|
cacheKey := uintptr(unpackEFace(type1).data)
|
||||||
typeObj, found := cfg.cache.Load(cacheKey)
|
typeObj, found := cfg.cache.Load(cacheKey)
|
||||||
if found {
|
if found {
|
||||||
|
7
vendor/github.com/opencontainers/selinux/go-selinux/label/label_selinux.go
generated
vendored
7
vendor/github.com/opencontainers/selinux/go-selinux/label/label_selinux.go
generated
vendored
@ -49,8 +49,10 @@ func InitLabels(options []string) (string, string, error) {
|
|||||||
mcon[con[0]] = con[1]
|
mcon[con[0]] = con[1]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
_ = ReleaseLabel(processLabel)
|
||||||
processLabel = pcon.Get()
|
processLabel = pcon.Get()
|
||||||
mountLabel = mcon.Get()
|
mountLabel = mcon.Get()
|
||||||
|
_ = ReserveLabel(processLabel)
|
||||||
}
|
}
|
||||||
return processLabel, mountLabel, nil
|
return processLabel, mountLabel, nil
|
||||||
}
|
}
|
||||||
@ -85,9 +87,6 @@ func FormatMountLabel(src, mountLabel string) string {
|
|||||||
// SetProcessLabel takes a process label and tells the kernel to assign the
|
// SetProcessLabel takes a process label and tells the kernel to assign the
|
||||||
// label to the next program executed by the current process.
|
// label to the next program executed by the current process.
|
||||||
func SetProcessLabel(processLabel string) error {
|
func SetProcessLabel(processLabel string) error {
|
||||||
if processLabel == "" {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
return selinux.SetExecLabel(processLabel)
|
return selinux.SetExecLabel(processLabel)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,7 +130,7 @@ func Relabel(path string, fileLabel string, shared bool) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
exclude_paths := map[string]bool{"/": true, "/usr": true, "/etc": true}
|
exclude_paths := map[string]bool{"/": true, "/usr": true, "/etc": true, "/tmp": true, "/home": true, "/run": true, "/var": true, "/root": true}
|
||||||
if exclude_paths[path] {
|
if exclude_paths[path] {
|
||||||
return fmt.Errorf("SELinux relabeling of %s is not allowed", path)
|
return fmt.Errorf("SELinux relabeling of %s is not allowed", path)
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
// +build linux
|
// +build selinux,linux
|
||||||
|
|
||||||
package selinux
|
package selinux
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
|
"bytes"
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
@ -23,14 +26,16 @@ const (
|
|||||||
// Permissive constant to indicate SELinux is in permissive mode
|
// Permissive constant to indicate SELinux is in permissive mode
|
||||||
Permissive = 0
|
Permissive = 0
|
||||||
// Disabled constant to indicate SELinux is disabled
|
// Disabled constant to indicate SELinux is disabled
|
||||||
Disabled = -1
|
Disabled = -1
|
||||||
|
|
||||||
selinuxDir = "/etc/selinux/"
|
selinuxDir = "/etc/selinux/"
|
||||||
selinuxConfig = selinuxDir + "config"
|
selinuxConfig = selinuxDir + "config"
|
||||||
|
selinuxfsMount = "/sys/fs/selinux"
|
||||||
selinuxTypeTag = "SELINUXTYPE"
|
selinuxTypeTag = "SELINUXTYPE"
|
||||||
selinuxTag = "SELINUX"
|
selinuxTag = "SELINUX"
|
||||||
selinuxPath = "/sys/fs/selinux"
|
|
||||||
xattrNameSelinux = "security.selinux"
|
xattrNameSelinux = "security.selinux"
|
||||||
stRdOnly = 0x01
|
stRdOnly = 0x01
|
||||||
|
selinuxfsMagic = 0xf97cff8c
|
||||||
)
|
)
|
||||||
|
|
||||||
type selinuxState struct {
|
type selinuxState struct {
|
||||||
@ -43,7 +48,13 @@ type selinuxState struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
// ErrMCSAlreadyExists is returned when trying to allocate a duplicate MCS.
|
||||||
|
ErrMCSAlreadyExists = errors.New("MCS label already exists")
|
||||||
|
// ErrEmptyPath is returned when an empty path has been specified.
|
||||||
|
ErrEmptyPath = errors.New("empty path")
|
||||||
|
|
||||||
assignRegex = regexp.MustCompile(`^([^=]+)=(.*)$`)
|
assignRegex = regexp.MustCompile(`^([^=]+)=(.*)$`)
|
||||||
|
roFileLabel string
|
||||||
state = selinuxState{
|
state = selinuxState{
|
||||||
mcsList: make(map[string]bool),
|
mcsList: make(map[string]bool),
|
||||||
}
|
}
|
||||||
@ -91,6 +102,83 @@ func (s *selinuxState) setSELinuxfs(selinuxfs string) string {
|
|||||||
return s.selinuxfs
|
return s.selinuxfs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func verifySELinuxfsMount(mnt string) bool {
|
||||||
|
var buf syscall.Statfs_t
|
||||||
|
for {
|
||||||
|
err := syscall.Statfs(mnt, &buf)
|
||||||
|
if err == nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if err == syscall.EAGAIN {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if uint32(buf.Type) != uint32(selinuxfsMagic) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (buf.Flags & stRdOnly) != 0 {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func findSELinuxfs() string {
|
||||||
|
// fast path: check the default mount first
|
||||||
|
if verifySELinuxfsMount(selinuxfsMount) {
|
||||||
|
return selinuxfsMount
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if selinuxfs is available before going the slow path
|
||||||
|
fs, err := ioutil.ReadFile("/proc/filesystems")
|
||||||
|
if err != nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
if !bytes.Contains(fs, []byte("\tselinuxfs\n")) {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
// slow path: try to find among the mounts
|
||||||
|
f, err := os.Open("/proc/self/mountinfo")
|
||||||
|
if err != nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
defer f.Close()
|
||||||
|
|
||||||
|
scanner := bufio.NewScanner(f)
|
||||||
|
for {
|
||||||
|
mnt := findSELinuxfsMount(scanner)
|
||||||
|
if mnt == "" { // error or not found
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
if verifySELinuxfsMount(mnt) {
|
||||||
|
return mnt
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// findSELinuxfsMount returns a next selinuxfs mount point found,
|
||||||
|
// if there is one, or an empty string in case of EOF or error.
|
||||||
|
func findSELinuxfsMount(s *bufio.Scanner) string {
|
||||||
|
for s.Scan() {
|
||||||
|
txt := s.Text()
|
||||||
|
// The first field after - is fs type.
|
||||||
|
// Safe as spaces in mountpoints are encoded as \040
|
||||||
|
if !strings.Contains(txt, " - selinuxfs ") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
const mPos = 5 // mount point is 5th field
|
||||||
|
fields := strings.SplitN(txt, " ", mPos+1)
|
||||||
|
if len(fields) < mPos+1 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
return fields[mPos-1]
|
||||||
|
}
|
||||||
|
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
func (s *selinuxState) getSELinuxfs() string {
|
func (s *selinuxState) getSELinuxfs() string {
|
||||||
s.Lock()
|
s.Lock()
|
||||||
selinuxfs := s.selinuxfs
|
selinuxfs := s.selinuxfs
|
||||||
@ -100,40 +188,7 @@ func (s *selinuxState) getSELinuxfs() string {
|
|||||||
return selinuxfs
|
return selinuxfs
|
||||||
}
|
}
|
||||||
|
|
||||||
selinuxfs = ""
|
return s.setSELinuxfs(findSELinuxfs())
|
||||||
f, err := os.Open("/proc/self/mountinfo")
|
|
||||||
if err != nil {
|
|
||||||
return selinuxfs
|
|
||||||
}
|
|
||||||
defer f.Close()
|
|
||||||
|
|
||||||
scanner := bufio.NewScanner(f)
|
|
||||||
for scanner.Scan() {
|
|
||||||
txt := scanner.Text()
|
|
||||||
// Safe as mountinfo encodes mountpoints with spaces as \040.
|
|
||||||
sepIdx := strings.Index(txt, " - ")
|
|
||||||
if sepIdx == -1 {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if !strings.Contains(txt[sepIdx:], "selinuxfs") {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
fields := strings.Split(txt, " ")
|
|
||||||
if len(fields) < 5 {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
selinuxfs = fields[4]
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
if selinuxfs != "" {
|
|
||||||
var buf syscall.Statfs_t
|
|
||||||
syscall.Statfs(selinuxfs, &buf)
|
|
||||||
if (buf.Flags & stRdOnly) == 1 {
|
|
||||||
selinuxfs = ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return s.setSELinuxfs(selinuxfs)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// getSelinuxMountPoint returns the path to the mountpoint of an selinuxfs
|
// getSelinuxMountPoint returns the path to the mountpoint of an selinuxfs
|
||||||
@ -150,7 +205,7 @@ func GetEnabled() bool {
|
|||||||
return state.getEnabled()
|
return state.getEnabled()
|
||||||
}
|
}
|
||||||
|
|
||||||
func readConfig(target string) (value string) {
|
func readConfig(target string) string {
|
||||||
var (
|
var (
|
||||||
val, key string
|
val, key string
|
||||||
bufin *bufio.Reader
|
bufin *bufio.Reader
|
||||||
@ -192,30 +247,42 @@ func readConfig(target string) (value string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getSELinuxPolicyRoot() string {
|
func getSELinuxPolicyRoot() string {
|
||||||
return selinuxDir + readConfig(selinuxTypeTag)
|
return filepath.Join(selinuxDir, readConfig(selinuxTypeTag))
|
||||||
}
|
}
|
||||||
|
|
||||||
func readCon(name string) (string, error) {
|
func readCon(fpath string) (string, error) {
|
||||||
var val string
|
if fpath == "" {
|
||||||
|
return "", ErrEmptyPath
|
||||||
|
}
|
||||||
|
|
||||||
in, err := os.Open(name)
|
in, err := os.Open(fpath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
defer in.Close()
|
defer in.Close()
|
||||||
|
|
||||||
_, err = fmt.Fscanf(in, "%s", &val)
|
var retval string
|
||||||
return val, err
|
if _, err := fmt.Fscanf(in, "%s", &retval); err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
return strings.Trim(retval, "\x00"), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetFileLabel sets the SELinux label for this path or returns an error.
|
// SetFileLabel sets the SELinux label for this path or returns an error.
|
||||||
func SetFileLabel(path string, label string) error {
|
func SetFileLabel(fpath string, label string) error {
|
||||||
return lsetxattr(path, xattrNameSelinux, []byte(label), 0)
|
if fpath == "" {
|
||||||
|
return ErrEmptyPath
|
||||||
|
}
|
||||||
|
return lsetxattr(fpath, xattrNameSelinux, []byte(label), 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FileLabel returns the SELinux label for this path or returns an error.
|
// FileLabel returns the SELinux label for this path or returns an error.
|
||||||
func FileLabel(path string) (string, error) {
|
func FileLabel(fpath string) (string, error) {
|
||||||
label, err := lgetxattr(path, xattrNameSelinux)
|
if fpath == "" {
|
||||||
|
return "", ErrEmptyPath
|
||||||
|
}
|
||||||
|
|
||||||
|
label, err := lgetxattr(fpath, xattrNameSelinux)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
@ -260,8 +327,12 @@ func ExecLabel() (string, error) {
|
|||||||
return readCon(fmt.Sprintf("/proc/self/task/%d/attr/exec", syscall.Gettid()))
|
return readCon(fmt.Sprintf("/proc/self/task/%d/attr/exec", syscall.Gettid()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func writeCon(name string, val string) error {
|
func writeCon(fpath string, val string) error {
|
||||||
out, err := os.OpenFile(name, os.O_WRONLY, 0)
|
if fpath == "" {
|
||||||
|
return ErrEmptyPath
|
||||||
|
}
|
||||||
|
|
||||||
|
out, err := os.OpenFile(fpath, os.O_WRONLY, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -275,6 +346,37 @@ func writeCon(name string, val string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
CanonicalizeContext takes a context string and writes it to the kernel
|
||||||
|
the function then returns the context that the kernel will use. This function
|
||||||
|
can be used to see if two contexts are equivalent
|
||||||
|
*/
|
||||||
|
func CanonicalizeContext(val string) (string, error) {
|
||||||
|
return readWriteCon(filepath.Join(getSelinuxMountPoint(), "context"), val)
|
||||||
|
}
|
||||||
|
|
||||||
|
func readWriteCon(fpath string, val string) (string, error) {
|
||||||
|
if fpath == "" {
|
||||||
|
return "", ErrEmptyPath
|
||||||
|
}
|
||||||
|
f, err := os.OpenFile(fpath, os.O_RDWR, 0)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
defer f.Close()
|
||||||
|
|
||||||
|
_, err = f.Write([]byte(val))
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
var retval string
|
||||||
|
if _, err := fmt.Fscanf(f, "%s", &retval); err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
return strings.Trim(retval, "\x00"), nil
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
SetExecLabel sets the SELinux label that the kernel will use for any programs
|
SetExecLabel sets the SELinux label that the kernel will use for any programs
|
||||||
that are executed by the current process thread, or an error.
|
that are executed by the current process thread, or an error.
|
||||||
@ -285,7 +387,10 @@ func SetExecLabel(label string) error {
|
|||||||
|
|
||||||
// Get returns the Context as a string
|
// Get returns the Context as a string
|
||||||
func (c Context) Get() string {
|
func (c Context) Get() string {
|
||||||
return fmt.Sprintf("%s:%s:%s:%s", c["user"], c["role"], c["type"], c["level"])
|
if c["level"] != "" {
|
||||||
|
return fmt.Sprintf("%s:%s:%s:%s", c["user"], c["role"], c["type"], c["level"])
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("%s:%s:%s", c["user"], c["role"], c["type"])
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewContext creates a new Context struct from the specified label
|
// NewContext creates a new Context struct from the specified label
|
||||||
@ -297,7 +402,9 @@ func NewContext(label string) Context {
|
|||||||
c["user"] = con[0]
|
c["user"] = con[0]
|
||||||
c["role"] = con[1]
|
c["role"] = con[1]
|
||||||
c["type"] = con[2]
|
c["type"] = con[2]
|
||||||
c["level"] = con[3]
|
if len(con) > 3 {
|
||||||
|
c["level"] = con[3]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
@ -306,12 +413,14 @@ func NewContext(label string) Context {
|
|||||||
func ReserveLabel(label string) {
|
func ReserveLabel(label string) {
|
||||||
if len(label) != 0 {
|
if len(label) != 0 {
|
||||||
con := strings.SplitN(label, ":", 4)
|
con := strings.SplitN(label, ":", 4)
|
||||||
mcsAdd(con[3])
|
if len(con) > 3 {
|
||||||
|
mcsAdd(con[3])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func selinuxEnforcePath() string {
|
func selinuxEnforcePath() string {
|
||||||
return fmt.Sprintf("%s/enforce", selinuxPath)
|
return fmt.Sprintf("%s/enforce", getSelinuxMountPoint())
|
||||||
}
|
}
|
||||||
|
|
||||||
// EnforceMode returns the current SELinux mode Enforcing, Permissive, Disabled
|
// EnforceMode returns the current SELinux mode Enforcing, Permissive, Disabled
|
||||||
@ -354,16 +463,22 @@ func DefaultEnforceMode() int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func mcsAdd(mcs string) error {
|
func mcsAdd(mcs string) error {
|
||||||
|
if mcs == "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
state.Lock()
|
state.Lock()
|
||||||
defer state.Unlock()
|
defer state.Unlock()
|
||||||
if state.mcsList[mcs] {
|
if state.mcsList[mcs] {
|
||||||
return fmt.Errorf("MCS Label already exists")
|
return ErrMCSAlreadyExists
|
||||||
}
|
}
|
||||||
state.mcsList[mcs] = true
|
state.mcsList[mcs] = true
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func mcsDelete(mcs string) {
|
func mcsDelete(mcs string) {
|
||||||
|
if mcs == "" {
|
||||||
|
return
|
||||||
|
}
|
||||||
state.Lock()
|
state.Lock()
|
||||||
defer state.Unlock()
|
defer state.Unlock()
|
||||||
state.mcsList[mcs] = false
|
state.mcsList[mcs] = false
|
||||||
@ -424,14 +539,14 @@ Allowing it to be used by another process.
|
|||||||
func ReleaseLabel(label string) {
|
func ReleaseLabel(label string) {
|
||||||
if len(label) != 0 {
|
if len(label) != 0 {
|
||||||
con := strings.SplitN(label, ":", 4)
|
con := strings.SplitN(label, ":", 4)
|
||||||
mcsDelete(con[3])
|
if len(con) > 3 {
|
||||||
|
mcsDelete(con[3])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var roFileLabel string
|
|
||||||
|
|
||||||
// ROFileLabel returns the specified SELinux readonly file label
|
// ROFileLabel returns the specified SELinux readonly file label
|
||||||
func ROFileLabel() (fileLabel string) {
|
func ROFileLabel() string {
|
||||||
return roFileLabel
|
return roFileLabel
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -497,23 +612,25 @@ func ContainerLabels() (processLabel string, fileLabel string) {
|
|||||||
roFileLabel = fileLabel
|
roFileLabel = fileLabel
|
||||||
}
|
}
|
||||||
exit:
|
exit:
|
||||||
mcs := uniqMcs(1024)
|
|
||||||
scon := NewContext(processLabel)
|
scon := NewContext(processLabel)
|
||||||
scon["level"] = mcs
|
if scon["level"] != "" {
|
||||||
processLabel = scon.Get()
|
mcs := uniqMcs(1024)
|
||||||
scon = NewContext(fileLabel)
|
scon["level"] = mcs
|
||||||
scon["level"] = mcs
|
processLabel = scon.Get()
|
||||||
fileLabel = scon.Get()
|
scon = NewContext(fileLabel)
|
||||||
|
scon["level"] = mcs
|
||||||
|
fileLabel = scon.Get()
|
||||||
|
}
|
||||||
return processLabel, fileLabel
|
return processLabel, fileLabel
|
||||||
}
|
}
|
||||||
|
|
||||||
// SecurityCheckContext validates that the SELinux label is understood by the kernel
|
// SecurityCheckContext validates that the SELinux label is understood by the kernel
|
||||||
func SecurityCheckContext(val string) error {
|
func SecurityCheckContext(val string) error {
|
||||||
return writeCon(fmt.Sprintf("%s.context", selinuxPath), val)
|
return writeCon(fmt.Sprintf("%s/context", getSelinuxMountPoint()), val)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
CopyLevel returns a label with the MLS/MCS level from src label replaces on
|
CopyLevel returns a label with the MLS/MCS level from src label replaced on
|
||||||
the dest label.
|
the dest label.
|
||||||
*/
|
*/
|
||||||
func CopyLevel(src, dest string) (string, error) {
|
func CopyLevel(src, dest string) (string, error) {
|
||||||
@ -536,20 +653,26 @@ func CopyLevel(src, dest string) (string, error) {
|
|||||||
|
|
||||||
// Prevent users from relabing system files
|
// Prevent users from relabing system files
|
||||||
func badPrefix(fpath string) error {
|
func badPrefix(fpath string) error {
|
||||||
var badprefixes = []string{"/usr"}
|
if fpath == "" {
|
||||||
|
return ErrEmptyPath
|
||||||
|
}
|
||||||
|
|
||||||
for _, prefix := range badprefixes {
|
badPrefixes := []string{"/usr"}
|
||||||
if fpath == prefix || strings.HasPrefix(fpath, fmt.Sprintf("%s/", prefix)) {
|
for _, prefix := range badPrefixes {
|
||||||
|
if strings.HasPrefix(fpath, prefix) {
|
||||||
return fmt.Errorf("relabeling content in %s is not allowed", prefix)
|
return fmt.Errorf("relabeling content in %s is not allowed", prefix)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Chcon changes the fpath file object to the SELinux label label.
|
// Chcon changes the `fpath` file object to the SELinux label `label`.
|
||||||
// If the fpath is a directory and recurse is true Chcon will walk the
|
// If `fpath` is a directory and `recurse`` is true, Chcon will walk the
|
||||||
// directory tree setting the label
|
// directory tree setting the label.
|
||||||
func Chcon(fpath string, label string, recurse bool) error {
|
func Chcon(fpath string, label string, recurse bool) error {
|
||||||
|
if fpath == "" {
|
||||||
|
return ErrEmptyPath
|
||||||
|
}
|
||||||
if label == "" {
|
if label == "" {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -568,7 +691,7 @@ func Chcon(fpath string, label string, recurse bool) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// DupSecOpt takes an SELinux process label and returns security options that
|
// DupSecOpt takes an SELinux process label and returns security options that
|
||||||
// can will set the SELinux Type and Level for future container processes
|
// can be used to set the SELinux Type and Level for future container processes.
|
||||||
func DupSecOpt(src string) []string {
|
func DupSecOpt(src string) []string {
|
||||||
if src == "" {
|
if src == "" {
|
||||||
return nil
|
return nil
|
||||||
@ -576,18 +699,23 @@ func DupSecOpt(src string) []string {
|
|||||||
con := NewContext(src)
|
con := NewContext(src)
|
||||||
if con["user"] == "" ||
|
if con["user"] == "" ||
|
||||||
con["role"] == "" ||
|
con["role"] == "" ||
|
||||||
con["type"] == "" ||
|
con["type"] == "" {
|
||||||
con["level"] == "" {
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return []string{"user:" + con["user"],
|
dup := []string{"user:" + con["user"],
|
||||||
"role:" + con["role"],
|
"role:" + con["role"],
|
||||||
"type:" + con["type"],
|
"type:" + con["type"],
|
||||||
"level:" + con["level"]}
|
}
|
||||||
|
|
||||||
|
if con["level"] != "" {
|
||||||
|
dup = append(dup, "level:"+con["level"])
|
||||||
|
}
|
||||||
|
|
||||||
|
return dup
|
||||||
}
|
}
|
||||||
|
|
||||||
// DisableSecOpt returns a security opt that can be used to disabling SELinux
|
// DisableSecOpt returns a security opt that can be used to disable SELinux
|
||||||
// labeling support for future container processes
|
// labeling support for future container processes.
|
||||||
func DisableSecOpt() []string {
|
func DisableSecOpt() []string {
|
||||||
return []string{"disable"}
|
return []string{"disable"}
|
||||||
}
|
}
|
188
vendor/github.com/opencontainers/selinux/go-selinux/selinux_stub.go
generated
vendored
Normal file
188
vendor/github.com/opencontainers/selinux/go-selinux/selinux_stub.go
generated
vendored
Normal file
@ -0,0 +1,188 @@
|
|||||||
|
// +build !selinux
|
||||||
|
|
||||||
|
package selinux
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
// Enforcing constant indicate SELinux is in enforcing mode
|
||||||
|
Enforcing = 1
|
||||||
|
// Permissive constant to indicate SELinux is in permissive mode
|
||||||
|
Permissive = 0
|
||||||
|
// Disabled constant to indicate SELinux is disabled
|
||||||
|
Disabled = -1
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
// ErrMCSAlreadyExists is returned when trying to allocate a duplicate MCS.
|
||||||
|
ErrMCSAlreadyExists = errors.New("MCS label already exists")
|
||||||
|
// ErrEmptyPath is returned when an empty path has been specified.
|
||||||
|
ErrEmptyPath = errors.New("empty path")
|
||||||
|
)
|
||||||
|
|
||||||
|
// Context is a representation of the SELinux label broken into 4 parts
|
||||||
|
type Context map[string]string
|
||||||
|
|
||||||
|
// SetDisabled disables selinux support for the package
|
||||||
|
func SetDisabled() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetEnabled returns whether selinux is currently enabled.
|
||||||
|
func GetEnabled() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetFileLabel sets the SELinux label for this path or returns an error.
|
||||||
|
func SetFileLabel(fpath string, label string) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// FileLabel returns the SELinux label for this path or returns an error.
|
||||||
|
func FileLabel(fpath string) (string, error) {
|
||||||
|
return "", nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
SetFSCreateLabel tells kernel the label to create all file system objects
|
||||||
|
created by this task. Setting label="" to return to default.
|
||||||
|
*/
|
||||||
|
func SetFSCreateLabel(label string) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
FSCreateLabel returns the default label the kernel which the kernel is using
|
||||||
|
for file system objects created by this task. "" indicates default.
|
||||||
|
*/
|
||||||
|
func FSCreateLabel() (string, error) {
|
||||||
|
return "", nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// CurrentLabel returns the SELinux label of the current process thread, or an error.
|
||||||
|
func CurrentLabel() (string, error) {
|
||||||
|
return "", nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// PidLabel returns the SELinux label of the given pid, or an error.
|
||||||
|
func PidLabel(pid int) (string, error) {
|
||||||
|
return "", nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ExecLabel returns the SELinux label that the kernel will use for any programs
|
||||||
|
that are executed by the current process thread, or an error.
|
||||||
|
*/
|
||||||
|
func ExecLabel() (string, error) {
|
||||||
|
return "", nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
CanonicalizeContext takes a context string and writes it to the kernel
|
||||||
|
the function then returns the context that the kernel will use. This function
|
||||||
|
can be used to see if two contexts are equivalent
|
||||||
|
*/
|
||||||
|
func CanonicalizeContext(val string) (string, error) {
|
||||||
|
return "", nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
SetExecLabel sets the SELinux label that the kernel will use for any programs
|
||||||
|
that are executed by the current process thread, or an error.
|
||||||
|
*/
|
||||||
|
func SetExecLabel(label string) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get returns the Context as a string
|
||||||
|
func (c Context) Get() string {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewContext creates a new Context struct from the specified label
|
||||||
|
func NewContext(label string) Context {
|
||||||
|
c := make(Context)
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReserveLabel reserves the MLS/MCS level component of the specified label
|
||||||
|
func ReserveLabel(label string) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// EnforceMode returns the current SELinux mode Enforcing, Permissive, Disabled
|
||||||
|
func EnforceMode() int {
|
||||||
|
return Disabled
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
SetEnforceMode sets the current SELinux mode Enforcing, Permissive.
|
||||||
|
Disabled is not valid, since this needs to be set at boot time.
|
||||||
|
*/
|
||||||
|
func SetEnforceMode(mode int) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
DefaultEnforceMode returns the systems default SELinux mode Enforcing,
|
||||||
|
Permissive or Disabled. Note this is is just the default at boot time.
|
||||||
|
EnforceMode tells you the systems current mode.
|
||||||
|
*/
|
||||||
|
func DefaultEnforceMode() int {
|
||||||
|
return Disabled
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ReleaseLabel will unreserve the MLS/MCS Level field of the specified label.
|
||||||
|
Allowing it to be used by another process.
|
||||||
|
*/
|
||||||
|
func ReleaseLabel(label string) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// ROFileLabel returns the specified SELinux readonly file label
|
||||||
|
func ROFileLabel() string {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ContainerLabels returns an allocated processLabel and fileLabel to be used for
|
||||||
|
container labeling by the calling process.
|
||||||
|
*/
|
||||||
|
func ContainerLabels() (processLabel string, fileLabel string) {
|
||||||
|
return "", ""
|
||||||
|
}
|
||||||
|
|
||||||
|
// SecurityCheckContext validates that the SELinux label is understood by the kernel
|
||||||
|
func SecurityCheckContext(val string) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
CopyLevel returns a label with the MLS/MCS level from src label replaced on
|
||||||
|
the dest label.
|
||||||
|
*/
|
||||||
|
func CopyLevel(src, dest string) (string, error) {
|
||||||
|
return "", nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Chcon changes the `fpath` file object to the SELinux label `label`.
|
||||||
|
// If `fpath` is a directory and `recurse`` is true, Chcon will walk the
|
||||||
|
// directory tree setting the label.
|
||||||
|
func Chcon(fpath string, label string, recurse bool) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// DupSecOpt takes an SELinux process label and returns security options that
|
||||||
|
// can be used to set the SELinux Type and Level for future container processes.
|
||||||
|
func DupSecOpt(src string) []string {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// DisableSecOpt returns a security opt that can be used to disable SELinux
|
||||||
|
// labeling support for future container processes.
|
||||||
|
func DisableSecOpt() []string {
|
||||||
|
return []string{"disable"}
|
||||||
|
}
|
2
vendor/github.com/opencontainers/selinux/go-selinux/xattrs.go
generated
vendored
2
vendor/github.com/opencontainers/selinux/go-selinux/xattrs.go
generated
vendored
@ -1,4 +1,4 @@
|
|||||||
// +build linux
|
// +build selinux,linux
|
||||||
|
|
||||||
package selinux
|
package selinux
|
||||||
|
|
||||||
|
6
vendor/github.com/tchap/go-patricia/README.md
generated
vendored
6
vendor/github.com/tchap/go-patricia/README.md
generated
vendored
@ -1,6 +1,8 @@
|
|||||||
# go-patricia #
|
# go-patricia #
|
||||||
|
|
||||||
**Documentation**: [GoDoc](http://godoc.org/github.com/tchap/go-patricia/patricia)<br />
|
**Documentation**: [GoDoc](http://godoc.org/github.com/tchap/go-patricia/patricia)<br />
|
||||||
|
**Build Status**: [](https://drone.io/github.com/tchap/go-patricia/latest)<br />
|
||||||
**Test Coverage**: [](https://coveralls.io/r/tchap/go-patricia)
|
Status](https://coveralls.io/repos/tchap/go-patricia/badge.png)](https://coveralls.io/r/tchap/go-patricia)
|
||||||
|
|
||||||
@ -115,3 +117,7 @@ MIT, check the `LICENSE` file.
|
|||||||
[](https://www.gittip.com/tchap/
|
Badge](http://img.shields.io/gittip/alanhamlett.png)](https://www.gittip.com/tchap/
|
||||||
"Gittip Badge")
|
"Gittip Badge")
|
||||||
|
|
||||||
|
[](https://bitdeli.com/free
|
||||||
|
"Bitdeli Badge")
|
||||||
|
27
vendor/golang.org/x/oauth2/LICENSE
generated
vendored
Normal file
27
vendor/golang.org/x/oauth2/LICENSE
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
Copyright (c) 2009 The oauth2 Authors. All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are
|
||||||
|
met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the following disclaimer
|
||||||
|
in the documentation and/or other materials provided with the
|
||||||
|
distribution.
|
||||||
|
* Neither the name of Google Inc. nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived from
|
||||||
|
this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
74
vendor/golang.org/x/oauth2/README.md
generated
vendored
Normal file
74
vendor/golang.org/x/oauth2/README.md
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
# OAuth2 for Go
|
||||||
|
|
||||||
|
[](https://travis-ci.org/golang/oauth2)
|
||||||
|
[](https://godoc.org/golang.org/x/oauth2)
|
||||||
|
|
||||||
|
oauth2 package contains a client implementation for OAuth 2.0 spec.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
~~~~
|
||||||
|
go get golang.org/x/oauth2
|
||||||
|
~~~~
|
||||||
|
|
||||||
|
See godoc for further documentation and examples.
|
||||||
|
|
||||||
|
* [godoc.org/golang.org/x/oauth2](http://godoc.org/golang.org/x/oauth2)
|
||||||
|
* [godoc.org/golang.org/x/oauth2/google](http://godoc.org/golang.org/x/oauth2/google)
|
||||||
|
|
||||||
|
|
||||||
|
## App Engine
|
||||||
|
|
||||||
|
In change 96e89be (March 2015) we removed the `oauth2.Context2` type in favor
|
||||||
|
of the [`context.Context`](https://golang.org/x/net/context#Context) type from
|
||||||
|
the `golang.org/x/net/context` package
|
||||||
|
|
||||||
|
This means its no longer possible to use the "Classic App Engine"
|
||||||
|
`appengine.Context` type with the `oauth2` package. (You're using
|
||||||
|
Classic App Engine if you import the package `"appengine"`.)
|
||||||
|
|
||||||
|
To work around this, you may use the new `"google.golang.org/appengine"`
|
||||||
|
package. This package has almost the same API as the `"appengine"` package,
|
||||||
|
but it can be fetched with `go get` and used on "Managed VMs" and well as
|
||||||
|
Classic App Engine.
|
||||||
|
|
||||||
|
See the [new `appengine` package's readme](https://github.com/golang/appengine#updating-a-go-app-engine-app)
|
||||||
|
for information on updating your app.
|
||||||
|
|
||||||
|
If you don't want to update your entire app to use the new App Engine packages,
|
||||||
|
you may use both sets of packages in parallel, using only the new packages
|
||||||
|
with the `oauth2` package.
|
||||||
|
|
||||||
|
import (
|
||||||
|
"golang.org/x/net/context"
|
||||||
|
"golang.org/x/oauth2"
|
||||||
|
"golang.org/x/oauth2/google"
|
||||||
|
newappengine "google.golang.org/appengine"
|
||||||
|
newurlfetch "google.golang.org/appengine/urlfetch"
|
||||||
|
|
||||||
|
"appengine"
|
||||||
|
)
|
||||||
|
|
||||||
|
func handler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
var c appengine.Context = appengine.NewContext(r)
|
||||||
|
c.Infof("Logging a message with the old package")
|
||||||
|
|
||||||
|
var ctx context.Context = newappengine.NewContext(r)
|
||||||
|
client := &http.Client{
|
||||||
|
Transport: &oauth2.Transport{
|
||||||
|
Source: google.AppEngineTokenSource(ctx, "scope"),
|
||||||
|
Base: &newurlfetch.Transport{Context: ctx},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
client.Get("...")
|
||||||
|
}
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
We appreciate your help!
|
||||||
|
|
||||||
|
To contribute, please read the contribution guidelines:
|
||||||
|
https://golang.org/doc/contribute.html
|
||||||
|
|
||||||
|
Note that the Go project does not use GitHub pull requests but
|
||||||
|
uses Gerrit for code reviews. See the contribution guide for details.
|
25
vendor/golang.org/x/oauth2/client_appengine.go
generated
vendored
Normal file
25
vendor/golang.org/x/oauth2/client_appengine.go
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
// Copyright 2014 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build appengine
|
||||||
|
|
||||||
|
// App Engine hooks.
|
||||||
|
|
||||||
|
package oauth2
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"golang.org/x/net/context"
|
||||||
|
"golang.org/x/oauth2/internal"
|
||||||
|
"google.golang.org/appengine/urlfetch"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
internal.RegisterContextClientFunc(contextClientAppEngine)
|
||||||
|
}
|
||||||
|
|
||||||
|
func contextClientAppEngine(ctx context.Context) (*http.Client, error) {
|
||||||
|
return urlfetch.Client(ctx), nil
|
||||||
|
}
|
76
vendor/golang.org/x/oauth2/internal/oauth2.go
generated
vendored
Normal file
76
vendor/golang.org/x/oauth2/internal/oauth2.go
generated
vendored
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
// Copyright 2014 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// Package internal contains support packages for oauth2 package.
|
||||||
|
package internal
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bufio"
|
||||||
|
"crypto/rsa"
|
||||||
|
"crypto/x509"
|
||||||
|
"encoding/pem"
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ParseKey converts the binary contents of a private key file
|
||||||
|
// to an *rsa.PrivateKey. It detects whether the private key is in a
|
||||||
|
// PEM container or not. If so, it extracts the the private key
|
||||||
|
// from PEM container before conversion. It only supports PEM
|
||||||
|
// containers with no passphrase.
|
||||||
|
func ParseKey(key []byte) (*rsa.PrivateKey, error) {
|
||||||
|
block, _ := pem.Decode(key)
|
||||||
|
if block != nil {
|
||||||
|
key = block.Bytes
|
||||||
|
}
|
||||||
|
parsedKey, err := x509.ParsePKCS8PrivateKey(key)
|
||||||
|
if err != nil {
|
||||||
|
parsedKey, err = x509.ParsePKCS1PrivateKey(key)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("private key should be a PEM or plain PKSC1 or PKCS8; parse error: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
parsed, ok := parsedKey.(*rsa.PrivateKey)
|
||||||
|
if !ok {
|
||||||
|
return nil, errors.New("private key is invalid")
|
||||||
|
}
|
||||||
|
return parsed, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func ParseINI(ini io.Reader) (map[string]map[string]string, error) {
|
||||||
|
result := map[string]map[string]string{
|
||||||
|
"": {}, // root section
|
||||||
|
}
|
||||||
|
scanner := bufio.NewScanner(ini)
|
||||||
|
currentSection := ""
|
||||||
|
for scanner.Scan() {
|
||||||
|
line := strings.TrimSpace(scanner.Text())
|
||||||
|
if strings.HasPrefix(line, ";") {
|
||||||
|
// comment.
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if strings.HasPrefix(line, "[") && strings.HasSuffix(line, "]") {
|
||||||
|
currentSection = strings.TrimSpace(line[1 : len(line)-1])
|
||||||
|
result[currentSection] = map[string]string{}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
parts := strings.SplitN(line, "=", 2)
|
||||||
|
if len(parts) == 2 && parts[0] != "" {
|
||||||
|
result[currentSection][strings.TrimSpace(parts[0])] = strings.TrimSpace(parts[1])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err := scanner.Err(); err != nil {
|
||||||
|
return nil, fmt.Errorf("error scanning ini: %v", err)
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func CondVal(v string) []string {
|
||||||
|
if v == "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return []string{v}
|
||||||
|
}
|
247
vendor/golang.org/x/oauth2/internal/token.go
generated
vendored
Normal file
247
vendor/golang.org/x/oauth2/internal/token.go
generated
vendored
Normal file
@ -0,0 +1,247 @@
|
|||||||
|
// Copyright 2014 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// Package internal contains support packages for oauth2 package.
|
||||||
|
package internal
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"io/ioutil"
|
||||||
|
"mime"
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"golang.org/x/net/context"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Token represents the crendentials used to authorize
|
||||||
|
// the requests to access protected resources on the OAuth 2.0
|
||||||
|
// provider's backend.
|
||||||
|
//
|
||||||
|
// This type is a mirror of oauth2.Token and exists to break
|
||||||
|
// an otherwise-circular dependency. Other internal packages
|
||||||
|
// should convert this Token into an oauth2.Token before use.
|
||||||
|
type Token struct {
|
||||||
|
// AccessToken is the token that authorizes and authenticates
|
||||||
|
// the requests.
|
||||||
|
AccessToken string
|
||||||
|
|
||||||
|
// TokenType is the type of token.
|
||||||
|
// The Type method returns either this or "Bearer", the default.
|
||||||
|
TokenType string
|
||||||
|
|
||||||
|
// RefreshToken is a token that's used by the application
|
||||||
|
// (as opposed to the user) to refresh the access token
|
||||||
|
// if it expires.
|
||||||
|
RefreshToken string
|
||||||
|
|
||||||
|
// Expiry is the optional expiration time of the access token.
|
||||||
|
//
|
||||||
|
// If zero, TokenSource implementations will reuse the same
|
||||||
|
// token forever and RefreshToken or equivalent
|
||||||
|
// mechanisms for that TokenSource will not be used.
|
||||||
|
Expiry time.Time
|
||||||
|
|
||||||
|
// Raw optionally contains extra metadata from the server
|
||||||
|
// when updating a token.
|
||||||
|
Raw interface{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// tokenJSON is the struct representing the HTTP response from OAuth2
|
||||||
|
// providers returning a token in JSON form.
|
||||||
|
type tokenJSON struct {
|
||||||
|
AccessToken string `json:"access_token"`
|
||||||
|
TokenType string `json:"token_type"`
|
||||||
|
RefreshToken string `json:"refresh_token"`
|
||||||
|
ExpiresIn expirationTime `json:"expires_in"` // at least PayPal returns string, while most return number
|
||||||
|
Expires expirationTime `json:"expires"` // broken Facebook spelling of expires_in
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *tokenJSON) expiry() (t time.Time) {
|
||||||
|
if v := e.ExpiresIn; v != 0 {
|
||||||
|
return time.Now().Add(time.Duration(v) * time.Second)
|
||||||
|
}
|
||||||
|
if v := e.Expires; v != 0 {
|
||||||
|
return time.Now().Add(time.Duration(v) * time.Second)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
type expirationTime int32
|
||||||
|
|
||||||
|
func (e *expirationTime) UnmarshalJSON(b []byte) error {
|
||||||
|
var n json.Number
|
||||||
|
err := json.Unmarshal(b, &n)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
i, err := n.Int64()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*e = expirationTime(i)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var brokenAuthHeaderProviders = []string{
|
||||||
|
"https://accounts.google.com/",
|
||||||
|
"https://api.codeswholesale.com/oauth/token",
|
||||||
|
"https://api.dropbox.com/",
|
||||||
|
"https://api.dropboxapi.com/",
|
||||||
|
"https://api.instagram.com/",
|
||||||
|
"https://api.netatmo.net/",
|
||||||
|
"https://api.odnoklassniki.ru/",
|
||||||
|
"https://api.pushbullet.com/",
|
||||||
|
"https://api.soundcloud.com/",
|
||||||
|
"https://api.twitch.tv/",
|
||||||
|
"https://app.box.com/",
|
||||||
|
"https://connect.stripe.com/",
|
||||||
|
"https://graph.facebook.com", // see https://github.com/golang/oauth2/issues/214
|
||||||
|
"https://login.microsoftonline.com/",
|
||||||
|
"https://login.salesforce.com/",
|
||||||
|
"https://oauth.sandbox.trainingpeaks.com/",
|
||||||
|
"https://oauth.trainingpeaks.com/",
|
||||||
|
"https://oauth.vk.com/",
|
||||||
|
"https://openapi.baidu.com/",
|
||||||
|
"https://slack.com/",
|
||||||
|
"https://test-sandbox.auth.corp.google.com",
|
||||||
|
"https://test.salesforce.com/",
|
||||||
|
"https://user.gini.net/",
|
||||||
|
"https://www.douban.com/",
|
||||||
|
"https://www.googleapis.com/",
|
||||||
|
"https://www.linkedin.com/",
|
||||||
|
"https://www.strava.com/oauth/",
|
||||||
|
"https://www.wunderlist.com/oauth/",
|
||||||
|
"https://api.patreon.com/",
|
||||||
|
"https://sandbox.codeswholesale.com/oauth/token",
|
||||||
|
}
|
||||||
|
|
||||||
|
// brokenAuthHeaderDomains lists broken providers that issue dynamic endpoints.
|
||||||
|
var brokenAuthHeaderDomains = []string{
|
||||||
|
".force.com",
|
||||||
|
".okta.com",
|
||||||
|
".oktapreview.com",
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterBrokenAuthHeaderProvider(tokenURL string) {
|
||||||
|
brokenAuthHeaderProviders = append(brokenAuthHeaderProviders, tokenURL)
|
||||||
|
}
|
||||||
|
|
||||||
|
// providerAuthHeaderWorks reports whether the OAuth2 server identified by the tokenURL
|
||||||
|
// implements the OAuth2 spec correctly
|
||||||
|
// See https://code.google.com/p/goauth2/issues/detail?id=31 for background.
|
||||||
|
// In summary:
|
||||||
|
// - Reddit only accepts client secret in the Authorization header
|
||||||
|
// - Dropbox accepts either it in URL param or Auth header, but not both.
|
||||||
|
// - Google only accepts URL param (not spec compliant?), not Auth header
|
||||||
|
// - Stripe only accepts client secret in Auth header with Bearer method, not Basic
|
||||||
|
func providerAuthHeaderWorks(tokenURL string) bool {
|
||||||
|
for _, s := range brokenAuthHeaderProviders {
|
||||||
|
if strings.HasPrefix(tokenURL, s) {
|
||||||
|
// Some sites fail to implement the OAuth2 spec fully.
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if u, err := url.Parse(tokenURL); err == nil {
|
||||||
|
for _, s := range brokenAuthHeaderDomains {
|
||||||
|
if strings.HasSuffix(u.Host, s) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Assume the provider implements the spec properly
|
||||||
|
// otherwise. We can add more exceptions as they're
|
||||||
|
// discovered. We will _not_ be adding configurable hooks
|
||||||
|
// to this package to let users select server bugs.
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func RetrieveToken(ctx context.Context, clientID, clientSecret, tokenURL string, v url.Values) (*Token, error) {
|
||||||
|
hc, err := ContextClient(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
bustedAuth := !providerAuthHeaderWorks(tokenURL)
|
||||||
|
if bustedAuth {
|
||||||
|
if clientID != "" {
|
||||||
|
v.Set("client_id", clientID)
|
||||||
|
}
|
||||||
|
if clientSecret != "" {
|
||||||
|
v.Set("client_secret", clientSecret)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
req, err := http.NewRequest("POST", tokenURL, strings.NewReader(v.Encode()))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
|
||||||
|
if !bustedAuth {
|
||||||
|
req.SetBasicAuth(clientID, clientSecret)
|
||||||
|
}
|
||||||
|
r, err := hc.Do(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
defer r.Body.Close()
|
||||||
|
body, err := ioutil.ReadAll(io.LimitReader(r.Body, 1<<20))
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("oauth2: cannot fetch token: %v", err)
|
||||||
|
}
|
||||||
|
if code := r.StatusCode; code < 200 || code > 299 {
|
||||||
|
return nil, fmt.Errorf("oauth2: cannot fetch token: %v\nResponse: %s", r.Status, body)
|
||||||
|
}
|
||||||
|
|
||||||
|
var token *Token
|
||||||
|
content, _, _ := mime.ParseMediaType(r.Header.Get("Content-Type"))
|
||||||
|
switch content {
|
||||||
|
case "application/x-www-form-urlencoded", "text/plain":
|
||||||
|
vals, err := url.ParseQuery(string(body))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
token = &Token{
|
||||||
|
AccessToken: vals.Get("access_token"),
|
||||||
|
TokenType: vals.Get("token_type"),
|
||||||
|
RefreshToken: vals.Get("refresh_token"),
|
||||||
|
Raw: vals,
|
||||||
|
}
|
||||||
|
e := vals.Get("expires_in")
|
||||||
|
if e == "" {
|
||||||
|
// TODO(jbd): Facebook's OAuth2 implementation is broken and
|
||||||
|
// returns expires_in field in expires. Remove the fallback to expires,
|
||||||
|
// when Facebook fixes their implementation.
|
||||||
|
e = vals.Get("expires")
|
||||||
|
}
|
||||||
|
expires, _ := strconv.Atoi(e)
|
||||||
|
if expires != 0 {
|
||||||
|
token.Expiry = time.Now().Add(time.Duration(expires) * time.Second)
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
var tj tokenJSON
|
||||||
|
if err = json.Unmarshal(body, &tj); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
token = &Token{
|
||||||
|
AccessToken: tj.AccessToken,
|
||||||
|
TokenType: tj.TokenType,
|
||||||
|
RefreshToken: tj.RefreshToken,
|
||||||
|
Expiry: tj.expiry(),
|
||||||
|
Raw: make(map[string]interface{}),
|
||||||
|
}
|
||||||
|
json.Unmarshal(body, &token.Raw) // no error checks for optional fields
|
||||||
|
}
|
||||||
|
// Don't overwrite `RefreshToken` with an empty value
|
||||||
|
// if this was a token refreshing request.
|
||||||
|
if token.RefreshToken == "" {
|
||||||
|
token.RefreshToken = v.Get("refresh_token")
|
||||||
|
}
|
||||||
|
return token, nil
|
||||||
|
}
|
69
vendor/golang.org/x/oauth2/internal/transport.go
generated
vendored
Normal file
69
vendor/golang.org/x/oauth2/internal/transport.go
generated
vendored
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
// Copyright 2014 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// Package internal contains support packages for oauth2 package.
|
||||||
|
package internal
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"golang.org/x/net/context"
|
||||||
|
)
|
||||||
|
|
||||||
|
// HTTPClient is the context key to use with golang.org/x/net/context's
|
||||||
|
// WithValue function to associate an *http.Client value with a context.
|
||||||
|
var HTTPClient ContextKey
|
||||||
|
|
||||||
|
// ContextKey is just an empty struct. It exists so HTTPClient can be
|
||||||
|
// an immutable public variable with a unique type. It's immutable
|
||||||
|
// because nobody else can create a ContextKey, being unexported.
|
||||||
|
type ContextKey struct{}
|
||||||
|
|
||||||
|
// ContextClientFunc is a func which tries to return an *http.Client
|
||||||
|
// given a Context value. If it returns an error, the search stops
|
||||||
|
// with that error. If it returns (nil, nil), the search continues
|
||||||
|
// down the list of registered funcs.
|
||||||
|
type ContextClientFunc func(context.Context) (*http.Client, error)
|
||||||
|
|
||||||
|
var contextClientFuncs []ContextClientFunc
|
||||||
|
|
||||||
|
func RegisterContextClientFunc(fn ContextClientFunc) {
|
||||||
|
contextClientFuncs = append(contextClientFuncs, fn)
|
||||||
|
}
|
||||||
|
|
||||||
|
func ContextClient(ctx context.Context) (*http.Client, error) {
|
||||||
|
if ctx != nil {
|
||||||
|
if hc, ok := ctx.Value(HTTPClient).(*http.Client); ok {
|
||||||
|
return hc, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, fn := range contextClientFuncs {
|
||||||
|
c, err := fn(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if c != nil {
|
||||||
|
return c, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return http.DefaultClient, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func ContextTransport(ctx context.Context) http.RoundTripper {
|
||||||
|
hc, err := ContextClient(ctx)
|
||||||
|
// This is a rare error case (somebody using nil on App Engine).
|
||||||
|
if err != nil {
|
||||||
|
return ErrorTransport{err}
|
||||||
|
}
|
||||||
|
return hc.Transport
|
||||||
|
}
|
||||||
|
|
||||||
|
// ErrorTransport returns the specified error on RoundTrip.
|
||||||
|
// This RoundTripper should be used in rare error cases where
|
||||||
|
// error handling can be postponed to response handling time.
|
||||||
|
type ErrorTransport struct{ Err error }
|
||||||
|
|
||||||
|
func (t ErrorTransport) RoundTrip(*http.Request) (*http.Response, error) {
|
||||||
|
return nil, t.Err
|
||||||
|
}
|
340
vendor/golang.org/x/oauth2/oauth2.go
generated
vendored
Normal file
340
vendor/golang.org/x/oauth2/oauth2.go
generated
vendored
Normal file
@ -0,0 +1,340 @@
|
|||||||
|
// Copyright 2014 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// Package oauth2 provides support for making
|
||||||
|
// OAuth2 authorized and authenticated HTTP requests.
|
||||||
|
// It can additionally grant authorization with Bearer JWT.
|
||||||
|
package oauth2 // import "golang.org/x/oauth2"
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"errors"
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
"strings"
|
||||||
|
"sync"
|
||||||
|
|
||||||
|
"golang.org/x/net/context"
|
||||||
|
"golang.org/x/oauth2/internal"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NoContext is the default context you should supply if not using
|
||||||
|
// your own context.Context (see https://golang.org/x/net/context).
|
||||||
|
//
|
||||||
|
// Deprecated: Use context.Background() or context.TODO() instead.
|
||||||
|
var NoContext = context.TODO()
|
||||||
|
|
||||||
|
// RegisterBrokenAuthHeaderProvider registers an OAuth2 server
|
||||||
|
// identified by the tokenURL prefix as an OAuth2 implementation
|
||||||
|
// which doesn't support the HTTP Basic authentication
|
||||||
|
// scheme to authenticate with the authorization server.
|
||||||
|
// Once a server is registered, credentials (client_id and client_secret)
|
||||||
|
// will be passed as query parameters rather than being present
|
||||||
|
// in the Authorization header.
|
||||||
|
// See https://code.google.com/p/goauth2/issues/detail?id=31 for background.
|
||||||
|
func RegisterBrokenAuthHeaderProvider(tokenURL string) {
|
||||||
|
internal.RegisterBrokenAuthHeaderProvider(tokenURL)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Config describes a typical 3-legged OAuth2 flow, with both the
|
||||||
|
// client application information and the server's endpoint URLs.
|
||||||
|
// For the client credentials 2-legged OAuth2 flow, see the clientcredentials
|
||||||
|
// package (https://golang.org/x/oauth2/clientcredentials).
|
||||||
|
type Config struct {
|
||||||
|
// ClientID is the application's ID.
|
||||||
|
ClientID string
|
||||||
|
|
||||||
|
// ClientSecret is the application's secret.
|
||||||
|
ClientSecret string
|
||||||
|
|
||||||
|
// Endpoint contains the resource server's token endpoint
|
||||||
|
// URLs. These are constants specific to each server and are
|
||||||
|
// often available via site-specific packages, such as
|
||||||
|
// google.Endpoint or github.Endpoint.
|
||||||
|
Endpoint Endpoint
|
||||||
|
|
||||||
|
// RedirectURL is the URL to redirect users going through
|
||||||
|
// the OAuth flow, after the resource owner's URLs.
|
||||||
|
RedirectURL string
|
||||||
|
|
||||||
|
// Scope specifies optional requested permissions.
|
||||||
|
Scopes []string
|
||||||
|
}
|
||||||
|
|
||||||
|
// A TokenSource is anything that can return a token.
|
||||||
|
type TokenSource interface {
|
||||||
|
// Token returns a token or an error.
|
||||||
|
// Token must be safe for concurrent use by multiple goroutines.
|
||||||
|
// The returned Token must not be modified.
|
||||||
|
Token() (*Token, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Endpoint contains the OAuth 2.0 provider's authorization and token
|
||||||
|
// endpoint URLs.
|
||||||
|
type Endpoint struct {
|
||||||
|
AuthURL string
|
||||||
|
TokenURL string
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
// AccessTypeOnline and AccessTypeOffline are options passed
|
||||||
|
// to the Options.AuthCodeURL method. They modify the
|
||||||
|
// "access_type" field that gets sent in the URL returned by
|
||||||
|
// AuthCodeURL.
|
||||||
|
//
|
||||||
|
// Online is the default if neither is specified. If your
|
||||||
|
// application needs to refresh access tokens when the user
|
||||||
|
// is not present at the browser, then use offline. This will
|
||||||
|
// result in your application obtaining a refresh token the
|
||||||
|
// first time your application exchanges an authorization
|
||||||
|
// code for a user.
|
||||||
|
AccessTypeOnline AuthCodeOption = SetAuthURLParam("access_type", "online")
|
||||||
|
AccessTypeOffline AuthCodeOption = SetAuthURLParam("access_type", "offline")
|
||||||
|
|
||||||
|
// ApprovalForce forces the users to view the consent dialog
|
||||||
|
// and confirm the permissions request at the URL returned
|
||||||
|
// from AuthCodeURL, even if they've already done so.
|
||||||
|
ApprovalForce AuthCodeOption = SetAuthURLParam("approval_prompt", "force")
|
||||||
|
)
|
||||||
|
|
||||||
|
// An AuthCodeOption is passed to Config.AuthCodeURL.
|
||||||
|
type AuthCodeOption interface {
|
||||||
|
setValue(url.Values)
|
||||||
|
}
|
||||||
|
|
||||||
|
type setParam struct{ k, v string }
|
||||||
|
|
||||||
|
func (p setParam) setValue(m url.Values) { m.Set(p.k, p.v) }
|
||||||
|
|
||||||
|
// SetAuthURLParam builds an AuthCodeOption which passes key/value parameters
|
||||||
|
// to a provider's authorization endpoint.
|
||||||
|
func SetAuthURLParam(key, value string) AuthCodeOption {
|
||||||
|
return setParam{key, value}
|
||||||
|
}
|
||||||
|
|
||||||
|
// AuthCodeURL returns a URL to OAuth 2.0 provider's consent page
|
||||||
|
// that asks for permissions for the required scopes explicitly.
|
||||||
|
//
|
||||||
|
// State is a token to protect the user from CSRF attacks. You must
|
||||||
|
// always provide a non-zero string and validate that it matches the
|
||||||
|
// the state query parameter on your redirect callback.
|
||||||
|
// See http://tools.ietf.org/html/rfc6749#section-10.12 for more info.
|
||||||
|
//
|
||||||
|
// Opts may include AccessTypeOnline or AccessTypeOffline, as well
|
||||||
|
// as ApprovalForce.
|
||||||
|
func (c *Config) AuthCodeURL(state string, opts ...AuthCodeOption) string {
|
||||||
|
var buf bytes.Buffer
|
||||||
|
buf.WriteString(c.Endpoint.AuthURL)
|
||||||
|
v := url.Values{
|
||||||
|
"response_type": {"code"},
|
||||||
|
"client_id": {c.ClientID},
|
||||||
|
"redirect_uri": internal.CondVal(c.RedirectURL),
|
||||||
|
"scope": internal.CondVal(strings.Join(c.Scopes, " ")),
|
||||||
|
"state": internal.CondVal(state),
|
||||||
|
}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt.setValue(v)
|
||||||
|
}
|
||||||
|
if strings.Contains(c.Endpoint.AuthURL, "?") {
|
||||||
|
buf.WriteByte('&')
|
||||||
|
} else {
|
||||||
|
buf.WriteByte('?')
|
||||||
|
}
|
||||||
|
buf.WriteString(v.Encode())
|
||||||
|
return buf.String()
|
||||||
|
}
|
||||||
|
|
||||||
|
// PasswordCredentialsToken converts a resource owner username and password
|
||||||
|
// pair into a token.
|
||||||
|
//
|
||||||
|
// Per the RFC, this grant type should only be used "when there is a high
|
||||||
|
// degree of trust between the resource owner and the client (e.g., the client
|
||||||
|
// is part of the device operating system or a highly privileged application),
|
||||||
|
// and when other authorization grant types are not available."
|
||||||
|
// See https://tools.ietf.org/html/rfc6749#section-4.3 for more info.
|
||||||
|
//
|
||||||
|
// The HTTP client to use is derived from the context.
|
||||||
|
// If nil, http.DefaultClient is used.
|
||||||
|
func (c *Config) PasswordCredentialsToken(ctx context.Context, username, password string) (*Token, error) {
|
||||||
|
return retrieveToken(ctx, c, url.Values{
|
||||||
|
"grant_type": {"password"},
|
||||||
|
"username": {username},
|
||||||
|
"password": {password},
|
||||||
|
"scope": internal.CondVal(strings.Join(c.Scopes, " ")),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Exchange converts an authorization code into a token.
|
||||||
|
//
|
||||||
|
// It is used after a resource provider redirects the user back
|
||||||
|
// to the Redirect URI (the URL obtained from AuthCodeURL).
|
||||||
|
//
|
||||||
|
// The HTTP client to use is derived from the context.
|
||||||
|
// If a client is not provided via the context, http.DefaultClient is used.
|
||||||
|
//
|
||||||
|
// The code will be in the *http.Request.FormValue("code"). Before
|
||||||
|
// calling Exchange, be sure to validate FormValue("state").
|
||||||
|
func (c *Config) Exchange(ctx context.Context, code string) (*Token, error) {
|
||||||
|
return retrieveToken(ctx, c, url.Values{
|
||||||
|
"grant_type": {"authorization_code"},
|
||||||
|
"code": {code},
|
||||||
|
"redirect_uri": internal.CondVal(c.RedirectURL),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Client returns an HTTP client using the provided token.
|
||||||
|
// The token will auto-refresh as necessary. The underlying
|
||||||
|
// HTTP transport will be obtained using the provided context.
|
||||||
|
// The returned client and its Transport should not be modified.
|
||||||
|
func (c *Config) Client(ctx context.Context, t *Token) *http.Client {
|
||||||
|
return NewClient(ctx, c.TokenSource(ctx, t))
|
||||||
|
}
|
||||||
|
|
||||||
|
// TokenSource returns a TokenSource that returns t until t expires,
|
||||||
|
// automatically refreshing it as necessary using the provided context.
|
||||||
|
//
|
||||||
|
// Most users will use Config.Client instead.
|
||||||
|
func (c *Config) TokenSource(ctx context.Context, t *Token) TokenSource {
|
||||||
|
tkr := &tokenRefresher{
|
||||||
|
ctx: ctx,
|
||||||
|
conf: c,
|
||||||
|
}
|
||||||
|
if t != nil {
|
||||||
|
tkr.refreshToken = t.RefreshToken
|
||||||
|
}
|
||||||
|
return &reuseTokenSource{
|
||||||
|
t: t,
|
||||||
|
new: tkr,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// tokenRefresher is a TokenSource that makes "grant_type"=="refresh_token"
|
||||||
|
// HTTP requests to renew a token using a RefreshToken.
|
||||||
|
type tokenRefresher struct {
|
||||||
|
ctx context.Context // used to get HTTP requests
|
||||||
|
conf *Config
|
||||||
|
refreshToken string
|
||||||
|
}
|
||||||
|
|
||||||
|
// WARNING: Token is not safe for concurrent access, as it
|
||||||
|
// updates the tokenRefresher's refreshToken field.
|
||||||
|
// Within this package, it is used by reuseTokenSource which
|
||||||
|
// synchronizes calls to this method with its own mutex.
|
||||||
|
func (tf *tokenRefresher) Token() (*Token, error) {
|
||||||
|
if tf.refreshToken == "" {
|
||||||
|
return nil, errors.New("oauth2: token expired and refresh token is not set")
|
||||||
|
}
|
||||||
|
|
||||||
|
tk, err := retrieveToken(tf.ctx, tf.conf, url.Values{
|
||||||
|
"grant_type": {"refresh_token"},
|
||||||
|
"refresh_token": {tf.refreshToken},
|
||||||
|
})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if tf.refreshToken != tk.RefreshToken {
|
||||||
|
tf.refreshToken = tk.RefreshToken
|
||||||
|
}
|
||||||
|
return tk, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// reuseTokenSource is a TokenSource that holds a single token in memory
|
||||||
|
// and validates its expiry before each call to retrieve it with
|
||||||
|
// Token. If it's expired, it will be auto-refreshed using the
|
||||||
|
// new TokenSource.
|
||||||
|
type reuseTokenSource struct {
|
||||||
|
new TokenSource // called when t is expired.
|
||||||
|
|
||||||
|
mu sync.Mutex // guards t
|
||||||
|
t *Token
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token returns the current token if it's still valid, else will
|
||||||
|
// refresh the current token (using r.Context for HTTP client
|
||||||
|
// information) and return the new one.
|
||||||
|
func (s *reuseTokenSource) Token() (*Token, error) {
|
||||||
|
s.mu.Lock()
|
||||||
|
defer s.mu.Unlock()
|
||||||
|
if s.t.Valid() {
|
||||||
|
return s.t, nil
|
||||||
|
}
|
||||||
|
t, err := s.new.Token()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
s.t = t
|
||||||
|
return t, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// StaticTokenSource returns a TokenSource that always returns the same token.
|
||||||
|
// Because the provided token t is never refreshed, StaticTokenSource is only
|
||||||
|
// useful for tokens that never expire.
|
||||||
|
func StaticTokenSource(t *Token) TokenSource {
|
||||||
|
return staticTokenSource{t}
|
||||||
|
}
|
||||||
|
|
||||||
|
// staticTokenSource is a TokenSource that always returns the same Token.
|
||||||
|
type staticTokenSource struct {
|
||||||
|
t *Token
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s staticTokenSource) Token() (*Token, error) {
|
||||||
|
return s.t, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// HTTPClient is the context key to use with golang.org/x/net/context's
|
||||||
|
// WithValue function to associate an *http.Client value with a context.
|
||||||
|
var HTTPClient internal.ContextKey
|
||||||
|
|
||||||
|
// NewClient creates an *http.Client from a Context and TokenSource.
|
||||||
|
// The returned client is not valid beyond the lifetime of the context.
|
||||||
|
//
|
||||||
|
// As a special case, if src is nil, a non-OAuth2 client is returned
|
||||||
|
// using the provided context. This exists to support related OAuth2
|
||||||
|
// packages.
|
||||||
|
func NewClient(ctx context.Context, src TokenSource) *http.Client {
|
||||||
|
if src == nil {
|
||||||
|
c, err := internal.ContextClient(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return &http.Client{Transport: internal.ErrorTransport{Err: err}}
|
||||||
|
}
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
return &http.Client{
|
||||||
|
Transport: &Transport{
|
||||||
|
Base: internal.ContextTransport(ctx),
|
||||||
|
Source: ReuseTokenSource(nil, src),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReuseTokenSource returns a TokenSource which repeatedly returns the
|
||||||
|
// same token as long as it's valid, starting with t.
|
||||||
|
// When its cached token is invalid, a new token is obtained from src.
|
||||||
|
//
|
||||||
|
// ReuseTokenSource is typically used to reuse tokens from a cache
|
||||||
|
// (such as a file on disk) between runs of a program, rather than
|
||||||
|
// obtaining new tokens unnecessarily.
|
||||||
|
//
|
||||||
|
// The initial token t may be nil, in which case the TokenSource is
|
||||||
|
// wrapped in a caching version if it isn't one already. This also
|
||||||
|
// means it's always safe to wrap ReuseTokenSource around any other
|
||||||
|
// TokenSource without adverse effects.
|
||||||
|
func ReuseTokenSource(t *Token, src TokenSource) TokenSource {
|
||||||
|
// Don't wrap a reuseTokenSource in itself. That would work,
|
||||||
|
// but cause an unnecessary number of mutex operations.
|
||||||
|
// Just build the equivalent one.
|
||||||
|
if rt, ok := src.(*reuseTokenSource); ok {
|
||||||
|
if t == nil {
|
||||||
|
// Just use it directly.
|
||||||
|
return rt
|
||||||
|
}
|
||||||
|
src = rt.new
|
||||||
|
}
|
||||||
|
return &reuseTokenSource{
|
||||||
|
t: t,
|
||||||
|
new: src,
|
||||||
|
}
|
||||||
|
}
|
158
vendor/golang.org/x/oauth2/token.go
generated
vendored
Normal file
158
vendor/golang.org/x/oauth2/token.go
generated
vendored
Normal file
@ -0,0 +1,158 @@
|
|||||||
|
// Copyright 2014 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
package oauth2
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"golang.org/x/net/context"
|
||||||
|
"golang.org/x/oauth2/internal"
|
||||||
|
)
|
||||||
|
|
||||||
|
// expiryDelta determines how earlier a token should be considered
|
||||||
|
// expired than its actual expiration time. It is used to avoid late
|
||||||
|
// expirations due to client-server time mismatches.
|
||||||
|
const expiryDelta = 10 * time.Second
|
||||||
|
|
||||||
|
// Token represents the crendentials used to authorize
|
||||||
|
// the requests to access protected resources on the OAuth 2.0
|
||||||
|
// provider's backend.
|
||||||
|
//
|
||||||
|
// Most users of this package should not access fields of Token
|
||||||
|
// directly. They're exported mostly for use by related packages
|
||||||
|
// implementing derivative OAuth2 flows.
|
||||||
|
type Token struct {
|
||||||
|
// AccessToken is the token that authorizes and authenticates
|
||||||
|
// the requests.
|
||||||
|
AccessToken string `json:"access_token"`
|
||||||
|
|
||||||
|
// TokenType is the type of token.
|
||||||
|
// The Type method returns either this or "Bearer", the default.
|
||||||
|
TokenType string `json:"token_type,omitempty"`
|
||||||
|
|
||||||
|
// RefreshToken is a token that's used by the application
|
||||||
|
// (as opposed to the user) to refresh the access token
|
||||||
|
// if it expires.
|
||||||
|
RefreshToken string `json:"refresh_token,omitempty"`
|
||||||
|
|
||||||
|
// Expiry is the optional expiration time of the access token.
|
||||||
|
//
|
||||||
|
// If zero, TokenSource implementations will reuse the same
|
||||||
|
// token forever and RefreshToken or equivalent
|
||||||
|
// mechanisms for that TokenSource will not be used.
|
||||||
|
Expiry time.Time `json:"expiry,omitempty"`
|
||||||
|
|
||||||
|
// raw optionally contains extra metadata from the server
|
||||||
|
// when updating a token.
|
||||||
|
raw interface{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Type returns t.TokenType if non-empty, else "Bearer".
|
||||||
|
func (t *Token) Type() string {
|
||||||
|
if strings.EqualFold(t.TokenType, "bearer") {
|
||||||
|
return "Bearer"
|
||||||
|
}
|
||||||
|
if strings.EqualFold(t.TokenType, "mac") {
|
||||||
|
return "MAC"
|
||||||
|
}
|
||||||
|
if strings.EqualFold(t.TokenType, "basic") {
|
||||||
|
return "Basic"
|
||||||
|
}
|
||||||
|
if t.TokenType != "" {
|
||||||
|
return t.TokenType
|
||||||
|
}
|
||||||
|
return "Bearer"
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetAuthHeader sets the Authorization header to r using the access
|
||||||
|
// token in t.
|
||||||
|
//
|
||||||
|
// This method is unnecessary when using Transport or an HTTP Client
|
||||||
|
// returned by this package.
|
||||||
|
func (t *Token) SetAuthHeader(r *http.Request) {
|
||||||
|
r.Header.Set("Authorization", t.Type()+" "+t.AccessToken)
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithExtra returns a new Token that's a clone of t, but using the
|
||||||
|
// provided raw extra map. This is only intended for use by packages
|
||||||
|
// implementing derivative OAuth2 flows.
|
||||||
|
func (t *Token) WithExtra(extra interface{}) *Token {
|
||||||
|
t2 := new(Token)
|
||||||
|
*t2 = *t
|
||||||
|
t2.raw = extra
|
||||||
|
return t2
|
||||||
|
}
|
||||||
|
|
||||||
|
// Extra returns an extra field.
|
||||||
|
// Extra fields are key-value pairs returned by the server as a
|
||||||
|
// part of the token retrieval response.
|
||||||
|
func (t *Token) Extra(key string) interface{} {
|
||||||
|
if raw, ok := t.raw.(map[string]interface{}); ok {
|
||||||
|
return raw[key]
|
||||||
|
}
|
||||||
|
|
||||||
|
vals, ok := t.raw.(url.Values)
|
||||||
|
if !ok {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
v := vals.Get(key)
|
||||||
|
switch s := strings.TrimSpace(v); strings.Count(s, ".") {
|
||||||
|
case 0: // Contains no "."; try to parse as int
|
||||||
|
if i, err := strconv.ParseInt(s, 10, 64); err == nil {
|
||||||
|
return i
|
||||||
|
}
|
||||||
|
case 1: // Contains a single "."; try to parse as float
|
||||||
|
if f, err := strconv.ParseFloat(s, 64); err == nil {
|
||||||
|
return f
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return v
|
||||||
|
}
|
||||||
|
|
||||||
|
// expired reports whether the token is expired.
|
||||||
|
// t must be non-nil.
|
||||||
|
func (t *Token) expired() bool {
|
||||||
|
if t.Expiry.IsZero() {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return t.Expiry.Add(-expiryDelta).Before(time.Now())
|
||||||
|
}
|
||||||
|
|
||||||
|
// Valid reports whether t is non-nil, has an AccessToken, and is not expired.
|
||||||
|
func (t *Token) Valid() bool {
|
||||||
|
return t != nil && t.AccessToken != "" && !t.expired()
|
||||||
|
}
|
||||||
|
|
||||||
|
// tokenFromInternal maps an *internal.Token struct into
|
||||||
|
// a *Token struct.
|
||||||
|
func tokenFromInternal(t *internal.Token) *Token {
|
||||||
|
if t == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return &Token{
|
||||||
|
AccessToken: t.AccessToken,
|
||||||
|
TokenType: t.TokenType,
|
||||||
|
RefreshToken: t.RefreshToken,
|
||||||
|
Expiry: t.Expiry,
|
||||||
|
raw: t.Raw,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// retrieveToken takes a *Config and uses that to retrieve an *internal.Token.
|
||||||
|
// This token is then mapped from *internal.Token into an *oauth2.Token which is returned along
|
||||||
|
// with an error..
|
||||||
|
func retrieveToken(ctx context.Context, c *Config, v url.Values) (*Token, error) {
|
||||||
|
tk, err := internal.RetrieveToken(ctx, c.ClientID, c.ClientSecret, c.Endpoint.TokenURL, v)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return tokenFromInternal(tk), nil
|
||||||
|
}
|
132
vendor/golang.org/x/oauth2/transport.go
generated
vendored
Normal file
132
vendor/golang.org/x/oauth2/transport.go
generated
vendored
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
// Copyright 2014 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
package oauth2
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
"io"
|
||||||
|
"net/http"
|
||||||
|
"sync"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Transport is an http.RoundTripper that makes OAuth 2.0 HTTP requests,
|
||||||
|
// wrapping a base RoundTripper and adding an Authorization header
|
||||||
|
// with a token from the supplied Sources.
|
||||||
|
//
|
||||||
|
// Transport is a low-level mechanism. Most code will use the
|
||||||
|
// higher-level Config.Client method instead.
|
||||||
|
type Transport struct {
|
||||||
|
// Source supplies the token to add to outgoing requests'
|
||||||
|
// Authorization headers.
|
||||||
|
Source TokenSource
|
||||||
|
|
||||||
|
// Base is the base RoundTripper used to make HTTP requests.
|
||||||
|
// If nil, http.DefaultTransport is used.
|
||||||
|
Base http.RoundTripper
|
||||||
|
|
||||||
|
mu sync.Mutex // guards modReq
|
||||||
|
modReq map[*http.Request]*http.Request // original -> modified
|
||||||
|
}
|
||||||
|
|
||||||
|
// RoundTrip authorizes and authenticates the request with an
|
||||||
|
// access token. If no token exists or token is expired,
|
||||||
|
// tries to refresh/fetch a new token.
|
||||||
|
func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) {
|
||||||
|
if t.Source == nil {
|
||||||
|
return nil, errors.New("oauth2: Transport's Source is nil")
|
||||||
|
}
|
||||||
|
token, err := t.Source.Token()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
req2 := cloneRequest(req) // per RoundTripper contract
|
||||||
|
token.SetAuthHeader(req2)
|
||||||
|
t.setModReq(req, req2)
|
||||||
|
res, err := t.base().RoundTrip(req2)
|
||||||
|
if err != nil {
|
||||||
|
t.setModReq(req, nil)
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
res.Body = &onEOFReader{
|
||||||
|
rc: res.Body,
|
||||||
|
fn: func() { t.setModReq(req, nil) },
|
||||||
|
}
|
||||||
|
return res, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// CancelRequest cancels an in-flight request by closing its connection.
|
||||||
|
func (t *Transport) CancelRequest(req *http.Request) {
|
||||||
|
type canceler interface {
|
||||||
|
CancelRequest(*http.Request)
|
||||||
|
}
|
||||||
|
if cr, ok := t.base().(canceler); ok {
|
||||||
|
t.mu.Lock()
|
||||||
|
modReq := t.modReq[req]
|
||||||
|
delete(t.modReq, req)
|
||||||
|
t.mu.Unlock()
|
||||||
|
cr.CancelRequest(modReq)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t *Transport) base() http.RoundTripper {
|
||||||
|
if t.Base != nil {
|
||||||
|
return t.Base
|
||||||
|
}
|
||||||
|
return http.DefaultTransport
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t *Transport) setModReq(orig, mod *http.Request) {
|
||||||
|
t.mu.Lock()
|
||||||
|
defer t.mu.Unlock()
|
||||||
|
if t.modReq == nil {
|
||||||
|
t.modReq = make(map[*http.Request]*http.Request)
|
||||||
|
}
|
||||||
|
if mod == nil {
|
||||||
|
delete(t.modReq, orig)
|
||||||
|
} else {
|
||||||
|
t.modReq[orig] = mod
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// cloneRequest returns a clone of the provided *http.Request.
|
||||||
|
// The clone is a shallow copy of the struct and its Header map.
|
||||||
|
func cloneRequest(r *http.Request) *http.Request {
|
||||||
|
// shallow copy of the struct
|
||||||
|
r2 := new(http.Request)
|
||||||
|
*r2 = *r
|
||||||
|
// deep copy of the Header
|
||||||
|
r2.Header = make(http.Header, len(r.Header))
|
||||||
|
for k, s := range r.Header {
|
||||||
|
r2.Header[k] = append([]string(nil), s...)
|
||||||
|
}
|
||||||
|
return r2
|
||||||
|
}
|
||||||
|
|
||||||
|
type onEOFReader struct {
|
||||||
|
rc io.ReadCloser
|
||||||
|
fn func()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *onEOFReader) Read(p []byte) (n int, err error) {
|
||||||
|
n, err = r.rc.Read(p)
|
||||||
|
if err == io.EOF {
|
||||||
|
r.runFunc()
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *onEOFReader) Close() error {
|
||||||
|
err := r.rc.Close()
|
||||||
|
r.runFunc()
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *onEOFReader) runFunc() {
|
||||||
|
if fn := r.fn; fn != nil {
|
||||||
|
fn()
|
||||||
|
r.fn = nil
|
||||||
|
}
|
||||||
|
}
|
2759
vendor/k8s.io/api/core/v1/generated.pb.go
generated
vendored
2759
vendor/k8s.io/api/core/v1/generated.pb.go
generated
vendored
File diff suppressed because it is too large
Load Diff
65
vendor/k8s.io/api/core/v1/generated.proto
generated
vendored
65
vendor/k8s.io/api/core/v1/generated.proto
generated
vendored
@ -21,7 +21,6 @@ syntax = 'proto2';
|
|||||||
|
|
||||||
package k8s.io.api.core.v1;
|
package k8s.io.api.core.v1;
|
||||||
|
|
||||||
import "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto";
|
|
||||||
import "k8s.io/apimachinery/pkg/api/resource/generated.proto";
|
import "k8s.io/apimachinery/pkg/api/resource/generated.proto";
|
||||||
import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
|
import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
|
||||||
import "k8s.io/apimachinery/pkg/runtime/generated.proto";
|
import "k8s.io/apimachinery/pkg/runtime/generated.proto";
|
||||||
@ -188,7 +187,7 @@ message CSIPersistentVolumeSource {
|
|||||||
|
|
||||||
// Filesystem type to mount.
|
// Filesystem type to mount.
|
||||||
// Must be a filesystem type supported by the host operating system.
|
// Must be a filesystem type supported by the host operating system.
|
||||||
// Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
|
// Ex. "ext4", "xfs", "ntfs".
|
||||||
// +optional
|
// +optional
|
||||||
optional string fsType = 4;
|
optional string fsType = 4;
|
||||||
|
|
||||||
@ -627,7 +626,7 @@ message Container {
|
|||||||
|
|
||||||
// Compute Resources required by this container.
|
// Compute Resources required by this container.
|
||||||
// Cannot be updated.
|
// Cannot be updated.
|
||||||
// More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
|
// More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
|
||||||
// +optional
|
// +optional
|
||||||
optional ResourceRequirements resources = 8;
|
optional ResourceRequirements resources = 8;
|
||||||
|
|
||||||
@ -750,7 +749,7 @@ message ContainerPort {
|
|||||||
// This must be a valid port number, 0 < x < 65536.
|
// This must be a valid port number, 0 < x < 65536.
|
||||||
optional int32 containerPort = 3;
|
optional int32 containerPort = 3;
|
||||||
|
|
||||||
// Protocol for port. Must be UDP or TCP.
|
// Protocol for port. Must be UDP, TCP, or SCTP.
|
||||||
// Defaults to "TCP".
|
// Defaults to "TCP".
|
||||||
// +optional
|
// +optional
|
||||||
optional string protocol = 4;
|
optional string protocol = 4;
|
||||||
@ -969,7 +968,7 @@ message EndpointPort {
|
|||||||
optional int32 port = 2;
|
optional int32 port = 2;
|
||||||
|
|
||||||
// The IP protocol for this port.
|
// The IP protocol for this port.
|
||||||
// Must be UDP or TCP.
|
// Must be UDP, TCP, or SCTP.
|
||||||
// Default is TCP.
|
// Default is TCP.
|
||||||
// +optional
|
// +optional
|
||||||
optional string protocol = 3;
|
optional string protocol = 3;
|
||||||
@ -1725,10 +1724,14 @@ message LocalObjectReference {
|
|||||||
message LocalVolumeSource {
|
message LocalVolumeSource {
|
||||||
// The full path to the volume on the node.
|
// The full path to the volume on the node.
|
||||||
// It can be either a directory or block device (disk, partition, ...).
|
// It can be either a directory or block device (disk, partition, ...).
|
||||||
// Directories can be represented only by PersistentVolume with VolumeMode=Filesystem.
|
|
||||||
// Block devices can be represented only by VolumeMode=Block, which also requires the
|
|
||||||
// BlockVolume alpha feature gate to be enabled.
|
|
||||||
optional string path = 1;
|
optional string path = 1;
|
||||||
|
|
||||||
|
// Filesystem type to mount.
|
||||||
|
// It applies only when the Path is a block device.
|
||||||
|
// Must be a filesystem type supported by the host operating system.
|
||||||
|
// Ex. "ext4", "xfs", "ntfs". The default value is to auto-select a fileystem if unspecified.
|
||||||
|
// +optional
|
||||||
|
optional string fsType = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Represents an NFS mount that lasts the lifetime of a pod.
|
// Represents an NFS mount that lasts the lifetime of a pod.
|
||||||
@ -2293,6 +2296,17 @@ message PersistentVolumeClaimSpec {
|
|||||||
// This is an alpha feature and may change in the future.
|
// This is an alpha feature and may change in the future.
|
||||||
// +optional
|
// +optional
|
||||||
optional string volumeMode = 6;
|
optional string volumeMode = 6;
|
||||||
|
|
||||||
|
// This field requires the VolumeSnapshotDataSource alpha feature gate to be
|
||||||
|
// enabled and currently VolumeSnapshot is the only supported data source.
|
||||||
|
// If the provisioner can support VolumeSnapshot data source, it will create
|
||||||
|
// a new volume and data will be restored to the volume at the same time.
|
||||||
|
// If the provisioner does not support VolumeSnapshot data source, volume will
|
||||||
|
// not be created and the failure will be reported as an event.
|
||||||
|
// In the future, we plan to support more data source types and the behavior
|
||||||
|
// of the provisioner may change.
|
||||||
|
// +optional
|
||||||
|
optional TypedLocalObjectReference dataSource = 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
// PersistentVolumeClaimStatus is the current status of a persistent volume claim.
|
// PersistentVolumeClaimStatus is the current status of a persistent volume claim.
|
||||||
@ -3025,7 +3039,7 @@ message PodSpec {
|
|||||||
// in the same pod, and the first process in each container will not be assigned PID 1.
|
// in the same pod, and the first process in each container will not be assigned PID 1.
|
||||||
// HostPID and ShareProcessNamespace cannot both be set.
|
// HostPID and ShareProcessNamespace cannot both be set.
|
||||||
// Optional: Default to false.
|
// Optional: Default to false.
|
||||||
// This field is alpha-level and is honored only by servers that enable the PodShareProcessNamespace feature.
|
// This field is beta-level and may be disabled with the PodShareProcessNamespace feature.
|
||||||
// +k8s:conversion-gen=false
|
// +k8s:conversion-gen=false
|
||||||
// +optional
|
// +optional
|
||||||
optional bool shareProcessNamespace = 27;
|
optional bool shareProcessNamespace = 27;
|
||||||
@ -3103,6 +3117,15 @@ message PodSpec {
|
|||||||
// More info: https://github.com/kubernetes/community/blob/master/keps/sig-network/0007-pod-ready%2B%2B.md
|
// More info: https://github.com/kubernetes/community/blob/master/keps/sig-network/0007-pod-ready%2B%2B.md
|
||||||
// +optional
|
// +optional
|
||||||
repeated PodReadinessGate readinessGates = 28;
|
repeated PodReadinessGate readinessGates = 28;
|
||||||
|
|
||||||
|
// RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used
|
||||||
|
// to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run.
|
||||||
|
// If unset or empty, the "legacy" RuntimeClass will be used, which is an implicit class with an
|
||||||
|
// empty definition that uses the default runtime handler.
|
||||||
|
// More info: https://github.com/kubernetes/community/blob/master/keps/sig-node/0014-runtime-class.md
|
||||||
|
// This is an alpha feature and may change in the future.
|
||||||
|
// +optional
|
||||||
|
optional string runtimeClassName = 29;
|
||||||
}
|
}
|
||||||
|
|
||||||
// PodStatus represents information about the status of a pod. Status may trail the actual
|
// PodStatus represents information about the status of a pod. Status may trail the actual
|
||||||
@ -4021,6 +4044,13 @@ message SecurityContext {
|
|||||||
// 2) has CAP_SYS_ADMIN
|
// 2) has CAP_SYS_ADMIN
|
||||||
// +optional
|
// +optional
|
||||||
optional bool allowPrivilegeEscalation = 7;
|
optional bool allowPrivilegeEscalation = 7;
|
||||||
|
|
||||||
|
// procMount denotes the type of proc mount to use for the containers.
|
||||||
|
// The default is DefaultProcMount which uses the container runtime defaults for
|
||||||
|
// readonly paths and masked paths.
|
||||||
|
// This requires the ProcMountType feature flag to be enabled.
|
||||||
|
// +optional
|
||||||
|
optional string procMount = 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SerializedReference is a reference to serialized object.
|
// SerializedReference is a reference to serialized object.
|
||||||
@ -4140,7 +4170,7 @@ message ServicePort {
|
|||||||
// +optional
|
// +optional
|
||||||
optional string name = 1;
|
optional string name = 1;
|
||||||
|
|
||||||
// The IP protocol for this port. Supports "TCP" and "UDP".
|
// The IP protocol for this port. Supports "TCP", "UDP", and "SCTP".
|
||||||
// Default is TCP.
|
// Default is TCP.
|
||||||
// +optional
|
// +optional
|
||||||
optional string protocol = 2;
|
optional string protocol = 2;
|
||||||
@ -4470,6 +4500,19 @@ message TopologySelectorTerm {
|
|||||||
repeated TopologySelectorLabelRequirement matchLabelExpressions = 1;
|
repeated TopologySelectorLabelRequirement matchLabelExpressions = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TypedLocalObjectReference contains enough information to let you locate the
|
||||||
|
// typed referenced object inside the same namespace.
|
||||||
|
message TypedLocalObjectReference {
|
||||||
|
// APIGroup is the group for the resource being referenced
|
||||||
|
optional string apiGroup = 1;
|
||||||
|
|
||||||
|
// Kind is the type of resource being referenced
|
||||||
|
optional string kind = 2;
|
||||||
|
|
||||||
|
// Name is the name of resource being referenced
|
||||||
|
optional string name = 3;
|
||||||
|
}
|
||||||
|
|
||||||
// Volume represents a named volume in a pod that may be accessed by any container in the pod.
|
// Volume represents a named volume in a pod that may be accessed by any container in the pod.
|
||||||
message Volume {
|
message Volume {
|
||||||
// Volume's name.
|
// Volume's name.
|
||||||
@ -4513,7 +4556,7 @@ message VolumeMount {
|
|||||||
|
|
||||||
// mountPropagation determines how mounts are propagated from the host
|
// mountPropagation determines how mounts are propagated from the host
|
||||||
// to container and the other way around.
|
// to container and the other way around.
|
||||||
// When not set, MountPropagationHostToContainer is used.
|
// When not set, MountPropagationNone is used.
|
||||||
// This field is beta in 1.10.
|
// This field is beta in 1.10.
|
||||||
// +optional
|
// +optional
|
||||||
optional string mountPropagation = 5;
|
optional string mountPropagation = 5;
|
||||||
|
77
vendor/k8s.io/api/core/v1/types.go
generated
vendored
77
vendor/k8s.io/api/core/v1/types.go
generated
vendored
@ -28,6 +28,8 @@ const (
|
|||||||
NamespaceDefault string = "default"
|
NamespaceDefault string = "default"
|
||||||
// NamespaceAll is the default argument to specify on a context when you want to list or filter resources across all namespaces
|
// NamespaceAll is the default argument to specify on a context when you want to list or filter resources across all namespaces
|
||||||
NamespaceAll string = ""
|
NamespaceAll string = ""
|
||||||
|
// NamespaceNodeLease is the namespace where we place node lease objects (used for node heartbeats)
|
||||||
|
NamespaceNodeLease string = "kube-node-lease"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Volume represents a named volume in a pod that may be accessed by any container in the pod.
|
// Volume represents a named volume in a pod that may be accessed by any container in the pod.
|
||||||
@ -456,6 +458,16 @@ type PersistentVolumeClaimSpec struct {
|
|||||||
// This is an alpha feature and may change in the future.
|
// This is an alpha feature and may change in the future.
|
||||||
// +optional
|
// +optional
|
||||||
VolumeMode *PersistentVolumeMode `json:"volumeMode,omitempty" protobuf:"bytes,6,opt,name=volumeMode,casttype=PersistentVolumeMode"`
|
VolumeMode *PersistentVolumeMode `json:"volumeMode,omitempty" protobuf:"bytes,6,opt,name=volumeMode,casttype=PersistentVolumeMode"`
|
||||||
|
// This field requires the VolumeSnapshotDataSource alpha feature gate to be
|
||||||
|
// enabled and currently VolumeSnapshot is the only supported data source.
|
||||||
|
// If the provisioner can support VolumeSnapshot data source, it will create
|
||||||
|
// a new volume and data will be restored to the volume at the same time.
|
||||||
|
// If the provisioner does not support VolumeSnapshot data source, volume will
|
||||||
|
// not be created and the failure will be reported as an event.
|
||||||
|
// In the future, we plan to support more data source types and the behavior
|
||||||
|
// of the provisioner may change.
|
||||||
|
// +optional
|
||||||
|
DataSource *TypedLocalObjectReference `json:"dataSource" protobuf:"bytes,7,opt,name=dataSource"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PersistentVolumeClaimConditionType is a valid value of PersistentVolumeClaimCondition.Type
|
// PersistentVolumeClaimConditionType is a valid value of PersistentVolumeClaimCondition.Type
|
||||||
@ -859,6 +871,8 @@ const (
|
|||||||
ProtocolTCP Protocol = "TCP"
|
ProtocolTCP Protocol = "TCP"
|
||||||
// ProtocolUDP is the UDP protocol.
|
// ProtocolUDP is the UDP protocol.
|
||||||
ProtocolUDP Protocol = "UDP"
|
ProtocolUDP Protocol = "UDP"
|
||||||
|
// ProtocolSCTP is the SCTP protocol.
|
||||||
|
ProtocolSCTP Protocol = "SCTP"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Represents a Persistent Disk resource in Google Compute Engine.
|
// Represents a Persistent Disk resource in Google Compute Engine.
|
||||||
@ -1587,10 +1601,14 @@ type KeyToPath struct {
|
|||||||
type LocalVolumeSource struct {
|
type LocalVolumeSource struct {
|
||||||
// The full path to the volume on the node.
|
// The full path to the volume on the node.
|
||||||
// It can be either a directory or block device (disk, partition, ...).
|
// It can be either a directory or block device (disk, partition, ...).
|
||||||
// Directories can be represented only by PersistentVolume with VolumeMode=Filesystem.
|
|
||||||
// Block devices can be represented only by VolumeMode=Block, which also requires the
|
|
||||||
// BlockVolume alpha feature gate to be enabled.
|
|
||||||
Path string `json:"path" protobuf:"bytes,1,opt,name=path"`
|
Path string `json:"path" protobuf:"bytes,1,opt,name=path"`
|
||||||
|
|
||||||
|
// Filesystem type to mount.
|
||||||
|
// It applies only when the Path is a block device.
|
||||||
|
// Must be a filesystem type supported by the host operating system.
|
||||||
|
// Ex. "ext4", "xfs", "ntfs". The default value is to auto-select a fileystem if unspecified.
|
||||||
|
// +optional
|
||||||
|
FSType *string `json:"fsType,omitempty" protobuf:"bytes,2,opt,name=fsType"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Represents storage that is managed by an external CSI volume driver (Beta feature)
|
// Represents storage that is managed by an external CSI volume driver (Beta feature)
|
||||||
@ -1611,7 +1629,7 @@ type CSIPersistentVolumeSource struct {
|
|||||||
|
|
||||||
// Filesystem type to mount.
|
// Filesystem type to mount.
|
||||||
// Must be a filesystem type supported by the host operating system.
|
// Must be a filesystem type supported by the host operating system.
|
||||||
// Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
|
// Ex. "ext4", "xfs", "ntfs".
|
||||||
// +optional
|
// +optional
|
||||||
FSType string `json:"fsType,omitempty" protobuf:"bytes,4,opt,name=fsType"`
|
FSType string `json:"fsType,omitempty" protobuf:"bytes,4,opt,name=fsType"`
|
||||||
|
|
||||||
@ -1660,7 +1678,7 @@ type ContainerPort struct {
|
|||||||
// Number of port to expose on the pod's IP address.
|
// Number of port to expose on the pod's IP address.
|
||||||
// This must be a valid port number, 0 < x < 65536.
|
// This must be a valid port number, 0 < x < 65536.
|
||||||
ContainerPort int32 `json:"containerPort" protobuf:"varint,3,opt,name=containerPort"`
|
ContainerPort int32 `json:"containerPort" protobuf:"varint,3,opt,name=containerPort"`
|
||||||
// Protocol for port. Must be UDP or TCP.
|
// Protocol for port. Must be UDP, TCP, or SCTP.
|
||||||
// Defaults to "TCP".
|
// Defaults to "TCP".
|
||||||
// +optional
|
// +optional
|
||||||
Protocol Protocol `json:"protocol,omitempty" protobuf:"bytes,4,opt,name=protocol,casttype=Protocol"`
|
Protocol Protocol `json:"protocol,omitempty" protobuf:"bytes,4,opt,name=protocol,casttype=Protocol"`
|
||||||
@ -1686,7 +1704,7 @@ type VolumeMount struct {
|
|||||||
SubPath string `json:"subPath,omitempty" protobuf:"bytes,4,opt,name=subPath"`
|
SubPath string `json:"subPath,omitempty" protobuf:"bytes,4,opt,name=subPath"`
|
||||||
// mountPropagation determines how mounts are propagated from the host
|
// mountPropagation determines how mounts are propagated from the host
|
||||||
// to container and the other way around.
|
// to container and the other way around.
|
||||||
// When not set, MountPropagationHostToContainer is used.
|
// When not set, MountPropagationNone is used.
|
||||||
// This field is beta in 1.10.
|
// This field is beta in 1.10.
|
||||||
// +optional
|
// +optional
|
||||||
MountPropagation *MountPropagationMode `json:"mountPropagation,omitempty" protobuf:"bytes,5,opt,name=mountPropagation,casttype=MountPropagationMode"`
|
MountPropagation *MountPropagationMode `json:"mountPropagation,omitempty" protobuf:"bytes,5,opt,name=mountPropagation,casttype=MountPropagationMode"`
|
||||||
@ -2059,7 +2077,7 @@ type Container struct {
|
|||||||
Env []EnvVar `json:"env,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,7,rep,name=env"`
|
Env []EnvVar `json:"env,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,7,rep,name=env"`
|
||||||
// Compute Resources required by this container.
|
// Compute Resources required by this container.
|
||||||
// Cannot be updated.
|
// Cannot be updated.
|
||||||
// More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
|
// More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
|
||||||
// +optional
|
// +optional
|
||||||
Resources ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,8,opt,name=resources"`
|
Resources ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,8,opt,name=resources"`
|
||||||
// Pod volumes to mount into the container's filesystem.
|
// Pod volumes to mount into the container's filesystem.
|
||||||
@ -2798,7 +2816,7 @@ type PodSpec struct {
|
|||||||
// in the same pod, and the first process in each container will not be assigned PID 1.
|
// in the same pod, and the first process in each container will not be assigned PID 1.
|
||||||
// HostPID and ShareProcessNamespace cannot both be set.
|
// HostPID and ShareProcessNamespace cannot both be set.
|
||||||
// Optional: Default to false.
|
// Optional: Default to false.
|
||||||
// This field is alpha-level and is honored only by servers that enable the PodShareProcessNamespace feature.
|
// This field is beta-level and may be disabled with the PodShareProcessNamespace feature.
|
||||||
// +k8s:conversion-gen=false
|
// +k8s:conversion-gen=false
|
||||||
// +optional
|
// +optional
|
||||||
ShareProcessNamespace *bool `json:"shareProcessNamespace,omitempty" protobuf:"varint,27,opt,name=shareProcessNamespace"`
|
ShareProcessNamespace *bool `json:"shareProcessNamespace,omitempty" protobuf:"varint,27,opt,name=shareProcessNamespace"`
|
||||||
@ -2865,6 +2883,14 @@ type PodSpec struct {
|
|||||||
// More info: https://github.com/kubernetes/community/blob/master/keps/sig-network/0007-pod-ready%2B%2B.md
|
// More info: https://github.com/kubernetes/community/blob/master/keps/sig-network/0007-pod-ready%2B%2B.md
|
||||||
// +optional
|
// +optional
|
||||||
ReadinessGates []PodReadinessGate `json:"readinessGates,omitempty" protobuf:"bytes,28,opt,name=readinessGates"`
|
ReadinessGates []PodReadinessGate `json:"readinessGates,omitempty" protobuf:"bytes,28,opt,name=readinessGates"`
|
||||||
|
// RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used
|
||||||
|
// to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run.
|
||||||
|
// If unset or empty, the "legacy" RuntimeClass will be used, which is an implicit class with an
|
||||||
|
// empty definition that uses the default runtime handler.
|
||||||
|
// More info: https://github.com/kubernetes/community/blob/master/keps/sig-node/0014-runtime-class.md
|
||||||
|
// This is an alpha feature and may change in the future.
|
||||||
|
// +optional
|
||||||
|
RuntimeClassName *string `json:"runtimeClassName,omitempty" protobuf:"bytes,29,opt,name=runtimeClassName"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the
|
// HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the
|
||||||
@ -3505,7 +3531,7 @@ type ServicePort struct {
|
|||||||
// +optional
|
// +optional
|
||||||
Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
|
Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
|
||||||
|
|
||||||
// The IP protocol for this port. Supports "TCP" and "UDP".
|
// The IP protocol for this port. Supports "TCP", "UDP", and "SCTP".
|
||||||
// Default is TCP.
|
// Default is TCP.
|
||||||
// +optional
|
// +optional
|
||||||
Protocol Protocol `json:"protocol,omitempty" protobuf:"bytes,2,opt,name=protocol,casttype=Protocol"`
|
Protocol Protocol `json:"protocol,omitempty" protobuf:"bytes,2,opt,name=protocol,casttype=Protocol"`
|
||||||
@ -3719,7 +3745,7 @@ type EndpointPort struct {
|
|||||||
Port int32 `json:"port" protobuf:"varint,2,opt,name=port"`
|
Port int32 `json:"port" protobuf:"varint,2,opt,name=port"`
|
||||||
|
|
||||||
// The IP protocol for this port.
|
// The IP protocol for this port.
|
||||||
// Must be UDP or TCP.
|
// Must be UDP, TCP, or SCTP.
|
||||||
// Default is TCP.
|
// Default is TCP.
|
||||||
// +optional
|
// +optional
|
||||||
Protocol Protocol `json:"protocol,omitempty" protobuf:"bytes,3,opt,name=protocol,casttype=Protocol"`
|
Protocol Protocol `json:"protocol,omitempty" protobuf:"bytes,3,opt,name=protocol,casttype=Protocol"`
|
||||||
@ -4466,6 +4492,17 @@ type LocalObjectReference struct {
|
|||||||
Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
|
Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TypedLocalObjectReference contains enough information to let you locate the
|
||||||
|
// typed referenced object inside the same namespace.
|
||||||
|
type TypedLocalObjectReference struct {
|
||||||
|
// APIGroup is the group for the resource being referenced
|
||||||
|
APIGroup string `json:"apiGroup" protobuf:"bytes,1,opt,name=apiGroup"`
|
||||||
|
// Kind is the type of resource being referenced
|
||||||
|
Kind string `json:"kind" protobuf:"bytes,2,opt,name=kind"`
|
||||||
|
// Name is the name of resource being referenced
|
||||||
|
Name string `json:"name" protobuf:"bytes,3,opt,name=name"`
|
||||||
|
}
|
||||||
|
|
||||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||||
|
|
||||||
// SerializedReference is a reference to serialized object.
|
// SerializedReference is a reference to serialized object.
|
||||||
@ -5165,8 +5202,28 @@ type SecurityContext struct {
|
|||||||
// 2) has CAP_SYS_ADMIN
|
// 2) has CAP_SYS_ADMIN
|
||||||
// +optional
|
// +optional
|
||||||
AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty" protobuf:"varint,7,opt,name=allowPrivilegeEscalation"`
|
AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty" protobuf:"varint,7,opt,name=allowPrivilegeEscalation"`
|
||||||
|
// procMount denotes the type of proc mount to use for the containers.
|
||||||
|
// The default is DefaultProcMount which uses the container runtime defaults for
|
||||||
|
// readonly paths and masked paths.
|
||||||
|
// This requires the ProcMountType feature flag to be enabled.
|
||||||
|
// +optional
|
||||||
|
ProcMount *ProcMountType `json:"procMount,omitEmpty" protobuf:"bytes,9,opt,name=procMount"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ProcMountType string
|
||||||
|
|
||||||
|
const (
|
||||||
|
// DefaultProcMount uses the container runtime defaults for readonly and masked
|
||||||
|
// paths for /proc. Most container runtimes mask certain paths in /proc to avoid
|
||||||
|
// accidental security exposure of special devices or information.
|
||||||
|
DefaultProcMount ProcMountType = "Default"
|
||||||
|
|
||||||
|
// UnmaskedProcMount bypasses the default masking behavior of the container
|
||||||
|
// runtime and ensures the newly created /proc the container stays in tact with
|
||||||
|
// no modifications.
|
||||||
|
UnmaskedProcMount ProcMountType = "Unmasked"
|
||||||
|
)
|
||||||
|
|
||||||
// SELinuxOptions are the labels to be applied to the container
|
// SELinuxOptions are the labels to be applied to the container
|
||||||
type SELinuxOptions struct {
|
type SELinuxOptions struct {
|
||||||
// User is a SELinux user label that applies to the container.
|
// User is a SELinux user label that applies to the container.
|
||||||
|
33
vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go
generated
vendored
33
vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go
generated
vendored
@ -121,7 +121,7 @@ var map_CSIPersistentVolumeSource = map[string]string{
|
|||||||
"driver": "Driver is the name of the driver to use for this volume. Required.",
|
"driver": "Driver is the name of the driver to use for this volume. Required.",
|
||||||
"volumeHandle": "VolumeHandle is the unique volume name returned by the CSI volume plugin’s CreateVolume to refer to the volume on all subsequent calls. Required.",
|
"volumeHandle": "VolumeHandle is the unique volume name returned by the CSI volume plugin’s CreateVolume to refer to the volume on all subsequent calls. Required.",
|
||||||
"readOnly": "Optional: The value to pass to ControllerPublishVolumeRequest. Defaults to false (read/write).",
|
"readOnly": "Optional: The value to pass to ControllerPublishVolumeRequest. Defaults to false (read/write).",
|
||||||
"fsType": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.",
|
"fsType": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\".",
|
||||||
"volumeAttributes": "Attributes of the volume to publish.",
|
"volumeAttributes": "Attributes of the volume to publish.",
|
||||||
"controllerPublishSecretRef": "ControllerPublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerPublishVolume and ControllerUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.",
|
"controllerPublishSecretRef": "ControllerPublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerPublishVolume and ControllerUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.",
|
||||||
"nodeStageSecretRef": "NodeStageSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodeStageVolume and NodeStageVolume and NodeUnstageVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.",
|
"nodeStageSecretRef": "NodeStageSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodeStageVolume and NodeStageVolume and NodeUnstageVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.",
|
||||||
@ -319,7 +319,7 @@ var map_Container = map[string]string{
|
|||||||
"ports": "List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default \"0.0.0.0\" address inside a container will be accessible from the network. Cannot be updated.",
|
"ports": "List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default \"0.0.0.0\" address inside a container will be accessible from the network. Cannot be updated.",
|
||||||
"envFrom": "List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.",
|
"envFrom": "List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.",
|
||||||
"env": "List of environment variables to set in the container. Cannot be updated.",
|
"env": "List of environment variables to set in the container. Cannot be updated.",
|
||||||
"resources": "Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources",
|
"resources": "Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/",
|
||||||
"volumeMounts": "Pod volumes to mount into the container's filesystem. Cannot be updated.",
|
"volumeMounts": "Pod volumes to mount into the container's filesystem. Cannot be updated.",
|
||||||
"volumeDevices": "volumeDevices is the list of block devices to be used by the container. This is an alpha feature and may change in the future.",
|
"volumeDevices": "volumeDevices is the list of block devices to be used by the container. This is an alpha feature and may change in the future.",
|
||||||
"livenessProbe": "Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes",
|
"livenessProbe": "Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes",
|
||||||
@ -353,7 +353,7 @@ var map_ContainerPort = map[string]string{
|
|||||||
"name": "If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.",
|
"name": "If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.",
|
||||||
"hostPort": "Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this.",
|
"hostPort": "Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this.",
|
||||||
"containerPort": "Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536.",
|
"containerPort": "Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536.",
|
||||||
"protocol": "Protocol for port. Must be UDP or TCP. Defaults to \"TCP\".",
|
"protocol": "Protocol for port. Must be UDP, TCP, or SCTP. Defaults to \"TCP\".",
|
||||||
"hostIP": "What host IP to bind the external port to.",
|
"hostIP": "What host IP to bind the external port to.",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -488,7 +488,7 @@ var map_EndpointPort = map[string]string{
|
|||||||
"": "EndpointPort is a tuple that describes a single port.",
|
"": "EndpointPort is a tuple that describes a single port.",
|
||||||
"name": "The name of this port (corresponds to ServicePort.Name). Must be a DNS_LABEL. Optional only if one port is defined.",
|
"name": "The name of this port (corresponds to ServicePort.Name). Must be a DNS_LABEL. Optional only if one port is defined.",
|
||||||
"port": "The port number of the endpoint.",
|
"port": "The port number of the endpoint.",
|
||||||
"protocol": "The IP protocol for this port. Must be UDP or TCP. Default is TCP.",
|
"protocol": "The IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP.",
|
||||||
}
|
}
|
||||||
|
|
||||||
func (EndpointPort) SwaggerDoc() map[string]string {
|
func (EndpointPort) SwaggerDoc() map[string]string {
|
||||||
@ -891,8 +891,9 @@ func (LocalObjectReference) SwaggerDoc() map[string]string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var map_LocalVolumeSource = map[string]string{
|
var map_LocalVolumeSource = map[string]string{
|
||||||
"": "Local represents directly-attached storage with node affinity (Beta feature)",
|
"": "Local represents directly-attached storage with node affinity (Beta feature)",
|
||||||
"path": "The full path to the volume on the node. It can be either a directory or block device (disk, partition, ...). Directories can be represented only by PersistentVolume with VolumeMode=Filesystem. Block devices can be represented only by VolumeMode=Block, which also requires the BlockVolume alpha feature gate to be enabled.",
|
"path": "The full path to the volume on the node. It can be either a directory or block device (disk, partition, ...).",
|
||||||
|
"fsType": "Filesystem type to mount. It applies only when the Path is a block device. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default value is to auto-select a fileystem if unspecified.",
|
||||||
}
|
}
|
||||||
|
|
||||||
func (LocalVolumeSource) SwaggerDoc() map[string]string {
|
func (LocalVolumeSource) SwaggerDoc() map[string]string {
|
||||||
@ -1210,6 +1211,7 @@ var map_PersistentVolumeClaimSpec = map[string]string{
|
|||||||
"volumeName": "VolumeName is the binding reference to the PersistentVolume backing this claim.",
|
"volumeName": "VolumeName is the binding reference to the PersistentVolume backing this claim.",
|
||||||
"storageClassName": "Name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1",
|
"storageClassName": "Name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1",
|
||||||
"volumeMode": "volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. This is an alpha feature and may change in the future.",
|
"volumeMode": "volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. This is an alpha feature and may change in the future.",
|
||||||
|
"dataSource": "This field requires the VolumeSnapshotDataSource alpha feature gate to be enabled and currently VolumeSnapshot is the only supported data source. If the provisioner can support VolumeSnapshot data source, it will create a new volume and data will be restored to the volume at the same time. If the provisioner does not support VolumeSnapshot data source, volume will not be created and the failure will be reported as an event. In the future, we plan to support more data source types and the behavior of the provisioner may change.",
|
||||||
}
|
}
|
||||||
|
|
||||||
func (PersistentVolumeClaimSpec) SwaggerDoc() map[string]string {
|
func (PersistentVolumeClaimSpec) SwaggerDoc() map[string]string {
|
||||||
@ -1512,7 +1514,7 @@ var map_PodSpec = map[string]string{
|
|||||||
"hostNetwork": "Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false.",
|
"hostNetwork": "Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false.",
|
||||||
"hostPID": "Use the host's pid namespace. Optional: Default to false.",
|
"hostPID": "Use the host's pid namespace. Optional: Default to false.",
|
||||||
"hostIPC": "Use the host's ipc namespace. Optional: Default to false.",
|
"hostIPC": "Use the host's ipc namespace. Optional: Default to false.",
|
||||||
"shareProcessNamespace": "Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false. This field is alpha-level and is honored only by servers that enable the PodShareProcessNamespace feature.",
|
"shareProcessNamespace": "Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false. This field is beta-level and may be disabled with the PodShareProcessNamespace feature.",
|
||||||
"securityContext": "SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.",
|
"securityContext": "SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.",
|
||||||
"imagePullSecrets": "ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod",
|
"imagePullSecrets": "ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod",
|
||||||
"hostname": "Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value.",
|
"hostname": "Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value.",
|
||||||
@ -1525,6 +1527,7 @@ var map_PodSpec = map[string]string{
|
|||||||
"priority": "The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority.",
|
"priority": "The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority.",
|
||||||
"dnsConfig": "Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy.",
|
"dnsConfig": "Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy.",
|
||||||
"readinessGates": "If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness gates have status equal to \"True\" More info: https://github.com/kubernetes/community/blob/master/keps/sig-network/0007-pod-ready%2B%2B.md",
|
"readinessGates": "If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness gates have status equal to \"True\" More info: https://github.com/kubernetes/community/blob/master/keps/sig-network/0007-pod-ready%2B%2B.md",
|
||||||
|
"runtimeClassName": "RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the \"legacy\" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: https://github.com/kubernetes/community/blob/master/keps/sig-node/0014-runtime-class.md This is an alpha feature and may change in the future.",
|
||||||
}
|
}
|
||||||
|
|
||||||
func (PodSpec) SwaggerDoc() map[string]string {
|
func (PodSpec) SwaggerDoc() map[string]string {
|
||||||
@ -1985,6 +1988,7 @@ var map_SecurityContext = map[string]string{
|
|||||||
"runAsNonRoot": "Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.",
|
"runAsNonRoot": "Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.",
|
||||||
"readOnlyRootFilesystem": "Whether this container has a read-only root filesystem. Default is false.",
|
"readOnlyRootFilesystem": "Whether this container has a read-only root filesystem. Default is false.",
|
||||||
"allowPrivilegeEscalation": "AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN",
|
"allowPrivilegeEscalation": "AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN",
|
||||||
|
"procMount": "procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled.",
|
||||||
}
|
}
|
||||||
|
|
||||||
func (SecurityContext) SwaggerDoc() map[string]string {
|
func (SecurityContext) SwaggerDoc() map[string]string {
|
||||||
@ -2057,7 +2061,7 @@ func (ServiceList) SwaggerDoc() map[string]string {
|
|||||||
var map_ServicePort = map[string]string{
|
var map_ServicePort = map[string]string{
|
||||||
"": "ServicePort contains information on service's port.",
|
"": "ServicePort contains information on service's port.",
|
||||||
"name": "The name of this port within the service. This must be a DNS_LABEL. All ports within a ServiceSpec must have unique names. This maps to the 'Name' field in EndpointPort objects. Optional if only one ServicePort is defined on this service.",
|
"name": "The name of this port within the service. This must be a DNS_LABEL. All ports within a ServiceSpec must have unique names. This maps to the 'Name' field in EndpointPort objects. Optional if only one ServicePort is defined on this service.",
|
||||||
"protocol": "The IP protocol for this port. Supports \"TCP\" and \"UDP\". Default is TCP.",
|
"protocol": "The IP protocol for this port. Supports \"TCP\", \"UDP\", and \"SCTP\". Default is TCP.",
|
||||||
"port": "The port that will be exposed by this service.",
|
"port": "The port that will be exposed by this service.",
|
||||||
"targetPort": "Number or name of the port to access on the pods targeted by the service. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. If this is a string, it will be looked up as a named port in the target Pod's container ports. If this is not specified, the value of the 'port' field is used (an identity map). This field is ignored for services with clusterIP=None, and should be omitted or set equal to the 'port' field. More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service",
|
"targetPort": "Number or name of the port to access on the pods targeted by the service. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. If this is a string, it will be looked up as a named port in the target Pod's container ports. If this is not specified, the value of the 'port' field is used (an identity map). This field is ignored for services with clusterIP=None, and should be omitted or set equal to the 'port' field. More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service",
|
||||||
"nodePort": "The port on each node on which this service is exposed when type=NodePort or LoadBalancer. Usually assigned by the system. If specified, it will be allocated to the service if unused or else creation of the service will fail. Default is to auto-allocate a port if the ServiceType of this Service requires one. More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport",
|
"nodePort": "The port on each node on which this service is exposed when type=NodePort or LoadBalancer. Usually assigned by the system. If specified, it will be allocated to the service if unused or else creation of the service will fail. Default is to auto-allocate a port if the ServiceType of this Service requires one. More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport",
|
||||||
@ -2205,6 +2209,17 @@ func (TopologySelectorTerm) SwaggerDoc() map[string]string {
|
|||||||
return map_TopologySelectorTerm
|
return map_TopologySelectorTerm
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var map_TypedLocalObjectReference = map[string]string{
|
||||||
|
"": "TypedLocalObjectReference contains enough information to let you locate the typed referenced object inside the same namespace.",
|
||||||
|
"apiGroup": "APIGroup is the group for the resource being referenced",
|
||||||
|
"kind": "Kind is the type of resource being referenced",
|
||||||
|
"name": "Name is the name of resource being referenced",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (TypedLocalObjectReference) SwaggerDoc() map[string]string {
|
||||||
|
return map_TypedLocalObjectReference
|
||||||
|
}
|
||||||
|
|
||||||
var map_Volume = map[string]string{
|
var map_Volume = map[string]string{
|
||||||
"": "Volume represents a named volume in a pod that may be accessed by any container in the pod.",
|
"": "Volume represents a named volume in a pod that may be accessed by any container in the pod.",
|
||||||
"name": "Volume's name. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
|
"name": "Volume's name. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
|
||||||
@ -2230,7 +2245,7 @@ var map_VolumeMount = map[string]string{
|
|||||||
"readOnly": "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false.",
|
"readOnly": "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false.",
|
||||||
"mountPath": "Path within the container at which the volume should be mounted. Must not contain ':'.",
|
"mountPath": "Path within the container at which the volume should be mounted. Must not contain ':'.",
|
||||||
"subPath": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root).",
|
"subPath": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root).",
|
||||||
"mountPropagation": "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is beta in 1.10.",
|
"mountPropagation": "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10.",
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VolumeMount) SwaggerDoc() map[string]string {
|
func (VolumeMount) SwaggerDoc() map[string]string {
|
||||||
|
46
vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go
generated
vendored
46
vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go
generated
vendored
@ -21,7 +21,7 @@ limitations under the License.
|
|||||||
package v1
|
package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||||
types "k8s.io/apimachinery/pkg/types"
|
types "k8s.io/apimachinery/pkg/types"
|
||||||
)
|
)
|
||||||
@ -1957,6 +1957,11 @@ func (in *LocalObjectReference) DeepCopy() *LocalObjectReference {
|
|||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in *LocalVolumeSource) DeepCopyInto(out *LocalVolumeSource) {
|
func (in *LocalVolumeSource) DeepCopyInto(out *LocalVolumeSource) {
|
||||||
*out = *in
|
*out = *in
|
||||||
|
if in.FSType != nil {
|
||||||
|
in, out := &in.FSType, &out.FSType
|
||||||
|
*out = new(string)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2665,7 +2670,7 @@ func (in *PersistentVolumeClaimSpec) DeepCopyInto(out *PersistentVolumeClaimSpec
|
|||||||
}
|
}
|
||||||
if in.Selector != nil {
|
if in.Selector != nil {
|
||||||
in, out := &in.Selector, &out.Selector
|
in, out := &in.Selector, &out.Selector
|
||||||
*out = new(meta_v1.LabelSelector)
|
*out = new(metav1.LabelSelector)
|
||||||
(*in).DeepCopyInto(*out)
|
(*in).DeepCopyInto(*out)
|
||||||
}
|
}
|
||||||
in.Resources.DeepCopyInto(&out.Resources)
|
in.Resources.DeepCopyInto(&out.Resources)
|
||||||
@ -2679,6 +2684,11 @@ func (in *PersistentVolumeClaimSpec) DeepCopyInto(out *PersistentVolumeClaimSpec
|
|||||||
*out = new(PersistentVolumeMode)
|
*out = new(PersistentVolumeMode)
|
||||||
**out = **in
|
**out = **in
|
||||||
}
|
}
|
||||||
|
if in.DataSource != nil {
|
||||||
|
in, out := &in.DataSource, &out.DataSource
|
||||||
|
*out = new(TypedLocalObjectReference)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2877,7 +2887,7 @@ func (in *PersistentVolumeSource) DeepCopyInto(out *PersistentVolumeSource) {
|
|||||||
if in.Local != nil {
|
if in.Local != nil {
|
||||||
in, out := &in.Local, &out.Local
|
in, out := &in.Local, &out.Local
|
||||||
*out = new(LocalVolumeSource)
|
*out = new(LocalVolumeSource)
|
||||||
**out = **in
|
(*in).DeepCopyInto(*out)
|
||||||
}
|
}
|
||||||
if in.StorageOS != nil {
|
if in.StorageOS != nil {
|
||||||
in, out := &in.StorageOS, &out.StorageOS
|
in, out := &in.StorageOS, &out.StorageOS
|
||||||
@ -3046,7 +3056,7 @@ func (in *PodAffinityTerm) DeepCopyInto(out *PodAffinityTerm) {
|
|||||||
*out = *in
|
*out = *in
|
||||||
if in.LabelSelector != nil {
|
if in.LabelSelector != nil {
|
||||||
in, out := &in.LabelSelector, &out.LabelSelector
|
in, out := &in.LabelSelector, &out.LabelSelector
|
||||||
*out = new(meta_v1.LabelSelector)
|
*out = new(metav1.LabelSelector)
|
||||||
(*in).DeepCopyInto(*out)
|
(*in).DeepCopyInto(*out)
|
||||||
}
|
}
|
||||||
if in.Namespaces != nil {
|
if in.Namespaces != nil {
|
||||||
@ -3428,7 +3438,7 @@ func (in *PodSignature) DeepCopyInto(out *PodSignature) {
|
|||||||
*out = *in
|
*out = *in
|
||||||
if in.PodController != nil {
|
if in.PodController != nil {
|
||||||
in, out := &in.PodController, &out.PodController
|
in, out := &in.PodController, &out.PodController
|
||||||
*out = new(meta_v1.OwnerReference)
|
*out = new(metav1.OwnerReference)
|
||||||
(*in).DeepCopyInto(*out)
|
(*in).DeepCopyInto(*out)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
@ -3539,6 +3549,11 @@ func (in *PodSpec) DeepCopyInto(out *PodSpec) {
|
|||||||
*out = make([]PodReadinessGate, len(*in))
|
*out = make([]PodReadinessGate, len(*in))
|
||||||
copy(*out, *in)
|
copy(*out, *in)
|
||||||
}
|
}
|
||||||
|
if in.RuntimeClassName != nil {
|
||||||
|
in, out := &in.RuntimeClassName, &out.RuntimeClassName
|
||||||
|
*out = new(string)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4589,6 +4604,11 @@ func (in *SecurityContext) DeepCopyInto(out *SecurityContext) {
|
|||||||
*out = new(bool)
|
*out = new(bool)
|
||||||
**out = **in
|
**out = **in
|
||||||
}
|
}
|
||||||
|
if in.ProcMount != nil {
|
||||||
|
in, out := &in.ProcMount, &out.ProcMount
|
||||||
|
*out = new(ProcMountType)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5067,6 +5087,22 @@ func (in *TopologySelectorTerm) DeepCopy() *TopologySelectorTerm {
|
|||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *TypedLocalObjectReference) DeepCopyInto(out *TypedLocalObjectReference) {
|
||||||
|
*out = *in
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TypedLocalObjectReference.
|
||||||
|
func (in *TypedLocalObjectReference) DeepCopy() *TypedLocalObjectReference {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(TypedLocalObjectReference)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in *Volume) DeepCopyInto(out *Volume) {
|
func (in *Volume) DeepCopyInto(out *Volume) {
|
||||||
*out = *in
|
*out = *in
|
||||||
|
43
vendor/k8s.io/apimachinery/pkg/api/resource/generated.pb.go
generated
vendored
43
vendor/k8s.io/apimachinery/pkg/api/resource/generated.pb.go
generated
vendored
@ -19,13 +19,13 @@ limitations under the License.
|
|||||||
// DO NOT EDIT!
|
// DO NOT EDIT!
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Package resource is a generated protocol buffer package.
|
Package resource is a generated protocol buffer package.
|
||||||
|
|
||||||
It is generated from these files:
|
It is generated from these files:
|
||||||
k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/api/resource/generated.proto
|
k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/api/resource/generated.proto
|
||||||
|
|
||||||
It has these top-level messages:
|
It has these top-level messages:
|
||||||
Quantity
|
Quantity
|
||||||
*/
|
*/
|
||||||
package resource
|
package resource
|
||||||
|
|
||||||
@ -57,21 +57,20 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var fileDescriptorGenerated = []byte{
|
var fileDescriptorGenerated = []byte{
|
||||||
// 255 bytes of a gzipped FileDescriptorProto
|
// 237 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x8f, 0xa1, 0x4e, 0x03, 0x41,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x8e, 0xb1, 0x4e, 0xc3, 0x30,
|
||||||
0x10, 0x86, 0x77, 0x0d, 0x29, 0x95, 0x0d, 0x21, 0xa4, 0x62, 0xaf, 0x21, 0x08, 0x0c, 0x3b, 0x02,
|
0x10, 0x40, 0xcf, 0x0b, 0x2a, 0x19, 0x2b, 0x84, 0x10, 0xc3, 0xa5, 0x42, 0x0c, 0x2c, 0xd8, 0x6b,
|
||||||
0xd3, 0x20, 0xf1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a, 0xdd, 0x2a, 0xb1, 0x69, 0x95, 0xd8, 0xb6, 0x4a, 0x2c, 0x92, 0x92, 0xeb,
|
0xc5, 0x2e, 0xa2, 0xd8, 0x47, 0x14, 0xbf, 0x11, 0xc5, 0xfa, 0x0f, 0xe1, 0x7d, 0x34, 0x3c, 0xf6,
|
||||||
0xa4, 0xe4, 0x26, 0x29, 0xb9, 0x4d, 0x4a, 0x7e, 0x25, 0x25, 0x97, 0xdf, 0x4a, 0x3c, 0xf7, 0x8e,
|
0x1f, 0x00, 0x00, 0xff, 0xff, 0x3c, 0x08, 0x88, 0x49, 0x0e, 0x01, 0x00, 0x00,
|
||||||
0xdf, 0xfc, 0x04, 0x00, 0x00, 0xff, 0xff, 0x5f, 0x5e, 0xda, 0xf9, 0x43, 0x01, 0x00, 0x00,
|
|
||||||
}
|
}
|
||||||
|
2
vendor/k8s.io/apimachinery/pkg/api/resource/generated.proto
generated
vendored
2
vendor/k8s.io/apimachinery/pkg/api/resource/generated.proto
generated
vendored
@ -21,8 +21,6 @@ syntax = 'proto2';
|
|||||||
|
|
||||||
package k8s.io.apimachinery.pkg.api.resource;
|
package k8s.io.apimachinery.pkg.api.resource;
|
||||||
|
|
||||||
import "k8s.io/apimachinery/pkg/util/intstr/generated.proto";
|
|
||||||
|
|
||||||
// Package-wide variables from generator "generated".
|
// Package-wide variables from generator "generated".
|
||||||
option go_package = "resource";
|
option go_package = "resource";
|
||||||
|
|
||||||
|
4
vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go
generated
vendored
4
vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go
generated
vendored
@ -21,7 +21,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/big"
|
"math/big"
|
||||||
"regexp"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@ -137,9 +136,6 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// splitRE is used to get the various parts of a number.
|
|
||||||
splitRE = regexp.MustCompile(splitREString)
|
|
||||||
|
|
||||||
// Errors that could happen while parsing a string.
|
// Errors that could happen while parsing a string.
|
||||||
ErrFormatWrong = errors.New("quantities must match the regular expression '" + splitREString + "'")
|
ErrFormatWrong = errors.New("quantities must match the regular expression '" + splitREString + "'")
|
||||||
ErrNumeric = errors.New("unable to parse numeric part of quantity")
|
ErrNumeric = errors.New("unable to parse numeric part of quantity")
|
||||||
|
23
vendor/k8s.io/apimachinery/pkg/apis/meta/internalversion/conversion.go
generated
vendored
23
vendor/k8s.io/apimachinery/pkg/apis/meta/internalversion/conversion.go
generated
vendored
@ -17,11 +17,8 @@ limitations under the License.
|
|||||||
package internalversion
|
package internalversion
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/conversion"
|
"k8s.io/apimachinery/pkg/conversion"
|
||||||
"k8s.io/apimachinery/pkg/util/validation/field"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func Convert_internalversion_ListOptions_To_v1_ListOptions(in *ListOptions, out *metav1.ListOptions, s conversion.Scope) error {
|
func Convert_internalversion_ListOptions_To_v1_ListOptions(in *ListOptions, out *metav1.ListOptions, s conversion.Scope) error {
|
||||||
@ -55,23 +52,3 @@ func Convert_v1_ListOptions_To_internalversion_ListOptions(in *metav1.ListOption
|
|||||||
out.Continue = in.Continue
|
out.Continue = in.Continue
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Convert_map_to_v1_LabelSelector(in *map[string]string, out *metav1.LabelSelector, s conversion.Scope) error {
|
|
||||||
if in == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
out = new(metav1.LabelSelector)
|
|
||||||
for labelKey, labelValue := range *in {
|
|
||||||
metav1.AddLabelToSelector(out, labelKey, labelValue)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func Convert_v1_LabelSelector_to_map(in *metav1.LabelSelector, out *map[string]string, s conversion.Scope) error {
|
|
||||||
var err error
|
|
||||||
*out, err = metav1.LabelSelectorAsMap(in)
|
|
||||||
if err != nil {
|
|
||||||
err = field.Invalid(field.NewPath("labelSelector"), *in, fmt.Sprintf("cannot convert to old selector: %v", err))
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
16
vendor/k8s.io/apimachinery/pkg/apis/meta/internalversion/register.go
generated
vendored
16
vendor/k8s.io/apimachinery/pkg/apis/meta/internalversion/register.go
generated
vendored
@ -57,19 +57,22 @@ func addToGroupVersion(scheme *runtime.Scheme, groupVersion schema.GroupVersion)
|
|||||||
if err := scheme.AddIgnoredConversionType(&metav1.TypeMeta{}, &metav1.TypeMeta{}); err != nil {
|
if err := scheme.AddIgnoredConversionType(&metav1.TypeMeta{}, &metav1.TypeMeta{}); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
scheme.AddConversionFuncs(
|
err := scheme.AddConversionFuncs(
|
||||||
metav1.Convert_string_To_labels_Selector,
|
metav1.Convert_string_To_labels_Selector,
|
||||||
metav1.Convert_labels_Selector_To_string,
|
metav1.Convert_labels_Selector_To_string,
|
||||||
|
|
||||||
metav1.Convert_string_To_fields_Selector,
|
metav1.Convert_string_To_fields_Selector,
|
||||||
metav1.Convert_fields_Selector_To_string,
|
metav1.Convert_fields_Selector_To_string,
|
||||||
|
|
||||||
Convert_map_to_v1_LabelSelector,
|
metav1.Convert_Map_string_To_string_To_v1_LabelSelector,
|
||||||
Convert_v1_LabelSelector_to_map,
|
metav1.Convert_v1_LabelSelector_To_Map_string_To_string,
|
||||||
|
|
||||||
Convert_internalversion_ListOptions_To_v1_ListOptions,
|
Convert_internalversion_ListOptions_To_v1_ListOptions,
|
||||||
Convert_v1_ListOptions_To_internalversion_ListOptions,
|
Convert_v1_ListOptions_To_internalversion_ListOptions,
|
||||||
)
|
)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
// ListOptions is the only options struct which needs conversion (it exposes labels and fields
|
// ListOptions is the only options struct which needs conversion (it exposes labels and fields
|
||||||
// as selectors for convenience). The other types have only a single representation today.
|
// as selectors for convenience). The other types have only a single representation today.
|
||||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||||
@ -77,6 +80,8 @@ func addToGroupVersion(scheme *runtime.Scheme, groupVersion schema.GroupVersion)
|
|||||||
&metav1.GetOptions{},
|
&metav1.GetOptions{},
|
||||||
&metav1.ExportOptions{},
|
&metav1.ExportOptions{},
|
||||||
&metav1.DeleteOptions{},
|
&metav1.DeleteOptions{},
|
||||||
|
&metav1.CreateOptions{},
|
||||||
|
&metav1.UpdateOptions{},
|
||||||
)
|
)
|
||||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||||
&metav1beta1.Table{},
|
&metav1beta1.Table{},
|
||||||
@ -91,7 +96,10 @@ func addToGroupVersion(scheme *runtime.Scheme, groupVersion schema.GroupVersion)
|
|||||||
&metav1beta1.PartialObjectMetadataList{},
|
&metav1beta1.PartialObjectMetadataList{},
|
||||||
)
|
)
|
||||||
// Allow delete options to be decoded across all version in this scheme (we may want to be more clever than this)
|
// Allow delete options to be decoded across all version in this scheme (we may want to be more clever than this)
|
||||||
scheme.AddUnversionedTypes(SchemeGroupVersion, &metav1.DeleteOptions{})
|
scheme.AddUnversionedTypes(SchemeGroupVersion,
|
||||||
|
&metav1.DeleteOptions{},
|
||||||
|
&metav1.CreateOptions{},
|
||||||
|
&metav1.UpdateOptions{})
|
||||||
metav1.AddToGroupVersion(scheme, metav1.SchemeGroupVersion)
|
metav1.AddToGroupVersion(scheme, metav1.SchemeGroupVersion)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
39
vendor/k8s.io/apimachinery/pkg/apis/meta/internalversion/zz_generated.conversion.go
generated
vendored
39
vendor/k8s.io/apimachinery/pkg/apis/meta/internalversion/zz_generated.conversion.go
generated
vendored
@ -34,13 +34,38 @@ func init() {
|
|||||||
|
|
||||||
// RegisterConversions adds conversion functions to the given scheme.
|
// RegisterConversions adds conversion functions to the given scheme.
|
||||||
// Public to allow building arbitrary schemes.
|
// Public to allow building arbitrary schemes.
|
||||||
func RegisterConversions(scheme *runtime.Scheme) error {
|
func RegisterConversions(s *runtime.Scheme) error {
|
||||||
return scheme.AddGeneratedConversionFuncs(
|
if err := s.AddGeneratedConversionFunc((*List)(nil), (*v1.List)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
Convert_internalversion_List_To_v1_List,
|
return Convert_internalversion_List_To_v1_List(a.(*List), b.(*v1.List), scope)
|
||||||
Convert_v1_List_To_internalversion_List,
|
}); err != nil {
|
||||||
Convert_internalversion_ListOptions_To_v1_ListOptions,
|
return err
|
||||||
Convert_v1_ListOptions_To_internalversion_ListOptions,
|
}
|
||||||
)
|
if err := s.AddGeneratedConversionFunc((*v1.List)(nil), (*List)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
|
return Convert_v1_List_To_internalversion_List(a.(*v1.List), b.(*List), scope)
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := s.AddGeneratedConversionFunc((*ListOptions)(nil), (*v1.ListOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
|
return Convert_internalversion_ListOptions_To_v1_ListOptions(a.(*ListOptions), b.(*v1.ListOptions), scope)
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := s.AddGeneratedConversionFunc((*v1.ListOptions)(nil), (*ListOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
|
return Convert_v1_ListOptions_To_internalversion_ListOptions(a.(*v1.ListOptions), b.(*ListOptions), scope)
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := s.AddConversionFunc((*ListOptions)(nil), (*v1.ListOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
|
return Convert_internalversion_ListOptions_To_v1_ListOptions(a.(*ListOptions), b.(*v1.ListOptions), scope)
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := s.AddConversionFunc((*v1.ListOptions)(nil), (*ListOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
|
return Convert_v1_ListOptions_To_internalversion_ListOptions(a.(*v1.ListOptions), b.(*ListOptions), scope)
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func autoConvert_internalversion_List_To_v1_List(in *List, out *v1.List, s conversion.Scope) error {
|
func autoConvert_internalversion_List_To_v1_List(in *List, out *v1.List, s conversion.Scope) error {
|
||||||
|
12
vendor/k8s.io/apimachinery/pkg/apis/meta/internalversion/zz_generated.deepcopy.go
generated
vendored
12
vendor/k8s.io/apimachinery/pkg/apis/meta/internalversion/zz_generated.deepcopy.go
generated
vendored
@ -33,9 +33,7 @@ func (in *List) DeepCopyInto(out *List) {
|
|||||||
in, out := &in.Items, &out.Items
|
in, out := &in.Items, &out.Items
|
||||||
*out = make([]runtime.Object, len(*in))
|
*out = make([]runtime.Object, len(*in))
|
||||||
for i := range *in {
|
for i := range *in {
|
||||||
if (*in)[i] == nil {
|
if (*in)[i] != nil {
|
||||||
(*out)[i] = nil
|
|
||||||
} else {
|
|
||||||
(*out)[i] = (*in)[i].DeepCopyObject()
|
(*out)[i] = (*in)[i].DeepCopyObject()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -65,14 +63,10 @@ func (in *List) DeepCopyObject() runtime.Object {
|
|||||||
func (in *ListOptions) DeepCopyInto(out *ListOptions) {
|
func (in *ListOptions) DeepCopyInto(out *ListOptions) {
|
||||||
*out = *in
|
*out = *in
|
||||||
out.TypeMeta = in.TypeMeta
|
out.TypeMeta = in.TypeMeta
|
||||||
if in.LabelSelector == nil {
|
if in.LabelSelector != nil {
|
||||||
out.LabelSelector = nil
|
|
||||||
} else {
|
|
||||||
out.LabelSelector = in.LabelSelector.DeepCopySelector()
|
out.LabelSelector = in.LabelSelector.DeepCopySelector()
|
||||||
}
|
}
|
||||||
if in.FieldSelector == nil {
|
if in.FieldSelector != nil {
|
||||||
out.FieldSelector = nil
|
|
||||||
} else {
|
|
||||||
out.FieldSelector = in.FieldSelector.DeepCopySelector()
|
out.FieldSelector = in.FieldSelector.DeepCopySelector()
|
||||||
}
|
}
|
||||||
if in.TimeoutSeconds != nil {
|
if in.TimeoutSeconds != nil {
|
||||||
|
39
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go
generated
vendored
39
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go
generated
vendored
@ -33,17 +33,17 @@ func AddConversionFuncs(scheme *runtime.Scheme) error {
|
|||||||
return scheme.AddConversionFuncs(
|
return scheme.AddConversionFuncs(
|
||||||
Convert_v1_TypeMeta_To_v1_TypeMeta,
|
Convert_v1_TypeMeta_To_v1_TypeMeta,
|
||||||
|
|
||||||
Convert_unversioned_ListMeta_To_unversioned_ListMeta,
|
Convert_v1_ListMeta_To_v1_ListMeta,
|
||||||
|
|
||||||
Convert_intstr_IntOrString_To_intstr_IntOrString,
|
Convert_intstr_IntOrString_To_intstr_IntOrString,
|
||||||
|
|
||||||
Convert_unversioned_Time_To_unversioned_Time,
|
|
||||||
Convert_unversioned_MicroTime_To_unversioned_MicroTime,
|
|
||||||
|
|
||||||
Convert_Pointer_v1_Duration_To_v1_Duration,
|
Convert_Pointer_v1_Duration_To_v1_Duration,
|
||||||
Convert_v1_Duration_To_Pointer_v1_Duration,
|
Convert_v1_Duration_To_Pointer_v1_Duration,
|
||||||
|
|
||||||
Convert_Slice_string_To_unversioned_Time,
|
Convert_Slice_string_To_v1_Time,
|
||||||
|
|
||||||
|
Convert_v1_Time_To_v1_Time,
|
||||||
|
Convert_v1_MicroTime_To_v1_MicroTime,
|
||||||
|
|
||||||
Convert_resource_Quantity_To_resource_Quantity,
|
Convert_resource_Quantity_To_resource_Quantity,
|
||||||
|
|
||||||
@ -71,8 +71,8 @@ func AddConversionFuncs(scheme *runtime.Scheme) error {
|
|||||||
Convert_Pointer_float64_To_float64,
|
Convert_Pointer_float64_To_float64,
|
||||||
Convert_float64_To_Pointer_float64,
|
Convert_float64_To_Pointer_float64,
|
||||||
|
|
||||||
Convert_map_to_unversioned_LabelSelector,
|
Convert_Map_string_To_string_To_v1_LabelSelector,
|
||||||
Convert_unversioned_LabelSelector_to_map,
|
Convert_v1_LabelSelector_To_Map_string_To_string,
|
||||||
|
|
||||||
Convert_Slice_string_To_Slice_int32,
|
Convert_Slice_string_To_Slice_int32,
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ func Convert_v1_TypeMeta_To_v1_TypeMeta(in, out *TypeMeta, s conversion.Scope) e
|
|||||||
}
|
}
|
||||||
|
|
||||||
// +k8s:conversion-fn=copy-only
|
// +k8s:conversion-fn=copy-only
|
||||||
func Convert_unversioned_ListMeta_To_unversioned_ListMeta(in, out *ListMeta, s conversion.Scope) error {
|
func Convert_v1_ListMeta_To_v1_ListMeta(in, out *ListMeta, s conversion.Scope) error {
|
||||||
*out = *in
|
*out = *in
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -199,7 +199,14 @@ func Convert_intstr_IntOrString_To_intstr_IntOrString(in, out *intstr.IntOrStrin
|
|||||||
}
|
}
|
||||||
|
|
||||||
// +k8s:conversion-fn=copy-only
|
// +k8s:conversion-fn=copy-only
|
||||||
func Convert_unversioned_Time_To_unversioned_Time(in *Time, out *Time, s conversion.Scope) error {
|
func Convert_v1_Time_To_v1_Time(in *Time, out *Time, s conversion.Scope) error {
|
||||||
|
// Cannot deep copy these, because time.Time has unexported fields.
|
||||||
|
*out = *in
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// +k8s:conversion-fn=copy-only
|
||||||
|
func Convert_v1_MicroTime_To_v1_MicroTime(in *MicroTime, out *MicroTime, s conversion.Scope) error {
|
||||||
// Cannot deep copy these, because time.Time has unexported fields.
|
// Cannot deep copy these, because time.Time has unexported fields.
|
||||||
*out = *in
|
*out = *in
|
||||||
return nil
|
return nil
|
||||||
@ -220,14 +227,8 @@ func Convert_v1_Duration_To_Pointer_v1_Duration(in *Duration, out **Duration, s
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Convert_unversioned_MicroTime_To_unversioned_MicroTime(in *MicroTime, out *MicroTime, s conversion.Scope) error {
|
// Convert_Slice_string_To_v1_Time allows converting a URL query parameter value
|
||||||
// Cannot deep copy these, because time.Time has unexported fields.
|
func Convert_Slice_string_To_v1_Time(input *[]string, out *Time, s conversion.Scope) error {
|
||||||
*out = *in
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Convert_Slice_string_To_unversioned_Time allows converting a URL query parameter value
|
|
||||||
func Convert_Slice_string_To_unversioned_Time(input *[]string, out *Time, s conversion.Scope) error {
|
|
||||||
str := ""
|
str := ""
|
||||||
if len(*input) > 0 {
|
if len(*input) > 0 {
|
||||||
str = (*input)[0]
|
str = (*input)[0]
|
||||||
@ -275,7 +276,7 @@ func Convert_resource_Quantity_To_resource_Quantity(in *resource.Quantity, out *
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Convert_map_to_unversioned_LabelSelector(in *map[string]string, out *LabelSelector, s conversion.Scope) error {
|
func Convert_Map_string_To_string_To_v1_LabelSelector(in *map[string]string, out *LabelSelector, s conversion.Scope) error {
|
||||||
if in == nil {
|
if in == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -285,7 +286,7 @@ func Convert_map_to_unversioned_LabelSelector(in *map[string]string, out *LabelS
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Convert_unversioned_LabelSelector_to_map(in *LabelSelector, out *map[string]string, s conversion.Scope) error {
|
func Convert_v1_LabelSelector_To_Map_string_To_string(in *LabelSelector, out *map[string]string, s conversion.Scope) error {
|
||||||
var err error
|
var err error
|
||||||
*out, err = LabelSelectorAsMap(in)
|
*out, err = LabelSelectorAsMap(in)
|
||||||
return err
|
return err
|
||||||
|
733
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go
generated
vendored
733
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go
generated
vendored
@ -30,6 +30,7 @@ limitations under the License.
|
|||||||
APIResource
|
APIResource
|
||||||
APIResourceList
|
APIResourceList
|
||||||
APIVersions
|
APIVersions
|
||||||
|
CreateOptions
|
||||||
DeleteOptions
|
DeleteOptions
|
||||||
Duration
|
Duration
|
||||||
ExportOptions
|
ExportOptions
|
||||||
@ -60,6 +61,7 @@ limitations under the License.
|
|||||||
Time
|
Time
|
||||||
Timestamp
|
Timestamp
|
||||||
TypeMeta
|
TypeMeta
|
||||||
|
UpdateOptions
|
||||||
Verbs
|
Verbs
|
||||||
WatchEvent
|
WatchEvent
|
||||||
*/
|
*/
|
||||||
@ -113,139 +115,147 @@ func (m *APIVersions) Reset() { *m = APIVersions{} }
|
|||||||
func (*APIVersions) ProtoMessage() {}
|
func (*APIVersions) ProtoMessage() {}
|
||||||
func (*APIVersions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{4} }
|
func (*APIVersions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{4} }
|
||||||
|
|
||||||
|
func (m *CreateOptions) Reset() { *m = CreateOptions{} }
|
||||||
|
func (*CreateOptions) ProtoMessage() {}
|
||||||
|
func (*CreateOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{5} }
|
||||||
|
|
||||||
func (m *DeleteOptions) Reset() { *m = DeleteOptions{} }
|
func (m *DeleteOptions) Reset() { *m = DeleteOptions{} }
|
||||||
func (*DeleteOptions) ProtoMessage() {}
|
func (*DeleteOptions) ProtoMessage() {}
|
||||||
func (*DeleteOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{5} }
|
func (*DeleteOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{6} }
|
||||||
|
|
||||||
func (m *Duration) Reset() { *m = Duration{} }
|
func (m *Duration) Reset() { *m = Duration{} }
|
||||||
func (*Duration) ProtoMessage() {}
|
func (*Duration) ProtoMessage() {}
|
||||||
func (*Duration) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{6} }
|
func (*Duration) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{7} }
|
||||||
|
|
||||||
func (m *ExportOptions) Reset() { *m = ExportOptions{} }
|
func (m *ExportOptions) Reset() { *m = ExportOptions{} }
|
||||||
func (*ExportOptions) ProtoMessage() {}
|
func (*ExportOptions) ProtoMessage() {}
|
||||||
func (*ExportOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{7} }
|
func (*ExportOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{8} }
|
||||||
|
|
||||||
func (m *GetOptions) Reset() { *m = GetOptions{} }
|
func (m *GetOptions) Reset() { *m = GetOptions{} }
|
||||||
func (*GetOptions) ProtoMessage() {}
|
func (*GetOptions) ProtoMessage() {}
|
||||||
func (*GetOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{8} }
|
func (*GetOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{9} }
|
||||||
|
|
||||||
func (m *GroupKind) Reset() { *m = GroupKind{} }
|
func (m *GroupKind) Reset() { *m = GroupKind{} }
|
||||||
func (*GroupKind) ProtoMessage() {}
|
func (*GroupKind) ProtoMessage() {}
|
||||||
func (*GroupKind) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{9} }
|
func (*GroupKind) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{10} }
|
||||||
|
|
||||||
func (m *GroupResource) Reset() { *m = GroupResource{} }
|
func (m *GroupResource) Reset() { *m = GroupResource{} }
|
||||||
func (*GroupResource) ProtoMessage() {}
|
func (*GroupResource) ProtoMessage() {}
|
||||||
func (*GroupResource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{10} }
|
func (*GroupResource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{11} }
|
||||||
|
|
||||||
func (m *GroupVersion) Reset() { *m = GroupVersion{} }
|
func (m *GroupVersion) Reset() { *m = GroupVersion{} }
|
||||||
func (*GroupVersion) ProtoMessage() {}
|
func (*GroupVersion) ProtoMessage() {}
|
||||||
func (*GroupVersion) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{11} }
|
func (*GroupVersion) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{12} }
|
||||||
|
|
||||||
func (m *GroupVersionForDiscovery) Reset() { *m = GroupVersionForDiscovery{} }
|
func (m *GroupVersionForDiscovery) Reset() { *m = GroupVersionForDiscovery{} }
|
||||||
func (*GroupVersionForDiscovery) ProtoMessage() {}
|
func (*GroupVersionForDiscovery) ProtoMessage() {}
|
||||||
func (*GroupVersionForDiscovery) Descriptor() ([]byte, []int) {
|
func (*GroupVersionForDiscovery) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptorGenerated, []int{12}
|
return fileDescriptorGenerated, []int{13}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *GroupVersionKind) Reset() { *m = GroupVersionKind{} }
|
func (m *GroupVersionKind) Reset() { *m = GroupVersionKind{} }
|
||||||
func (*GroupVersionKind) ProtoMessage() {}
|
func (*GroupVersionKind) ProtoMessage() {}
|
||||||
func (*GroupVersionKind) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{13} }
|
func (*GroupVersionKind) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{14} }
|
||||||
|
|
||||||
func (m *GroupVersionResource) Reset() { *m = GroupVersionResource{} }
|
func (m *GroupVersionResource) Reset() { *m = GroupVersionResource{} }
|
||||||
func (*GroupVersionResource) ProtoMessage() {}
|
func (*GroupVersionResource) ProtoMessage() {}
|
||||||
func (*GroupVersionResource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{14} }
|
func (*GroupVersionResource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{15} }
|
||||||
|
|
||||||
func (m *Initializer) Reset() { *m = Initializer{} }
|
func (m *Initializer) Reset() { *m = Initializer{} }
|
||||||
func (*Initializer) ProtoMessage() {}
|
func (*Initializer) ProtoMessage() {}
|
||||||
func (*Initializer) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{15} }
|
func (*Initializer) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{16} }
|
||||||
|
|
||||||
func (m *Initializers) Reset() { *m = Initializers{} }
|
func (m *Initializers) Reset() { *m = Initializers{} }
|
||||||
func (*Initializers) ProtoMessage() {}
|
func (*Initializers) ProtoMessage() {}
|
||||||
func (*Initializers) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{16} }
|
func (*Initializers) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{17} }
|
||||||
|
|
||||||
func (m *LabelSelector) Reset() { *m = LabelSelector{} }
|
func (m *LabelSelector) Reset() { *m = LabelSelector{} }
|
||||||
func (*LabelSelector) ProtoMessage() {}
|
func (*LabelSelector) ProtoMessage() {}
|
||||||
func (*LabelSelector) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{17} }
|
func (*LabelSelector) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{18} }
|
||||||
|
|
||||||
func (m *LabelSelectorRequirement) Reset() { *m = LabelSelectorRequirement{} }
|
func (m *LabelSelectorRequirement) Reset() { *m = LabelSelectorRequirement{} }
|
||||||
func (*LabelSelectorRequirement) ProtoMessage() {}
|
func (*LabelSelectorRequirement) ProtoMessage() {}
|
||||||
func (*LabelSelectorRequirement) Descriptor() ([]byte, []int) {
|
func (*LabelSelectorRequirement) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptorGenerated, []int{18}
|
return fileDescriptorGenerated, []int{19}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *List) Reset() { *m = List{} }
|
func (m *List) Reset() { *m = List{} }
|
||||||
func (*List) ProtoMessage() {}
|
func (*List) ProtoMessage() {}
|
||||||
func (*List) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{19} }
|
func (*List) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{20} }
|
||||||
|
|
||||||
func (m *ListMeta) Reset() { *m = ListMeta{} }
|
func (m *ListMeta) Reset() { *m = ListMeta{} }
|
||||||
func (*ListMeta) ProtoMessage() {}
|
func (*ListMeta) ProtoMessage() {}
|
||||||
func (*ListMeta) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{20} }
|
func (*ListMeta) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{21} }
|
||||||
|
|
||||||
func (m *ListOptions) Reset() { *m = ListOptions{} }
|
func (m *ListOptions) Reset() { *m = ListOptions{} }
|
||||||
func (*ListOptions) ProtoMessage() {}
|
func (*ListOptions) ProtoMessage() {}
|
||||||
func (*ListOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{21} }
|
func (*ListOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{22} }
|
||||||
|
|
||||||
func (m *MicroTime) Reset() { *m = MicroTime{} }
|
func (m *MicroTime) Reset() { *m = MicroTime{} }
|
||||||
func (*MicroTime) ProtoMessage() {}
|
func (*MicroTime) ProtoMessage() {}
|
||||||
func (*MicroTime) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{22} }
|
func (*MicroTime) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{23} }
|
||||||
|
|
||||||
func (m *ObjectMeta) Reset() { *m = ObjectMeta{} }
|
func (m *ObjectMeta) Reset() { *m = ObjectMeta{} }
|
||||||
func (*ObjectMeta) ProtoMessage() {}
|
func (*ObjectMeta) ProtoMessage() {}
|
||||||
func (*ObjectMeta) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{23} }
|
func (*ObjectMeta) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{24} }
|
||||||
|
|
||||||
func (m *OwnerReference) Reset() { *m = OwnerReference{} }
|
func (m *OwnerReference) Reset() { *m = OwnerReference{} }
|
||||||
func (*OwnerReference) ProtoMessage() {}
|
func (*OwnerReference) ProtoMessage() {}
|
||||||
func (*OwnerReference) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{24} }
|
func (*OwnerReference) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{25} }
|
||||||
|
|
||||||
func (m *Patch) Reset() { *m = Patch{} }
|
func (m *Patch) Reset() { *m = Patch{} }
|
||||||
func (*Patch) ProtoMessage() {}
|
func (*Patch) ProtoMessage() {}
|
||||||
func (*Patch) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{25} }
|
func (*Patch) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{26} }
|
||||||
|
|
||||||
func (m *Preconditions) Reset() { *m = Preconditions{} }
|
func (m *Preconditions) Reset() { *m = Preconditions{} }
|
||||||
func (*Preconditions) ProtoMessage() {}
|
func (*Preconditions) ProtoMessage() {}
|
||||||
func (*Preconditions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{26} }
|
func (*Preconditions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{27} }
|
||||||
|
|
||||||
func (m *RootPaths) Reset() { *m = RootPaths{} }
|
func (m *RootPaths) Reset() { *m = RootPaths{} }
|
||||||
func (*RootPaths) ProtoMessage() {}
|
func (*RootPaths) ProtoMessage() {}
|
||||||
func (*RootPaths) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{27} }
|
func (*RootPaths) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{28} }
|
||||||
|
|
||||||
func (m *ServerAddressByClientCIDR) Reset() { *m = ServerAddressByClientCIDR{} }
|
func (m *ServerAddressByClientCIDR) Reset() { *m = ServerAddressByClientCIDR{} }
|
||||||
func (*ServerAddressByClientCIDR) ProtoMessage() {}
|
func (*ServerAddressByClientCIDR) ProtoMessage() {}
|
||||||
func (*ServerAddressByClientCIDR) Descriptor() ([]byte, []int) {
|
func (*ServerAddressByClientCIDR) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptorGenerated, []int{28}
|
return fileDescriptorGenerated, []int{29}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Status) Reset() { *m = Status{} }
|
func (m *Status) Reset() { *m = Status{} }
|
||||||
func (*Status) ProtoMessage() {}
|
func (*Status) ProtoMessage() {}
|
||||||
func (*Status) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{29} }
|
func (*Status) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{30} }
|
||||||
|
|
||||||
func (m *StatusCause) Reset() { *m = StatusCause{} }
|
func (m *StatusCause) Reset() { *m = StatusCause{} }
|
||||||
func (*StatusCause) ProtoMessage() {}
|
func (*StatusCause) ProtoMessage() {}
|
||||||
func (*StatusCause) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{30} }
|
func (*StatusCause) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{31} }
|
||||||
|
|
||||||
func (m *StatusDetails) Reset() { *m = StatusDetails{} }
|
func (m *StatusDetails) Reset() { *m = StatusDetails{} }
|
||||||
func (*StatusDetails) ProtoMessage() {}
|
func (*StatusDetails) ProtoMessage() {}
|
||||||
func (*StatusDetails) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{31} }
|
func (*StatusDetails) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{32} }
|
||||||
|
|
||||||
func (m *Time) Reset() { *m = Time{} }
|
func (m *Time) Reset() { *m = Time{} }
|
||||||
func (*Time) ProtoMessage() {}
|
func (*Time) ProtoMessage() {}
|
||||||
func (*Time) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{32} }
|
func (*Time) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{33} }
|
||||||
|
|
||||||
func (m *Timestamp) Reset() { *m = Timestamp{} }
|
func (m *Timestamp) Reset() { *m = Timestamp{} }
|
||||||
func (*Timestamp) ProtoMessage() {}
|
func (*Timestamp) ProtoMessage() {}
|
||||||
func (*Timestamp) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{33} }
|
func (*Timestamp) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{34} }
|
||||||
|
|
||||||
func (m *TypeMeta) Reset() { *m = TypeMeta{} }
|
func (m *TypeMeta) Reset() { *m = TypeMeta{} }
|
||||||
func (*TypeMeta) ProtoMessage() {}
|
func (*TypeMeta) ProtoMessage() {}
|
||||||
func (*TypeMeta) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{34} }
|
func (*TypeMeta) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{35} }
|
||||||
|
|
||||||
|
func (m *UpdateOptions) Reset() { *m = UpdateOptions{} }
|
||||||
|
func (*UpdateOptions) ProtoMessage() {}
|
||||||
|
func (*UpdateOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{36} }
|
||||||
|
|
||||||
func (m *Verbs) Reset() { *m = Verbs{} }
|
func (m *Verbs) Reset() { *m = Verbs{} }
|
||||||
func (*Verbs) ProtoMessage() {}
|
func (*Verbs) ProtoMessage() {}
|
||||||
func (*Verbs) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{35} }
|
func (*Verbs) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{37} }
|
||||||
|
|
||||||
func (m *WatchEvent) Reset() { *m = WatchEvent{} }
|
func (m *WatchEvent) Reset() { *m = WatchEvent{} }
|
||||||
func (*WatchEvent) ProtoMessage() {}
|
func (*WatchEvent) ProtoMessage() {}
|
||||||
func (*WatchEvent) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{36} }
|
func (*WatchEvent) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{38} }
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
proto.RegisterType((*APIGroup)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.APIGroup")
|
proto.RegisterType((*APIGroup)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.APIGroup")
|
||||||
@ -253,6 +263,7 @@ func init() {
|
|||||||
proto.RegisterType((*APIResource)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.APIResource")
|
proto.RegisterType((*APIResource)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.APIResource")
|
||||||
proto.RegisterType((*APIResourceList)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.APIResourceList")
|
proto.RegisterType((*APIResourceList)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.APIResourceList")
|
||||||
proto.RegisterType((*APIVersions)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.APIVersions")
|
proto.RegisterType((*APIVersions)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.APIVersions")
|
||||||
|
proto.RegisterType((*CreateOptions)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.CreateOptions")
|
||||||
proto.RegisterType((*DeleteOptions)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.DeleteOptions")
|
proto.RegisterType((*DeleteOptions)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.DeleteOptions")
|
||||||
proto.RegisterType((*Duration)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.Duration")
|
proto.RegisterType((*Duration)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.Duration")
|
||||||
proto.RegisterType((*ExportOptions)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.ExportOptions")
|
proto.RegisterType((*ExportOptions)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.ExportOptions")
|
||||||
@ -283,6 +294,7 @@ func init() {
|
|||||||
proto.RegisterType((*Time)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.Time")
|
proto.RegisterType((*Time)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.Time")
|
||||||
proto.RegisterType((*Timestamp)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.Timestamp")
|
proto.RegisterType((*Timestamp)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.Timestamp")
|
||||||
proto.RegisterType((*TypeMeta)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta")
|
proto.RegisterType((*TypeMeta)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta")
|
||||||
|
proto.RegisterType((*UpdateOptions)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.UpdateOptions")
|
||||||
proto.RegisterType((*Verbs)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.Verbs")
|
proto.RegisterType((*Verbs)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.Verbs")
|
||||||
proto.RegisterType((*WatchEvent)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.WatchEvent")
|
proto.RegisterType((*WatchEvent)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.WatchEvent")
|
||||||
}
|
}
|
||||||
@ -535,6 +547,47 @@ func (m *APIVersions) MarshalTo(dAtA []byte) (int, error) {
|
|||||||
return i, nil
|
return i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *CreateOptions) Marshal() (dAtA []byte, err error) {
|
||||||
|
size := m.Size()
|
||||||
|
dAtA = make([]byte, size)
|
||||||
|
n, err := m.MarshalTo(dAtA)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return dAtA[:n], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *CreateOptions) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
var i int
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if len(m.DryRun) > 0 {
|
||||||
|
for _, s := range m.DryRun {
|
||||||
|
dAtA[i] = 0xa
|
||||||
|
i++
|
||||||
|
l = len(s)
|
||||||
|
for l >= 1<<7 {
|
||||||
|
dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
|
||||||
|
l >>= 7
|
||||||
|
i++
|
||||||
|
}
|
||||||
|
dAtA[i] = uint8(l)
|
||||||
|
i++
|
||||||
|
i += copy(dAtA[i:], s)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dAtA[i] = 0x10
|
||||||
|
i++
|
||||||
|
if m.IncludeUninitialized {
|
||||||
|
dAtA[i] = 1
|
||||||
|
} else {
|
||||||
|
dAtA[i] = 0
|
||||||
|
}
|
||||||
|
i++
|
||||||
|
return i, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (m *DeleteOptions) Marshal() (dAtA []byte, err error) {
|
func (m *DeleteOptions) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
@ -581,6 +634,21 @@ func (m *DeleteOptions) MarshalTo(dAtA []byte) (int, error) {
|
|||||||
i = encodeVarintGenerated(dAtA, i, uint64(len(*m.PropagationPolicy)))
|
i = encodeVarintGenerated(dAtA, i, uint64(len(*m.PropagationPolicy)))
|
||||||
i += copy(dAtA[i:], *m.PropagationPolicy)
|
i += copy(dAtA[i:], *m.PropagationPolicy)
|
||||||
}
|
}
|
||||||
|
if len(m.DryRun) > 0 {
|
||||||
|
for _, s := range m.DryRun {
|
||||||
|
dAtA[i] = 0x2a
|
||||||
|
i++
|
||||||
|
l = len(s)
|
||||||
|
for l >= 1<<7 {
|
||||||
|
dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
|
||||||
|
l >>= 7
|
||||||
|
i++
|
||||||
|
}
|
||||||
|
dAtA[i] = uint8(l)
|
||||||
|
i++
|
||||||
|
i += copy(dAtA[i:], s)
|
||||||
|
}
|
||||||
|
}
|
||||||
return i, nil
|
return i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1604,6 +1672,39 @@ func (m *TypeMeta) MarshalTo(dAtA []byte) (int, error) {
|
|||||||
return i, nil
|
return i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *UpdateOptions) Marshal() (dAtA []byte, err error) {
|
||||||
|
size := m.Size()
|
||||||
|
dAtA = make([]byte, size)
|
||||||
|
n, err := m.MarshalTo(dAtA)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return dAtA[:n], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *UpdateOptions) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
var i int
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if len(m.DryRun) > 0 {
|
||||||
|
for _, s := range m.DryRun {
|
||||||
|
dAtA[i] = 0xa
|
||||||
|
i++
|
||||||
|
l = len(s)
|
||||||
|
for l >= 1<<7 {
|
||||||
|
dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
|
||||||
|
l >>= 7
|
||||||
|
i++
|
||||||
|
}
|
||||||
|
dAtA[i] = uint8(l)
|
||||||
|
i++
|
||||||
|
i += copy(dAtA[i:], s)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return i, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (m Verbs) Marshal() (dAtA []byte, err error) {
|
func (m Verbs) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
@ -1793,6 +1894,19 @@ func (m *APIVersions) Size() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *CreateOptions) Size() (n int) {
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if len(m.DryRun) > 0 {
|
||||||
|
for _, s := range m.DryRun {
|
||||||
|
l = len(s)
|
||||||
|
n += 1 + l + sovGenerated(uint64(l))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
n += 2
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
func (m *DeleteOptions) Size() (n int) {
|
func (m *DeleteOptions) Size() (n int) {
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
@ -1810,6 +1924,12 @@ func (m *DeleteOptions) Size() (n int) {
|
|||||||
l = len(*m.PropagationPolicy)
|
l = len(*m.PropagationPolicy)
|
||||||
n += 1 + l + sovGenerated(uint64(l))
|
n += 1 + l + sovGenerated(uint64(l))
|
||||||
}
|
}
|
||||||
|
if len(m.DryRun) > 0 {
|
||||||
|
for _, s := range m.DryRun {
|
||||||
|
l = len(s)
|
||||||
|
n += 1 + l + sovGenerated(uint64(l))
|
||||||
|
}
|
||||||
|
}
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2197,6 +2317,18 @@ func (m *TypeMeta) Size() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *UpdateOptions) Size() (n int) {
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if len(m.DryRun) > 0 {
|
||||||
|
for _, s := range m.DryRun {
|
||||||
|
l = len(s)
|
||||||
|
n += 1 + l + sovGenerated(uint64(l))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
func (m Verbs) Size() (n int) {
|
func (m Verbs) Size() (n int) {
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
@ -2284,6 +2416,17 @@ func (this *APIResourceList) String() string {
|
|||||||
}, "")
|
}, "")
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
func (this *CreateOptions) String() string {
|
||||||
|
if this == nil {
|
||||||
|
return "nil"
|
||||||
|
}
|
||||||
|
s := strings.Join([]string{`&CreateOptions{`,
|
||||||
|
`DryRun:` + fmt.Sprintf("%v", this.DryRun) + `,`,
|
||||||
|
`IncludeUninitialized:` + fmt.Sprintf("%v", this.IncludeUninitialized) + `,`,
|
||||||
|
`}`,
|
||||||
|
}, "")
|
||||||
|
return s
|
||||||
|
}
|
||||||
func (this *DeleteOptions) String() string {
|
func (this *DeleteOptions) String() string {
|
||||||
if this == nil {
|
if this == nil {
|
||||||
return "nil"
|
return "nil"
|
||||||
@ -2293,6 +2436,7 @@ func (this *DeleteOptions) String() string {
|
|||||||
`Preconditions:` + strings.Replace(fmt.Sprintf("%v", this.Preconditions), "Preconditions", "Preconditions", 1) + `,`,
|
`Preconditions:` + strings.Replace(fmt.Sprintf("%v", this.Preconditions), "Preconditions", "Preconditions", 1) + `,`,
|
||||||
`OrphanDependents:` + valueToStringGenerated(this.OrphanDependents) + `,`,
|
`OrphanDependents:` + valueToStringGenerated(this.OrphanDependents) + `,`,
|
||||||
`PropagationPolicy:` + valueToStringGenerated(this.PropagationPolicy) + `,`,
|
`PropagationPolicy:` + valueToStringGenerated(this.PropagationPolicy) + `,`,
|
||||||
|
`DryRun:` + fmt.Sprintf("%v", this.DryRun) + `,`,
|
||||||
`}`,
|
`}`,
|
||||||
}, "")
|
}, "")
|
||||||
return s
|
return s
|
||||||
@ -2598,6 +2742,16 @@ func (this *TypeMeta) String() string {
|
|||||||
}, "")
|
}, "")
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
func (this *UpdateOptions) String() string {
|
||||||
|
if this == nil {
|
||||||
|
return "nil"
|
||||||
|
}
|
||||||
|
s := strings.Join([]string{`&UpdateOptions{`,
|
||||||
|
`DryRun:` + fmt.Sprintf("%v", this.DryRun) + `,`,
|
||||||
|
`}`,
|
||||||
|
}, "")
|
||||||
|
return s
|
||||||
|
}
|
||||||
func (this *WatchEvent) String() string {
|
func (this *WatchEvent) String() string {
|
||||||
if this == nil {
|
if this == nil {
|
||||||
return "nil"
|
return "nil"
|
||||||
@ -3395,6 +3549,105 @@ func (m *APIVersions) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (m *CreateOptions) Unmarshal(dAtA []byte) error {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
preIndex := iNdEx
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowGenerated
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= (uint64(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
if wireType == 4 {
|
||||||
|
return fmt.Errorf("proto: CreateOptions: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: CreateOptions: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
case 1:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field DryRun", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowGenerated
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
stringLen |= (uint64(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
intStringLen := int(stringLen)
|
||||||
|
if intStringLen < 0 {
|
||||||
|
return ErrInvalidLengthGenerated
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.DryRun = append(m.DryRun, string(dAtA[iNdEx:postIndex]))
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 2:
|
||||||
|
if wireType != 0 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field IncludeUninitialized", wireType)
|
||||||
|
}
|
||||||
|
var v int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowGenerated
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
v |= (int(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m.IncludeUninitialized = bool(v != 0)
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipGenerated(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if skippy < 0 {
|
||||||
|
return ErrInvalidLengthGenerated
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func (m *DeleteOptions) Unmarshal(dAtA []byte) error {
|
func (m *DeleteOptions) Unmarshal(dAtA []byte) error {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
@ -3528,6 +3781,35 @@ func (m *DeleteOptions) Unmarshal(dAtA []byte) error {
|
|||||||
s := DeletionPropagation(dAtA[iNdEx:postIndex])
|
s := DeletionPropagation(dAtA[iNdEx:postIndex])
|
||||||
m.PropagationPolicy = &s
|
m.PropagationPolicy = &s
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
|
case 5:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field DryRun", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowGenerated
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
stringLen |= (uint64(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
intStringLen := int(stringLen)
|
||||||
|
if intStringLen < 0 {
|
||||||
|
return ErrInvalidLengthGenerated
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.DryRun = append(m.DryRun, string(dAtA[iNdEx:postIndex]))
|
||||||
|
iNdEx = postIndex
|
||||||
default:
|
default:
|
||||||
iNdEx = preIndex
|
iNdEx = preIndex
|
||||||
skippy, err := skipGenerated(dAtA[iNdEx:])
|
skippy, err := skipGenerated(dAtA[iNdEx:])
|
||||||
@ -7506,6 +7788,85 @@ func (m *TypeMeta) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (m *UpdateOptions) Unmarshal(dAtA []byte) error {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
preIndex := iNdEx
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowGenerated
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= (uint64(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
if wireType == 4 {
|
||||||
|
return fmt.Errorf("proto: UpdateOptions: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: UpdateOptions: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
case 1:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field DryRun", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowGenerated
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
stringLen |= (uint64(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
intStringLen := int(stringLen)
|
||||||
|
if intStringLen < 0 {
|
||||||
|
return ErrInvalidLengthGenerated
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.DryRun = append(m.DryRun, string(dAtA[iNdEx:postIndex]))
|
||||||
|
iNdEx = postIndex
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipGenerated(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if skippy < 0 {
|
||||||
|
return ErrInvalidLengthGenerated
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func (m *Verbs) Unmarshal(dAtA []byte) error {
|
func (m *Verbs) Unmarshal(dAtA []byte) error {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
@ -7804,158 +8165,160 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var fileDescriptorGenerated = []byte{
|
var fileDescriptorGenerated = []byte{
|
||||||
// 2435 bytes of a gzipped FileDescriptorProto
|
// 2465 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x59, 0x4d, 0x6c, 0x23, 0x49,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x59, 0x4d, 0x6c, 0x23, 0x49,
|
||||||
0x15, 0x4e, 0xdb, 0xb1, 0x63, 0x3f, 0xc7, 0xf9, 0xa9, 0xcd, 0x80, 0x37, 0x02, 0x3b, 0xdb, 0x8b,
|
0xf5, 0x4f, 0xdb, 0xb1, 0x63, 0x3f, 0xc7, 0xf9, 0xa8, 0xcd, 0xfe, 0xff, 0xde, 0x08, 0xec, 0x6c,
|
||||||
0x56, 0x59, 0x98, 0xb5, 0x49, 0x16, 0x56, 0xc3, 0x00, 0x03, 0xe9, 0x38, 0x33, 0x8a, 0x76, 0x32,
|
0x2f, 0x5a, 0x65, 0x61, 0xd6, 0x26, 0x59, 0x58, 0x0d, 0x03, 0x2c, 0xc4, 0x71, 0x66, 0x14, 0xed,
|
||||||
0x63, 0x55, 0x76, 0x06, 0x31, 0x8c, 0x10, 0x9d, 0x76, 0xc5, 0x69, 0xd2, 0xee, 0xf6, 0x56, 0x95,
|
0x64, 0xc6, 0xaa, 0xec, 0x0c, 0x62, 0x18, 0x21, 0x3a, 0xdd, 0x15, 0xa7, 0x49, 0xbb, 0xdb, 0x5b,
|
||||||
0x33, 0x09, 0x1c, 0xd8, 0x03, 0x48, 0x1c, 0x10, 0x9a, 0x23, 0x27, 0xb4, 0x23, 0xb8, 0x70, 0xe5,
|
0xd5, 0xce, 0x8c, 0xe1, 0xc0, 0x1e, 0x40, 0x70, 0x40, 0x68, 0x8e, 0x9c, 0xd0, 0x8e, 0xe0, 0xc2,
|
||||||
0xc4, 0x05, 0x4e, 0x48, 0xcc, 0x71, 0x24, 0x2e, 0x7b, 0x40, 0xd6, 0x8e, 0xf7, 0xc0, 0x09, 0x71,
|
0x95, 0x13, 0x17, 0x38, 0x21, 0x31, 0xc7, 0x91, 0xb8, 0xec, 0x01, 0x59, 0x3b, 0xe6, 0xc0, 0x09,
|
||||||
0xcf, 0x09, 0x55, 0x75, 0xf5, 0x9f, 0x1d, 0x4f, 0xda, 0x3b, 0x0b, 0xe2, 0x14, 0xf7, 0xfb, 0xf9,
|
0x71, 0xcf, 0x09, 0x55, 0x75, 0x75, 0x75, 0xb7, 0x1d, 0x4f, 0xda, 0x3b, 0xbb, 0x88, 0x53, 0xd2,
|
||||||
0xde, 0xab, 0x57, 0xaf, 0x5e, 0xbd, 0x7a, 0x81, 0xbd, 0xe3, 0x6b, 0xac, 0x6e, 0x7b, 0x8d, 0xe3,
|
0xef, 0xe3, 0xf7, 0x5e, 0x55, 0xbd, 0x7a, 0xef, 0xd5, 0x33, 0x1c, 0x9c, 0x5e, 0x65, 0x75, 0xdb,
|
||||||
0xfe, 0x01, 0xa1,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x6a, 0x13, 0x56, 0x59, 0x88, 0x2c, 0xed, 0x2a, 0x2a, 0x8e, 0x49, 0xa0, 0xd7,
|
||||||
0xe6, 0x22, 0x4b, 0xdb, 0x21, 0x15, 0xc7, 0x24, 0xd0, 0xeb, 0x90, 0x93, 0x91, 0xaf, 0x14, 0xa4,
|
0x20, 0x27, 0x76, 0xbe, 0x52, 0x10, 0x26, 0xca, 0xd2, 0x44, 0x4e, 0x1c, 0x0b, 0x0e, 0x78, 0xe8,
|
||||||
0x89, 0xb2, 0x32, 0x91, 0x93, 0xdb, 0x82, 0x7d, 0x1e, 0x7a, 0x13, 0xe6, 0xd4, 0xa9, 0xa9, 0x14,
|
0x0d, 0x58, 0x90, 0xb7, 0xa6, 0x52, 0x14, 0x62, 0xcb, 0x52, 0x6c, 0x21, 0x0c, 0xeb, 0x90, 0xaf,
|
||||||
0xa5, 0xd8, 0xa2, 0x12, 0x9b, 0x0b, 0xd2, 0x3a, 0xe0, 0xeb, 0x7f, 0xd4, 0x60, 0x31, 0xb6, 0x7f,
|
0xff, 0x41, 0x83, 0xe5, 0xd8, 0xf9, 0x89, 0x58, 0xb9, 0x0a, 0x8b, 0x9d, 0xd8, 0x4d, 0x91, 0x67,
|
||||||
0x32, 0x57, 0xae, 0xc1, 0x7c, 0x27, 0x76, 0x52, 0xd4, 0x5e, 0x86, 0xab, 0x89, 0x9f, 0x22, 0x9c,
|
0xa9, 0x56, 0x13, 0xbf, 0x45, 0x38, 0x21, 0x89, 0x08, 0x14, 0xa9, 0x44, 0x0a, 0x33, 0xc2, 0x56,
|
||||||
0x90, 0x44, 0x04, 0x8a, 0x54, 0x21, 0x05, 0x15, 0x61, 0x23, 0x75, 0xa2, 0x05, 0x3e, 0x44, 0x96,
|
0xea, 0x40, 0x0b, 0x7d, 0x88, 0x2c, 0xc5, 0x88, 0x0c, 0x47, 0xc8, 0xfa, 0x3f, 0x35, 0x11, 0x74,
|
||||||
0x62, 0x44, 0x86, 0x23, 0x64, 0xfd, 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e6, 0x64, 0xe3, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x6c, 0xc5, 0x28, 0xb2, 0x54,
|
0xf4, 0x59, 0x75, 0xee, 0xa3, 0x67, 0xd5, 0xb9, 0x0f, 0x46, 0x55, 0xed, 0xc9, 0xa8, 0xaa, 0x3d,
|
||||||
0x20, 0x00, 0x00,
|
0x1d, 0x55, 0xb5, 0x8f, 0x46, 0x55, 0xed, 0xe3, 0x51, 0x55, 0x7b, 0xf4, 0x8f, 0xea, 0xdc, 0xbd,
|
||||||
|
0xcc, 0xd9, 0xd6, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xab, 0xec, 0x02, 0x4a, 0x00, 0x21, 0x00,
|
||||||
|
0x00,
|
||||||
}
|
}
|
||||||
|
64
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto
generated
vendored
64
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto
generated
vendored
@ -23,7 +23,6 @@ package k8s.io.apimachinery.pkg.apis.meta.v1;
|
|||||||
|
|
||||||
import "k8s.io/apimachinery/pkg/runtime/generated.proto";
|
import "k8s.io/apimachinery/pkg/runtime/generated.proto";
|
||||||
import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
|
import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
|
||||||
import "k8s.io/apimachinery/pkg/util/intstr/generated.proto";
|
|
||||||
|
|
||||||
// Package-wide variables from generator "generated".
|
// Package-wide variables from generator "generated".
|
||||||
option go_package = "v1";
|
option go_package = "v1";
|
||||||
@ -125,6 +124,21 @@ message APIVersions {
|
|||||||
repeated ServerAddressByClientCIDR serverAddressByClientCIDRs = 2;
|
repeated ServerAddressByClientCIDR serverAddressByClientCIDRs = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CreateOptions may be provided when creating an API object.
|
||||||
|
message CreateOptions {
|
||||||
|
// When present, indicates that modifications should not be
|
||||||
|
// persisted. An invalid or unrecognized dryRun directive will
|
||||||
|
// result in an error response and no further processing of the
|
||||||
|
// request. Valid values are:
|
||||||
|
// - All: all dry run stages will be processed
|
||||||
|
// +optional
|
||||||
|
repeated string dryRun = 1;
|
||||||
|
|
||||||
|
// If IncludeUninitialized is specified, the object may be
|
||||||
|
// returned without completing initialization.
|
||||||
|
optional bool includeUninitialized = 2;
|
||||||
|
}
|
||||||
|
|
||||||
// DeleteOptions may be provided when deleting an API object.
|
// DeleteOptions may be provided when deleting an API object.
|
||||||
message DeleteOptions {
|
message DeleteOptions {
|
||||||
// The duration in seconds before the object should be deleted. Value must be non-negative integer.
|
// The duration in seconds before the object should be deleted. Value must be non-negative integer.
|
||||||
@ -156,6 +170,14 @@ message DeleteOptions {
|
|||||||
// foreground.
|
// foreground.
|
||||||
// +optional
|
// +optional
|
||||||
optional string propagationPolicy = 4;
|
optional string propagationPolicy = 4;
|
||||||
|
|
||||||
|
// When present, indicates that modifications should not be
|
||||||
|
// persisted. An invalid or unrecognized dryRun directive will
|
||||||
|
// result in an error response and no further processing of the
|
||||||
|
// request. Valid values are:
|
||||||
|
// - All: all dry run stages will be processed
|
||||||
|
// +optional
|
||||||
|
repeated string dryRun = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Duration is a wrapper around time.Duration which supports correct
|
// Duration is a wrapper around time.Duration which supports correct
|
||||||
@ -339,9 +361,10 @@ message ListMeta {
|
|||||||
// continue may be set if the user set a limit on the number of items returned, and indicates that
|
// continue may be set if the user set a limit on the number of items returned, and indicates that
|
||||||
// the server has more data available. The value is opaque and may be used to issue another request
|
// the server has more data available. The value is opaque and may be used to issue another request
|
||||||
// to the endpoint that served this list to retrieve the next set of available objects. Continuing a
|
// to the endpoint that served this list to retrieve the next set of available objects. Continuing a
|
||||||
// list may not be possible if the server configuration has changed or more than a few minutes have
|
// consistent list may not be possible if the server configuration has changed or more than a few
|
||||||
// passed. The resourceVersion field returned when using this continue value will be identical to
|
// minutes have passed. The resourceVersion field returned when using this continue value will be
|
||||||
// the value in the first response.
|
// identical to the value in the first response, unless you have received this token from an error
|
||||||
|
// message.
|
||||||
optional string continue = 3;
|
optional string continue = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -398,14 +421,20 @@ message ListOptions {
|
|||||||
// result was calculated is returned.
|
// result was calculated is returned.
|
||||||
optional int64 limit = 7;
|
optional int64 limit = 7;
|
||||||
|
|
||||||
// The continue option should be set when retrieving more results from the server. Since this value
|
// The continue option should be set when retrieving more results from the server. Since this value is
|
||||||
// is server defined, clients may only use the continue value from a previous query result with
|
// server defined, clients may only use the continue value from a previous query result with identical
|
||||||
// identical query parameters (except for the value of continue) and the server may reject a continue
|
// query parameters (except for the value of continue) and the server may reject a continue value it
|
||||||
// value it does not recognize. If the specified continue value is no longer valid whether due to
|
// does not recognize. If the specified continue value is no longer valid whether due to expiration
|
||||||
// expiration (generally five to fifteen minutes) or a configuration change on the server the server
|
// (generally five to fifteen minutes) or a configuration change on the server, the server will
|
||||||
// will respond with a 410 ResourceExpired error indicating the client must restart their list without
|
// respond with a 410 ResourceExpired error together with a continue token. If the client needs a
|
||||||
// the continue field. This field is not supported when watch is true. Clients may start a watch from
|
// consistent list, it must restart their list without the continue field. Otherwise, the client may
|
||||||
// the last resourceVersion value returned by the server and not miss any modifications.
|
// send another list request with the token received with the 410 error, the server will respond with
|
||||||
|
// a list starting from the next key, but from the latest snapshot, which is inconsistent from the
|
||||||
|
// previous list results - objects that are created, modified, or deleted after the first list request
|
||||||
|
// will be included in the response, as long as their keys are after the "next key".
|
||||||
|
//
|
||||||
|
// This field is not supported when watch is true. Clients may start a watch from the last
|
||||||
|
// resourceVersion value returned by the server and not miss any modifications.
|
||||||
optional string continue = 8;
|
optional string continue = 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -811,6 +840,17 @@ message TypeMeta {
|
|||||||
optional string apiVersion = 2;
|
optional string apiVersion = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UpdateOptions may be provided when updating an API object.
|
||||||
|
message UpdateOptions {
|
||||||
|
// When present, indicates that modifications should not be
|
||||||
|
// persisted. An invalid or unrecognized dryRun directive will
|
||||||
|
// result in an error response and no further processing of the
|
||||||
|
// request. Valid values are:
|
||||||
|
// - All: all dry run stages will be processed
|
||||||
|
// +optional
|
||||||
|
repeated string dryRun = 1;
|
||||||
|
}
|
||||||
|
|
||||||
// Verbs masks the value so protobuf can generate
|
// Verbs masks the value so protobuf can generate
|
||||||
//
|
//
|
||||||
// +protobuf.nullable=true
|
// +protobuf.nullable=true
|
||||||
|
24
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/register.go
generated
vendored
24
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/register.go
generated
vendored
@ -19,6 +19,7 @@ package v1
|
|||||||
import (
|
import (
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
|
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GroupName is the group name for this API.
|
// GroupName is the group name for this API.
|
||||||
@ -52,14 +53,15 @@ func AddToGroupVersion(scheme *runtime.Scheme, groupVersion schema.GroupVersion)
|
|||||||
&ExportOptions{},
|
&ExportOptions{},
|
||||||
&GetOptions{},
|
&GetOptions{},
|
||||||
&DeleteOptions{},
|
&DeleteOptions{},
|
||||||
|
&CreateOptions{},
|
||||||
|
&UpdateOptions{},
|
||||||
)
|
)
|
||||||
scheme.AddConversionFuncs(
|
utilruntime.Must(scheme.AddConversionFuncs(
|
||||||
Convert_versioned_Event_to_watch_Event,
|
Convert_v1_WatchEvent_To_watch_Event,
|
||||||
Convert_versioned_InternalEvent_to_versioned_Event,
|
Convert_v1_InternalEvent_To_v1_WatchEvent,
|
||||||
Convert_watch_Event_to_versioned_Event,
|
Convert_watch_Event_To_v1_WatchEvent,
|
||||||
Convert_versioned_Event_to_versioned_InternalEvent,
|
Convert_v1_WatchEvent_To_v1_InternalEvent,
|
||||||
)
|
))
|
||||||
|
|
||||||
// Register Unversioned types under their own special group
|
// Register Unversioned types under their own special group
|
||||||
scheme.AddUnversionedTypes(Unversioned,
|
scheme.AddUnversionedTypes(Unversioned,
|
||||||
&Status{},
|
&Status{},
|
||||||
@ -70,8 +72,8 @@ func AddToGroupVersion(scheme *runtime.Scheme, groupVersion schema.GroupVersion)
|
|||||||
)
|
)
|
||||||
|
|
||||||
// register manually. This usually goes through the SchemeBuilder, which we cannot use here.
|
// register manually. This usually goes through the SchemeBuilder, which we cannot use here.
|
||||||
AddConversionFuncs(scheme)
|
utilruntime.Must(AddConversionFuncs(scheme))
|
||||||
RegisterDefaults(scheme)
|
utilruntime.Must(RegisterDefaults(scheme))
|
||||||
}
|
}
|
||||||
|
|
||||||
// scheme is the registry for the common types that adhere to the meta v1 API spec.
|
// scheme is the registry for the common types that adhere to the meta v1 API spec.
|
||||||
@ -86,8 +88,10 @@ func init() {
|
|||||||
&ExportOptions{},
|
&ExportOptions{},
|
||||||
&GetOptions{},
|
&GetOptions{},
|
||||||
&DeleteOptions{},
|
&DeleteOptions{},
|
||||||
|
&CreateOptions{},
|
||||||
|
&UpdateOptions{},
|
||||||
)
|
)
|
||||||
|
|
||||||
// register manually. This usually goes through the SchemeBuilder, which we cannot use here.
|
// register manually. This usually goes through the SchemeBuilder, which we cannot use here.
|
||||||
RegisterDefaults(scheme)
|
utilruntime.Must(RegisterDefaults(scheme))
|
||||||
}
|
}
|
||||||
|
77
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go
generated
vendored
77
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go
generated
vendored
@ -76,9 +76,10 @@ type ListMeta struct {
|
|||||||
// continue may be set if the user set a limit on the number of items returned, and indicates that
|
// continue may be set if the user set a limit on the number of items returned, and indicates that
|
||||||
// the server has more data available. The value is opaque and may be used to issue another request
|
// the server has more data available. The value is opaque and may be used to issue another request
|
||||||
// to the endpoint that served this list to retrieve the next set of available objects. Continuing a
|
// to the endpoint that served this list to retrieve the next set of available objects. Continuing a
|
||||||
// list may not be possible if the server configuration has changed or more than a few minutes have
|
// consistent list may not be possible if the server configuration has changed or more than a few
|
||||||
// passed. The resourceVersion field returned when using this continue value will be identical to
|
// minutes have passed. The resourceVersion field returned when using this continue value will be
|
||||||
// the value in the first response.
|
// identical to the value in the first response, unless you have received this token from an error
|
||||||
|
// message.
|
||||||
Continue string `json:"continue,omitempty" protobuf:"bytes,3,opt,name=continue"`
|
Continue string `json:"continue,omitempty" protobuf:"bytes,3,opt,name=continue"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -363,14 +364,20 @@ type ListOptions struct {
|
|||||||
// updated during a chunked list the version of the object that was present at the time the first list
|
// updated during a chunked list the version of the object that was present at the time the first list
|
||||||
// result was calculated is returned.
|
// result was calculated is returned.
|
||||||
Limit int64 `json:"limit,omitempty" protobuf:"varint,7,opt,name=limit"`
|
Limit int64 `json:"limit,omitempty" protobuf:"varint,7,opt,name=limit"`
|
||||||
// The continue option should be set when retrieving more results from the server. Since this value
|
// The continue option should be set when retrieving more results from the server. Since this value is
|
||||||
// is server defined, clients may only use the continue value from a previous query result with
|
// server defined, clients may only use the continue value from a previous query result with identical
|
||||||
// identical query parameters (except for the value of continue) and the server may reject a continue
|
// query parameters (except for the value of continue) and the server may reject a continue value it
|
||||||
// value it does not recognize. If the specified continue value is no longer valid whether due to
|
// does not recognize. If the specified continue value is no longer valid whether due to expiration
|
||||||
// expiration (generally five to fifteen minutes) or a configuration change on the server the server
|
// (generally five to fifteen minutes) or a configuration change on the server, the server will
|
||||||
// will respond with a 410 ResourceExpired error indicating the client must restart their list without
|
// respond with a 410 ResourceExpired error together with a continue token. If the client needs a
|
||||||
// the continue field. This field is not supported when watch is true. Clients may start a watch from
|
// consistent list, it must restart their list without the continue field. Otherwise, the client may
|
||||||
// the last resourceVersion value returned by the server and not miss any modifications.
|
// send another list request with the token received with the 410 error, the server will respond with
|
||||||
|
// a list starting from the next key, but from the latest snapshot, which is inconsistent from the
|
||||||
|
// previous list results - objects that are created, modified, or deleted after the first list request
|
||||||
|
// will be included in the response, as long as their keys are after the "next key".
|
||||||
|
//
|
||||||
|
// This field is not supported when watch is true. Clients may start a watch from the last
|
||||||
|
// resourceVersion value returned by the server and not miss any modifications.
|
||||||
Continue string `json:"continue,omitempty" protobuf:"bytes,8,opt,name=continue"`
|
Continue string `json:"continue,omitempty" protobuf:"bytes,8,opt,name=continue"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -418,6 +425,12 @@ const (
|
|||||||
DeletePropagationForeground DeletionPropagation = "Foreground"
|
DeletePropagationForeground DeletionPropagation = "Foreground"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
// DryRunAll means to complete all processing stages, but don't
|
||||||
|
// persist changes to storage.
|
||||||
|
DryRunAll = "All"
|
||||||
|
)
|
||||||
|
|
||||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||||
|
|
||||||
// DeleteOptions may be provided when deleting an API object.
|
// DeleteOptions may be provided when deleting an API object.
|
||||||
@ -453,6 +466,48 @@ type DeleteOptions struct {
|
|||||||
// foreground.
|
// foreground.
|
||||||
// +optional
|
// +optional
|
||||||
PropagationPolicy *DeletionPropagation `json:"propagationPolicy,omitempty" protobuf:"varint,4,opt,name=propagationPolicy"`
|
PropagationPolicy *DeletionPropagation `json:"propagationPolicy,omitempty" protobuf:"varint,4,opt,name=propagationPolicy"`
|
||||||
|
|
||||||
|
// When present, indicates that modifications should not be
|
||||||
|
// persisted. An invalid or unrecognized dryRun directive will
|
||||||
|
// result in an error response and no further processing of the
|
||||||
|
// request. Valid values are:
|
||||||
|
// - All: all dry run stages will be processed
|
||||||
|
// +optional
|
||||||
|
DryRun []string `json:"dryRun,omitempty" protobuf:"bytes,5,rep,name=dryRun"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||||
|
|
||||||
|
// CreateOptions may be provided when creating an API object.
|
||||||
|
type CreateOptions struct {
|
||||||
|
TypeMeta `json:",inline"`
|
||||||
|
|
||||||
|
// When present, indicates that modifications should not be
|
||||||
|
// persisted. An invalid or unrecognized dryRun directive will
|
||||||
|
// result in an error response and no further processing of the
|
||||||
|
// request. Valid values are:
|
||||||
|
// - All: all dry run stages will be processed
|
||||||
|
// +optional
|
||||||
|
DryRun []string `json:"dryRun,omitempty" protobuf:"bytes,1,rep,name=dryRun"`
|
||||||
|
|
||||||
|
// If IncludeUninitialized is specified, the object may be
|
||||||
|
// returned without completing initialization.
|
||||||
|
IncludeUninitialized bool `json:"includeUninitialized,omitempty" protobuf:"varint,2,opt,name=includeUninitialized"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||||
|
|
||||||
|
// UpdateOptions may be provided when updating an API object.
|
||||||
|
type UpdateOptions struct {
|
||||||
|
TypeMeta `json:",inline"`
|
||||||
|
|
||||||
|
// When present, indicates that modifications should not be
|
||||||
|
// persisted. An invalid or unrecognized dryRun directive will
|
||||||
|
// result in an error response and no further processing of the
|
||||||
|
// request. Valid values are:
|
||||||
|
// - All: all dry run stages will be processed
|
||||||
|
// +optional
|
||||||
|
DryRun []string `json:"dryRun,omitempty" protobuf:"bytes,1,rep,name=dryRun"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.
|
// Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.
|
||||||
|
24
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go
generated
vendored
24
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go
generated
vendored
@ -85,12 +85,23 @@ func (APIVersions) SwaggerDoc() map[string]string {
|
|||||||
return map_APIVersions
|
return map_APIVersions
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var map_CreateOptions = map[string]string{
|
||||||
|
"": "CreateOptions may be provided when creating an API object.",
|
||||||
|
"dryRun": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed",
|
||||||
|
"includeUninitialized": "If IncludeUninitialized is specified, the object may be returned without completing initialization.",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (CreateOptions) SwaggerDoc() map[string]string {
|
||||||
|
return map_CreateOptions
|
||||||
|
}
|
||||||
|
|
||||||
var map_DeleteOptions = map[string]string{
|
var map_DeleteOptions = map[string]string{
|
||||||
"": "DeleteOptions may be provided when deleting an API object.",
|
"": "DeleteOptions may be provided when deleting an API object.",
|
||||||
"gracePeriodSeconds": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.",
|
"gracePeriodSeconds": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.",
|
||||||
"preconditions": "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.",
|
"preconditions": "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.",
|
||||||
"orphanDependents": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.",
|
"orphanDependents": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.",
|
||||||
"propagationPolicy": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.",
|
"propagationPolicy": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.",
|
||||||
|
"dryRun": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed",
|
||||||
}
|
}
|
||||||
|
|
||||||
func (DeleteOptions) SwaggerDoc() map[string]string {
|
func (DeleteOptions) SwaggerDoc() map[string]string {
|
||||||
@ -181,7 +192,7 @@ var map_ListMeta = map[string]string{
|
|||||||
"": "ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.",
|
"": "ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.",
|
||||||
"selfLink": "selfLink is a URL representing this object. Populated by the system. Read-only.",
|
"selfLink": "selfLink is a URL representing this object. Populated by the system. Read-only.",
|
||||||
"resourceVersion": "String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency",
|
"resourceVersion": "String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency",
|
||||||
"continue": "continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response.",
|
"continue": "continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message.",
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ListMeta) SwaggerDoc() map[string]string {
|
func (ListMeta) SwaggerDoc() map[string]string {
|
||||||
@ -197,7 +208,7 @@ var map_ListOptions = map[string]string{
|
|||||||
"resourceVersion": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.",
|
"resourceVersion": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.",
|
||||||
"timeoutSeconds": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.",
|
"timeoutSeconds": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.",
|
||||||
"limit": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.",
|
"limit": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.",
|
||||||
"continue": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.",
|
"continue": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.",
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ListOptions) SwaggerDoc() map[string]string {
|
func (ListOptions) SwaggerDoc() map[string]string {
|
||||||
@ -327,4 +338,13 @@ func (TypeMeta) SwaggerDoc() map[string]string {
|
|||||||
return map_TypeMeta
|
return map_TypeMeta
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var map_UpdateOptions = map[string]string{
|
||||||
|
"": "UpdateOptions may be provided when updating an API object.",
|
||||||
|
"dryRun": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UpdateOptions) SwaggerDoc() map[string]string {
|
||||||
|
return map_UpdateOptions
|
||||||
|
}
|
||||||
|
|
||||||
// AUTO-GENERATED FUNCTIONS END HERE
|
// AUTO-GENERATED FUNCTIONS END HERE
|
||||||
|
61
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructured.go
generated
vendored
61
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructured.go
generated
vendored
@ -179,6 +179,11 @@ func (u *Unstructured) GetOwnerReferences() []metav1.OwnerReference {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *Unstructured) SetOwnerReferences(references []metav1.OwnerReference) {
|
func (u *Unstructured) SetOwnerReferences(references []metav1.OwnerReference) {
|
||||||
|
if references == nil {
|
||||||
|
RemoveNestedField(u.Object, "metadata", "ownerReferences")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
newReferences := make([]interface{}, 0, len(references))
|
newReferences := make([]interface{}, 0, len(references))
|
||||||
for _, reference := range references {
|
for _, reference := range references {
|
||||||
out, err := runtime.DefaultUnstructuredConverter.ToUnstructured(&reference)
|
out, err := runtime.DefaultUnstructuredConverter.ToUnstructured(&reference)
|
||||||
@ -212,6 +217,10 @@ func (u *Unstructured) GetNamespace() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *Unstructured) SetNamespace(namespace string) {
|
func (u *Unstructured) SetNamespace(namespace string) {
|
||||||
|
if len(namespace) == 0 {
|
||||||
|
RemoveNestedField(u.Object, "metadata", "namespace")
|
||||||
|
return
|
||||||
|
}
|
||||||
u.setNestedField(namespace, "metadata", "namespace")
|
u.setNestedField(namespace, "metadata", "namespace")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -220,6 +229,10 @@ func (u *Unstructured) GetName() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *Unstructured) SetName(name string) {
|
func (u *Unstructured) SetName(name string) {
|
||||||
|
if len(name) == 0 {
|
||||||
|
RemoveNestedField(u.Object, "metadata", "name")
|
||||||
|
return
|
||||||
|
}
|
||||||
u.setNestedField(name, "metadata", "name")
|
u.setNestedField(name, "metadata", "name")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -227,8 +240,12 @@ func (u *Unstructured) GetGenerateName() string {
|
|||||||
return getNestedString(u.Object, "metadata", "generateName")
|
return getNestedString(u.Object, "metadata", "generateName")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *Unstructured) SetGenerateName(name string) {
|
func (u *Unstructured) SetGenerateName(generateName string) {
|
||||||
u.setNestedField(name, "metadata", "generateName")
|
if len(generateName) == 0 {
|
||||||
|
RemoveNestedField(u.Object, "metadata", "generateName")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
u.setNestedField(generateName, "metadata", "generateName")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *Unstructured) GetUID() types.UID {
|
func (u *Unstructured) GetUID() types.UID {
|
||||||
@ -236,6 +253,10 @@ func (u *Unstructured) GetUID() types.UID {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *Unstructured) SetUID(uid types.UID) {
|
func (u *Unstructured) SetUID(uid types.UID) {
|
||||||
|
if len(string(uid)) == 0 {
|
||||||
|
RemoveNestedField(u.Object, "metadata", "uid")
|
||||||
|
return
|
||||||
|
}
|
||||||
u.setNestedField(string(uid), "metadata", "uid")
|
u.setNestedField(string(uid), "metadata", "uid")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -243,8 +264,12 @@ func (u *Unstructured) GetResourceVersion() string {
|
|||||||
return getNestedString(u.Object, "metadata", "resourceVersion")
|
return getNestedString(u.Object, "metadata", "resourceVersion")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *Unstructured) SetResourceVersion(version string) {
|
func (u *Unstructured) SetResourceVersion(resourceVersion string) {
|
||||||
u.setNestedField(version, "metadata", "resourceVersion")
|
if len(resourceVersion) == 0 {
|
||||||
|
RemoveNestedField(u.Object, "metadata", "resourceVersion")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
u.setNestedField(resourceVersion, "metadata", "resourceVersion")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *Unstructured) GetGeneration() int64 {
|
func (u *Unstructured) GetGeneration() int64 {
|
||||||
@ -256,6 +281,10 @@ func (u *Unstructured) GetGeneration() int64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *Unstructured) SetGeneration(generation int64) {
|
func (u *Unstructured) SetGeneration(generation int64) {
|
||||||
|
if generation == 0 {
|
||||||
|
RemoveNestedField(u.Object, "metadata", "generation")
|
||||||
|
return
|
||||||
|
}
|
||||||
u.setNestedField(generation, "metadata", "generation")
|
u.setNestedField(generation, "metadata", "generation")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -264,6 +293,10 @@ func (u *Unstructured) GetSelfLink() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *Unstructured) SetSelfLink(selfLink string) {
|
func (u *Unstructured) SetSelfLink(selfLink string) {
|
||||||
|
if len(selfLink) == 0 {
|
||||||
|
RemoveNestedField(u.Object, "metadata", "selfLink")
|
||||||
|
return
|
||||||
|
}
|
||||||
u.setNestedField(selfLink, "metadata", "selfLink")
|
u.setNestedField(selfLink, "metadata", "selfLink")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -272,6 +305,10 @@ func (u *Unstructured) GetContinue() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *Unstructured) SetContinue(c string) {
|
func (u *Unstructured) SetContinue(c string) {
|
||||||
|
if len(c) == 0 {
|
||||||
|
RemoveNestedField(u.Object, "metadata", "continue")
|
||||||
|
return
|
||||||
|
}
|
||||||
u.setNestedField(c, "metadata", "continue")
|
u.setNestedField(c, "metadata", "continue")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -330,6 +367,10 @@ func (u *Unstructured) GetLabels() map[string]string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *Unstructured) SetLabels(labels map[string]string) {
|
func (u *Unstructured) SetLabels(labels map[string]string) {
|
||||||
|
if labels == nil {
|
||||||
|
RemoveNestedField(u.Object, "metadata", "labels")
|
||||||
|
return
|
||||||
|
}
|
||||||
u.setNestedMap(labels, "metadata", "labels")
|
u.setNestedMap(labels, "metadata", "labels")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -339,6 +380,10 @@ func (u *Unstructured) GetAnnotations() map[string]string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *Unstructured) SetAnnotations(annotations map[string]string) {
|
func (u *Unstructured) SetAnnotations(annotations map[string]string) {
|
||||||
|
if annotations == nil {
|
||||||
|
RemoveNestedField(u.Object, "metadata", "annotations")
|
||||||
|
return
|
||||||
|
}
|
||||||
u.setNestedMap(annotations, "metadata", "annotations")
|
u.setNestedMap(annotations, "metadata", "annotations")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -387,6 +432,10 @@ func (u *Unstructured) GetFinalizers() []string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *Unstructured) SetFinalizers(finalizers []string) {
|
func (u *Unstructured) SetFinalizers(finalizers []string) {
|
||||||
|
if finalizers == nil {
|
||||||
|
RemoveNestedField(u.Object, "metadata", "finalizers")
|
||||||
|
return
|
||||||
|
}
|
||||||
u.setNestedSlice(finalizers, "metadata", "finalizers")
|
u.setNestedSlice(finalizers, "metadata", "finalizers")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -395,5 +444,9 @@ func (u *Unstructured) GetClusterName() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *Unstructured) SetClusterName(clusterName string) {
|
func (u *Unstructured) SetClusterName(clusterName string) {
|
||||||
|
if len(clusterName) == 0 {
|
||||||
|
RemoveNestedField(u.Object, "metadata", "clusterName")
|
||||||
|
return
|
||||||
|
}
|
||||||
u.setNestedField(clusterName, "metadata", "clusterName")
|
u.setNestedField(clusterName, "metadata", "clusterName")
|
||||||
}
|
}
|
||||||
|
12
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/watch.go
generated
vendored
12
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/watch.go
generated
vendored
@ -39,7 +39,7 @@ type WatchEvent struct {
|
|||||||
Object runtime.RawExtension `json:"object" protobuf:"bytes,2,opt,name=object"`
|
Object runtime.RawExtension `json:"object" protobuf:"bytes,2,opt,name=object"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func Convert_watch_Event_to_versioned_Event(in *watch.Event, out *WatchEvent, s conversion.Scope) error {
|
func Convert_watch_Event_To_v1_WatchEvent(in *watch.Event, out *WatchEvent, s conversion.Scope) error {
|
||||||
out.Type = string(in.Type)
|
out.Type = string(in.Type)
|
||||||
switch t := in.Object.(type) {
|
switch t := in.Object.(type) {
|
||||||
case *runtime.Unknown:
|
case *runtime.Unknown:
|
||||||
@ -52,11 +52,11 @@ func Convert_watch_Event_to_versioned_Event(in *watch.Event, out *WatchEvent, s
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Convert_versioned_InternalEvent_to_versioned_Event(in *InternalEvent, out *WatchEvent, s conversion.Scope) error {
|
func Convert_v1_InternalEvent_To_v1_WatchEvent(in *InternalEvent, out *WatchEvent, s conversion.Scope) error {
|
||||||
return Convert_watch_Event_to_versioned_Event((*watch.Event)(in), out, s)
|
return Convert_watch_Event_To_v1_WatchEvent((*watch.Event)(in), out, s)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Convert_versioned_Event_to_watch_Event(in *WatchEvent, out *watch.Event, s conversion.Scope) error {
|
func Convert_v1_WatchEvent_To_watch_Event(in *WatchEvent, out *watch.Event, s conversion.Scope) error {
|
||||||
out.Type = watch.EventType(in.Type)
|
out.Type = watch.EventType(in.Type)
|
||||||
if in.Object.Object != nil {
|
if in.Object.Object != nil {
|
||||||
out.Object = in.Object.Object
|
out.Object = in.Object.Object
|
||||||
@ -70,8 +70,8 @@ func Convert_versioned_Event_to_watch_Event(in *WatchEvent, out *watch.Event, s
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Convert_versioned_Event_to_versioned_InternalEvent(in *WatchEvent, out *InternalEvent, s conversion.Scope) error {
|
func Convert_v1_WatchEvent_To_v1_InternalEvent(in *WatchEvent, out *InternalEvent, s conversion.Scope) error {
|
||||||
return Convert_versioned_Event_to_watch_Event(in, (*watch.Event)(out), s)
|
return Convert_v1_WatchEvent_To_watch_Event(in, (*watch.Event)(out), s)
|
||||||
}
|
}
|
||||||
|
|
||||||
// InternalEvent makes watch.Event versioned
|
// InternalEvent makes watch.Event versioned
|
||||||
|
69
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.deepcopy.go
generated
vendored
69
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.deepcopy.go
generated
vendored
@ -191,6 +191,36 @@ func (in *APIVersions) DeepCopyObject() runtime.Object {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *CreateOptions) DeepCopyInto(out *CreateOptions) {
|
||||||
|
*out = *in
|
||||||
|
out.TypeMeta = in.TypeMeta
|
||||||
|
if in.DryRun != nil {
|
||||||
|
in, out := &in.DryRun, &out.DryRun
|
||||||
|
*out = make([]string, len(*in))
|
||||||
|
copy(*out, *in)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CreateOptions.
|
||||||
|
func (in *CreateOptions) DeepCopy() *CreateOptions {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(CreateOptions)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||||
|
func (in *CreateOptions) 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.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in *DeleteOptions) DeepCopyInto(out *DeleteOptions) {
|
func (in *DeleteOptions) DeepCopyInto(out *DeleteOptions) {
|
||||||
*out = *in
|
*out = *in
|
||||||
@ -215,6 +245,11 @@ func (in *DeleteOptions) DeepCopyInto(out *DeleteOptions) {
|
|||||||
*out = new(DeletionPropagation)
|
*out = new(DeletionPropagation)
|
||||||
**out = **in
|
**out = **in
|
||||||
}
|
}
|
||||||
|
if in.DryRun != nil {
|
||||||
|
in, out := &in.DryRun, &out.DryRun
|
||||||
|
*out = make([]string, len(*in))
|
||||||
|
copy(*out, *in)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -443,9 +478,7 @@ func (in *Initializers) DeepCopy() *Initializers {
|
|||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in *InternalEvent) DeepCopyInto(out *InternalEvent) {
|
func (in *InternalEvent) DeepCopyInto(out *InternalEvent) {
|
||||||
*out = *in
|
*out = *in
|
||||||
if in.Object == nil {
|
if in.Object != nil {
|
||||||
out.Object = nil
|
|
||||||
} else {
|
|
||||||
out.Object = in.Object.DeepCopyObject()
|
out.Object = in.Object.DeepCopyObject()
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
@ -852,6 +885,36 @@ func (in *Timestamp) DeepCopy() *Timestamp {
|
|||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *UpdateOptions) DeepCopyInto(out *UpdateOptions) {
|
||||||
|
*out = *in
|
||||||
|
out.TypeMeta = in.TypeMeta
|
||||||
|
if in.DryRun != nil {
|
||||||
|
in, out := &in.DryRun, &out.DryRun
|
||||||
|
*out = make([]string, len(*in))
|
||||||
|
copy(*out, *in)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdateOptions.
|
||||||
|
func (in *UpdateOptions) DeepCopy() *UpdateOptions {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(UpdateOptions)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||||
|
func (in *UpdateOptions) 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.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in Verbs) DeepCopyInto(out *Verbs) {
|
func (in Verbs) DeepCopyInto(out *Verbs) {
|
||||||
{
|
{
|
||||||
|
51
vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/generated.pb.go
generated
vendored
51
vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/generated.pb.go
generated
vendored
@ -604,30 +604,29 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var fileDescriptorGenerated = []byte{
|
var fileDescriptorGenerated = []byte{
|
||||||
// 391 bytes of a gzipped FileDescriptorProto
|
// 375 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0xbd, 0x6e, 0xd4, 0x40,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0xcd, 0x0a, 0xd3, 0x40,
|
||||||
0x10, 0xc7, 0xbd, 0x42, 0x11, 0x64, 0x43, 0x1a, 0x23, 0xa4, 0x70, 0xc5, 0x3a, 0xba, 0x2a, 0x48,
|
0x10, 0xc7, 0xb3, 0x48, 0xd1, 0x6e, 0xed, 0x25, 0x22, 0xd4, 0x1e, 0x36, 0xa5, 0xa7, 0x0a, 0x76,
|
||||||
0x64, 0x97, 0x04, 0x84, 0x28, 0x91, 0xbb, 0x48, 0xa0, 0x44, 0x16, 0x15, 0x15, 0x6b, 0x7b, 0xf0,
|
0xd7, 0x16, 0x11, 0x8f, 0x92, 0x5b, 0x41, 0x69, 0x09, 0x9e, 0x3c, 0xb9, 0x49, 0xc6, 0x74, 0xcd,
|
||||||
0x2d, 0xb6, 0x77, 0xad, 0xdd, 0x71, 0xa4, 0x6b, 0x10, 0x8f, 0xc0, 0x63, 0x5d, 0x99, 0x32, 0x95,
|
0xc7, 0x86, 0xec, 0xa6, 0xd0, 0x8b, 0xf8, 0x08, 0x3e, 0x56, 0x8f, 0x3d, 0xf6, 0x14, 0x6c, 0x7c,
|
||||||
0xc5, 0x99, 0xb7, 0xa0, 0x42, 0xfe, 0x10, 0xf9, 0xb8, 0x3b, 0xe5, 0xba, 0x99, 0xff, 0xe8, 0xf7,
|
0x0b, 0x4f, 0x92, 0x0f, 0xec, 0x87, 0x15, 0x7b, 0x9b, 0xf9, 0x0f, 0xbf, 0x5f, 0x66, 0xb2, 0xd8,
|
||||||
0xf3, 0x8c, 0x97, 0x46, 0xf9, 0x7b, 0xc7, 0x95, 0x11, 0x79, 0x1d, 0x83, 0xd5, 0x80, 0xe0, 0xc4,
|
0x09, 0xdf, 0x28, 0x2a, 0x24, 0x0b, 0x73, 0x17, 0xb2, 0x04, 0x34, 0x28, 0xb6, 0x81, 0xc4, 0x97,
|
||||||
0x25, 0xe8, 0xd4, 0x58, 0x31, 0x0e, 0x64, 0xa5, 0x4a, 0x99, 0xcc, 0x94, 0x06, 0x3b, 0x17, 0x55,
|
0x19, 0x6b, 0x07, 0x3c, 0x15, 0x31, 0xf7, 0xd6, 0x22, 0x81, 0x6c, 0xcb, 0xd2, 0x30, 0xa8, 0x02,
|
||||||
0x9e, 0x75, 0x81, 0x13, 0x25, 0xa0, 0x14, 0x97, 0x27, 0x31, 0xa0, 0x3c, 0x11, 0x19, 0x68, 0xb0,
|
0xc5, 0x62, 0xd0, 0x9c, 0x6d, 0x66, 0x2e, 0x68, 0x3e, 0x63, 0x01, 0x24, 0x90, 0x71, 0x0d, 0x3e,
|
||||||
0x12, 0x21, 0xe5, 0x95, 0x35, 0x68, 0xfc, 0x97, 0x03, 0xca, 0x6f, 0xa3, 0xbc, 0xca, 0xb3, 0x2e,
|
0x4d, 0x33, 0xa9, 0xa5, 0xf9, 0xbc, 0x41, 0xe9, 0x39, 0x4a, 0xd3, 0x30, 0xa8, 0x02, 0x45, 0x2b,
|
||||||
0x70, 0xbc, 0x43, 0xf9, 0x88, 0x4e, 0x8e, 0x33, 0x85, 0xb3, 0x3a, 0xe6, 0x89, 0x29, 0x45, 0x66,
|
0x94, 0xb6, 0xe8, 0x70, 0x1a, 0x08, 0xbd, 0xce, 0x5d, 0xea, 0xc9, 0x98, 0x05, 0x32, 0x90, 0xac,
|
||||||
0x32, 0x23, 0x7a, 0x43, 0x5c, 0x7f, 0xeb, 0xbb, 0xbe, 0xe9, 0xab, 0xc1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xf0, 0x78, 0xb1, 0x64, 0xde, 0xd5, 0x92, 0x79, 0xd7,
|
0x1c, 0x89, 0xf1, 0xad, 0x24, 0x68, 0x57, 0x12, 0xb4, 0x2f, 0x09, 0x3a, 0x94, 0x04, 0xfd, 0x28,
|
||||||
0x4b, 0xe6, 0xfd, 0x6c, 0x19, 0x59, 0xb4, 0x8c, 0x5c, 0xb5, 0x8c, 0x5c, 0xb7, 0x8c, 0xfc, 0x6e,
|
0x09, 0xfa, 0xfe, 0x93, 0x18, 0x1f, 0x1f, 0xb6, 0xab, 0xff, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xf3,
|
||||||
0x19, 0xf9, 0xf5, 0x87, 0x79, 0x5f, 0x1e, 0x8f, 0xab, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x73,
|
0xe1, 0xde, 0x86, 0xdb, 0x02, 0x00, 0x00,
|
||||||
0xdf, 0x3a, 0x0c, 0x10, 0x03, 0x00, 0x00,
|
|
||||||
}
|
}
|
||||||
|
1
vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/generated.proto
generated
vendored
1
vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/generated.proto
generated
vendored
@ -24,7 +24,6 @@ package k8s.io.apimachinery.pkg.apis.meta.v1beta1;
|
|||||||
import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
|
import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
|
||||||
import "k8s.io/apimachinery/pkg/runtime/generated.proto";
|
import "k8s.io/apimachinery/pkg/runtime/generated.proto";
|
||||||
import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
|
import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
|
||||||
import "k8s.io/apimachinery/pkg/util/intstr/generated.proto";
|
|
||||||
|
|
||||||
// Package-wide variables from generator "generated".
|
// Package-wide variables from generator "generated".
|
||||||
option go_package = "v1beta1";
|
option go_package = "v1beta1";
|
||||||
|
4
vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/zz_generated.deepcopy.go
generated
vendored
4
vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/zz_generated.deepcopy.go
generated
vendored
@ -58,9 +58,7 @@ func (in *PartialObjectMetadataList) DeepCopyInto(out *PartialObjectMetadataList
|
|||||||
in, out := &in.Items, &out.Items
|
in, out := &in.Items, &out.Items
|
||||||
*out = make([]*PartialObjectMetadata, len(*in))
|
*out = make([]*PartialObjectMetadata, len(*in))
|
||||||
for i := range *in {
|
for i := range *in {
|
||||||
if (*in)[i] == nil {
|
if (*in)[i] != nil {
|
||||||
(*out)[i] = nil
|
|
||||||
} else {
|
|
||||||
in, out := &(*in)[i], &(*out)[i]
|
in, out := &(*in)[i], &(*out)[i]
|
||||||
*out = new(PartialObjectMetadata)
|
*out = new(PartialObjectMetadata)
|
||||||
(*in).DeepCopyInto(*out)
|
(*in).DeepCopyInto(*out)
|
||||||
|
132
vendor/k8s.io/apimachinery/pkg/conversion/converter.go
generated
vendored
132
vendor/k8s.io/apimachinery/pkg/conversion/converter.go
generated
vendored
@ -40,7 +40,11 @@ type NameFunc func(t reflect.Type) string
|
|||||||
|
|
||||||
var DefaultNameFunc = func(t reflect.Type) string { return t.Name() }
|
var DefaultNameFunc = func(t reflect.Type) string { return t.Name() }
|
||||||
|
|
||||||
type GenericConversionFunc func(a, b interface{}, scope Scope) (bool, error)
|
// ConversionFunc converts the object a into the object b, reusing arrays or objects
|
||||||
|
// or pointers if necessary. It should return an error if the object cannot be converted
|
||||||
|
// or if some data is invalid. If you do not wish a and b to share fields or nested
|
||||||
|
// objects, you must copy a before calling this function.
|
||||||
|
type ConversionFunc func(a, b interface{}, scope Scope) error
|
||||||
|
|
||||||
// Converter knows how to convert one type to another.
|
// Converter knows how to convert one type to another.
|
||||||
type Converter struct {
|
type Converter struct {
|
||||||
@ -49,11 +53,6 @@ type Converter struct {
|
|||||||
conversionFuncs ConversionFuncs
|
conversionFuncs ConversionFuncs
|
||||||
generatedConversionFuncs ConversionFuncs
|
generatedConversionFuncs ConversionFuncs
|
||||||
|
|
||||||
// genericConversions are called during normal conversion to offer a "fast-path"
|
|
||||||
// that avoids all reflection. These methods are not called outside of the .Convert()
|
|
||||||
// method.
|
|
||||||
genericConversions []GenericConversionFunc
|
|
||||||
|
|
||||||
// Set of conversions that should be treated as a no-op
|
// Set of conversions that should be treated as a no-op
|
||||||
ignoredConversions map[typePair]struct{}
|
ignoredConversions map[typePair]struct{}
|
||||||
|
|
||||||
@ -98,14 +97,6 @@ func NewConverter(nameFn NameFunc) *Converter {
|
|||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddGenericConversionFunc adds a function that accepts the ConversionFunc call pattern
|
|
||||||
// (for two conversion types) to the converter. These functions are checked first during
|
|
||||||
// a normal conversion, but are otherwise not called. Use AddConversionFuncs when registering
|
|
||||||
// typed conversions.
|
|
||||||
func (c *Converter) AddGenericConversionFunc(fn GenericConversionFunc) {
|
|
||||||
c.genericConversions = append(c.genericConversions, fn)
|
|
||||||
}
|
|
||||||
|
|
||||||
// WithConversions returns a Converter that is a copy of c but with the additional
|
// WithConversions returns a Converter that is a copy of c but with the additional
|
||||||
// fns merged on top.
|
// fns merged on top.
|
||||||
func (c *Converter) WithConversions(fns ConversionFuncs) *Converter {
|
func (c *Converter) WithConversions(fns ConversionFuncs) *Converter {
|
||||||
@ -161,11 +152,15 @@ type Scope interface {
|
|||||||
type FieldMappingFunc func(key string, sourceTag, destTag reflect.StructTag) (source string, dest string)
|
type FieldMappingFunc func(key string, sourceTag, destTag reflect.StructTag) (source string, dest string)
|
||||||
|
|
||||||
func NewConversionFuncs() ConversionFuncs {
|
func NewConversionFuncs() ConversionFuncs {
|
||||||
return ConversionFuncs{fns: make(map[typePair]reflect.Value)}
|
return ConversionFuncs{
|
||||||
|
fns: make(map[typePair]reflect.Value),
|
||||||
|
untyped: make(map[typePair]ConversionFunc),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type ConversionFuncs struct {
|
type ConversionFuncs struct {
|
||||||
fns map[typePair]reflect.Value
|
fns map[typePair]reflect.Value
|
||||||
|
untyped map[typePair]ConversionFunc
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add adds the provided conversion functions to the lookup table - they must have the signature
|
// Add adds the provided conversion functions to the lookup table - they must have the signature
|
||||||
@ -183,6 +178,21 @@ func (c ConversionFuncs) Add(fns ...interface{}) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AddUntyped adds the provided conversion function to the lookup table for the types that are
|
||||||
|
// supplied as a and b. a and b must be pointers or an error is returned. This method overwrites
|
||||||
|
// previously defined functions.
|
||||||
|
func (c ConversionFuncs) AddUntyped(a, b interface{}, fn ConversionFunc) error {
|
||||||
|
tA, tB := reflect.TypeOf(a), reflect.TypeOf(b)
|
||||||
|
if tA.Kind() != reflect.Ptr {
|
||||||
|
return fmt.Errorf("the type %T must be a pointer to register as an untyped conversion", a)
|
||||||
|
}
|
||||||
|
if tB.Kind() != reflect.Ptr {
|
||||||
|
return fmt.Errorf("the type %T must be a pointer to register as an untyped conversion", b)
|
||||||
|
}
|
||||||
|
c.untyped[typePair{tA, tB}] = fn
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// Merge returns a new ConversionFuncs that contains all conversions from
|
// Merge returns a new ConversionFuncs that contains all conversions from
|
||||||
// both other and c, with other conversions taking precedence.
|
// both other and c, with other conversions taking precedence.
|
||||||
func (c ConversionFuncs) Merge(other ConversionFuncs) ConversionFuncs {
|
func (c ConversionFuncs) Merge(other ConversionFuncs) ConversionFuncs {
|
||||||
@ -193,6 +203,12 @@ func (c ConversionFuncs) Merge(other ConversionFuncs) ConversionFuncs {
|
|||||||
for k, v := range other.fns {
|
for k, v := range other.fns {
|
||||||
merged.fns[k] = v
|
merged.fns[k] = v
|
||||||
}
|
}
|
||||||
|
for k, v := range c.untyped {
|
||||||
|
merged.untyped[k] = v
|
||||||
|
}
|
||||||
|
for k, v := range other.untyped {
|
||||||
|
merged.untyped[k] = v
|
||||||
|
}
|
||||||
return merged
|
return merged
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -355,16 +371,32 @@ func verifyConversionFunctionSignature(ft reflect.Type) error {
|
|||||||
// // conversion logic...
|
// // conversion logic...
|
||||||
// return nil
|
// return nil
|
||||||
// })
|
// })
|
||||||
|
// DEPRECATED: Will be removed in favor of RegisterUntypedConversionFunc
|
||||||
func (c *Converter) RegisterConversionFunc(conversionFunc interface{}) error {
|
func (c *Converter) RegisterConversionFunc(conversionFunc interface{}) error {
|
||||||
return c.conversionFuncs.Add(conversionFunc)
|
return c.conversionFuncs.Add(conversionFunc)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Similar to RegisterConversionFunc, but registers conversion function that were
|
// Similar to RegisterConversionFunc, but registers conversion function that were
|
||||||
// automatically generated.
|
// automatically generated.
|
||||||
|
// DEPRECATED: Will be removed in favor of RegisterGeneratedUntypedConversionFunc
|
||||||
func (c *Converter) RegisterGeneratedConversionFunc(conversionFunc interface{}) error {
|
func (c *Converter) RegisterGeneratedConversionFunc(conversionFunc interface{}) error {
|
||||||
return c.generatedConversionFuncs.Add(conversionFunc)
|
return c.generatedConversionFuncs.Add(conversionFunc)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RegisterUntypedConversionFunc registers a function that converts between a and b by passing objects of those
|
||||||
|
// types to the provided function. The function *must* accept objects of a and b - this machinery will not enforce
|
||||||
|
// any other guarantee.
|
||||||
|
func (c *Converter) RegisterUntypedConversionFunc(a, b interface{}, fn ConversionFunc) error {
|
||||||
|
return c.conversionFuncs.AddUntyped(a, b, fn)
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterGeneratedUntypedConversionFunc registers a function that converts between a and b by passing objects of those
|
||||||
|
// types to the provided function. The function *must* accept objects of a and b - this machinery will not enforce
|
||||||
|
// any other guarantee.
|
||||||
|
func (c *Converter) RegisterGeneratedUntypedConversionFunc(a, b interface{}, fn ConversionFunc) error {
|
||||||
|
return c.generatedConversionFuncs.AddUntyped(a, b, fn)
|
||||||
|
}
|
||||||
|
|
||||||
// RegisterIgnoredConversion registers a "no-op" for conversion, where any requested
|
// RegisterIgnoredConversion registers a "no-op" for conversion, where any requested
|
||||||
// conversion between from and to is ignored.
|
// conversion between from and to is ignored.
|
||||||
func (c *Converter) RegisterIgnoredConversion(from, to interface{}) error {
|
func (c *Converter) RegisterIgnoredConversion(from, to interface{}) error {
|
||||||
@ -380,39 +412,6 @@ func (c *Converter) RegisterIgnoredConversion(from, to interface{}) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsConversionIgnored returns true if the specified objects should be dropped during
|
|
||||||
// conversion.
|
|
||||||
func (c *Converter) IsConversionIgnored(inType, outType reflect.Type) bool {
|
|
||||||
_, found := c.ignoredConversions[typePair{inType, outType}]
|
|
||||||
return found
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Converter) HasConversionFunc(inType, outType reflect.Type) bool {
|
|
||||||
_, found := c.conversionFuncs.fns[typePair{inType, outType}]
|
|
||||||
return found
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Converter) ConversionFuncValue(inType, outType reflect.Type) (reflect.Value, bool) {
|
|
||||||
value, found := c.conversionFuncs.fns[typePair{inType, outType}]
|
|
||||||
return value, found
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetStructFieldCopy registers a correspondence. Whenever a struct field is encountered
|
|
||||||
// which has a type and name matching srcFieldType and srcFieldName, it wil be copied
|
|
||||||
// into the field in the destination struct matching destFieldType & Name, if such a
|
|
||||||
// field exists.
|
|
||||||
// May be called multiple times, even for the same source field & type--all applicable
|
|
||||||
// copies will be performed.
|
|
||||||
func (c *Converter) SetStructFieldCopy(srcFieldType interface{}, srcFieldName string, destFieldType interface{}, destFieldName string) error {
|
|
||||||
st := reflect.TypeOf(srcFieldType)
|
|
||||||
dt := reflect.TypeOf(destFieldType)
|
|
||||||
srcKey := typeNamePair{st, srcFieldName}
|
|
||||||
destKey := typeNamePair{dt, destFieldName}
|
|
||||||
c.structFieldDests[srcKey] = append(c.structFieldDests[srcKey], destKey)
|
|
||||||
c.structFieldSources[destKey] = append(c.structFieldSources[destKey], srcKey)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// RegisterInputDefaults registers a field name mapping function, used when converting
|
// RegisterInputDefaults registers a field name mapping function, used when converting
|
||||||
// from maps to structs. Inputs to the conversion methods are checked for this type and a mapping
|
// from maps to structs. Inputs to the conversion methods are checked for this type and a mapping
|
||||||
// applied automatically if the input matches in. A set of default flags for the input conversion
|
// applied automatically if the input matches in. A set of default flags for the input conversion
|
||||||
@ -468,15 +467,6 @@ func (f FieldMatchingFlags) IsSet(flag FieldMatchingFlags) bool {
|
|||||||
// it is not used by Convert() other than storing it in the scope.
|
// it is not used by Convert() other than storing it in the scope.
|
||||||
// Not safe for objects with cyclic references!
|
// Not safe for objects with cyclic references!
|
||||||
func (c *Converter) Convert(src, dest interface{}, flags FieldMatchingFlags, meta *Meta) error {
|
func (c *Converter) Convert(src, dest interface{}, flags FieldMatchingFlags, meta *Meta) error {
|
||||||
if len(c.genericConversions) > 0 {
|
|
||||||
// TODO: avoid scope allocation
|
|
||||||
s := &scope{converter: c, flags: flags, meta: meta}
|
|
||||||
for _, fn := range c.genericConversions {
|
|
||||||
if ok, err := fn(src, dest, s); ok {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return c.doConversion(src, dest, flags, meta, c.convert)
|
return c.doConversion(src, dest, flags, meta, c.convert)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -495,6 +485,21 @@ func (c *Converter) DefaultConvert(src, dest interface{}, flags FieldMatchingFla
|
|||||||
type conversionFunc func(sv, dv reflect.Value, scope *scope) error
|
type conversionFunc func(sv, dv reflect.Value, scope *scope) error
|
||||||
|
|
||||||
func (c *Converter) doConversion(src, dest interface{}, flags FieldMatchingFlags, meta *Meta, f conversionFunc) error {
|
func (c *Converter) doConversion(src, dest interface{}, flags FieldMatchingFlags, meta *Meta, f conversionFunc) error {
|
||||||
|
pair := typePair{reflect.TypeOf(src), reflect.TypeOf(dest)}
|
||||||
|
scope := &scope{
|
||||||
|
converter: c,
|
||||||
|
flags: flags,
|
||||||
|
meta: meta,
|
||||||
|
}
|
||||||
|
if fn, ok := c.conversionFuncs.untyped[pair]; ok {
|
||||||
|
return fn(src, dest, scope)
|
||||||
|
}
|
||||||
|
if fn, ok := c.generatedConversionFuncs.untyped[pair]; ok {
|
||||||
|
return fn(src, dest, scope)
|
||||||
|
}
|
||||||
|
// TODO: consider everything past this point deprecated - we want to support only point to point top level
|
||||||
|
// conversions
|
||||||
|
|
||||||
dv, err := EnforcePtr(dest)
|
dv, err := EnforcePtr(dest)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -506,15 +511,10 @@ func (c *Converter) doConversion(src, dest interface{}, flags FieldMatchingFlags
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
s := &scope{
|
|
||||||
converter: c,
|
|
||||||
flags: flags,
|
|
||||||
meta: meta,
|
|
||||||
}
|
|
||||||
// Leave something on the stack, so that calls to struct tag getters never fail.
|
// Leave something on the stack, so that calls to struct tag getters never fail.
|
||||||
s.srcStack.push(scopeStackElem{})
|
scope.srcStack.push(scopeStackElem{})
|
||||||
s.destStack.push(scopeStackElem{})
|
scope.destStack.push(scopeStackElem{})
|
||||||
return f(sv, dv, s)
|
return f(sv, dv, scope)
|
||||||
}
|
}
|
||||||
|
|
||||||
// callCustom calls 'custom' with sv & dv. custom must be a conversion function.
|
// callCustom calls 'custom' with sv & dv. custom must be a conversion function.
|
||||||
|
16
vendor/k8s.io/apimachinery/pkg/labels/selector.go
generated
vendored
16
vendor/k8s.io/apimachinery/pkg/labels/selector.go
generated
vendored
@ -166,7 +166,6 @@ func NewRequirement(key string, op selection.Operator, vals []string) (*Requirem
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sort.Strings(vals)
|
|
||||||
return &Requirement{key: key, operator: op, strValues: vals}, nil
|
return &Requirement{key: key, operator: op, strValues: vals}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -299,7 +298,9 @@ func (r *Requirement) String() string {
|
|||||||
if len(r.strValues) == 1 {
|
if len(r.strValues) == 1 {
|
||||||
buffer.WriteString(r.strValues[0])
|
buffer.WriteString(r.strValues[0])
|
||||||
} else { // only > 1 since == 0 prohibited by NewRequirement
|
} else { // only > 1 since == 0 prohibited by NewRequirement
|
||||||
buffer.WriteString(strings.Join(r.strValues, ","))
|
// normalizes value order on output, without mutating the in-memory selector representation
|
||||||
|
// also avoids normalization when it is not required, and ensures we do not mutate shared data
|
||||||
|
buffer.WriteString(strings.Join(safeSort(r.strValues), ","))
|
||||||
}
|
}
|
||||||
|
|
||||||
switch r.operator {
|
switch r.operator {
|
||||||
@ -309,6 +310,17 @@ func (r *Requirement) String() string {
|
|||||||
return buffer.String()
|
return buffer.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// safeSort sort input strings without modification
|
||||||
|
func safeSort(in []string) []string {
|
||||||
|
if sort.StringsAreSorted(in) {
|
||||||
|
return in
|
||||||
|
}
|
||||||
|
out := make([]string, len(in))
|
||||||
|
copy(out, in)
|
||||||
|
sort.Strings(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
// Add adds requirements to the selector. It copies the current selector returning a new one
|
// Add adds requirements to the selector. It copies the current selector returning a new one
|
||||||
func (lsel internalSelector) Add(reqs ...Requirement) Selector {
|
func (lsel internalSelector) Add(reqs ...Requirement) Selector {
|
||||||
var sel internalSelector
|
var sel internalSelector
|
||||||
|
18
vendor/k8s.io/apimachinery/pkg/runtime/codec.go
generated
vendored
18
vendor/k8s.io/apimachinery/pkg/runtime/codec.go
generated
vendored
@ -76,24 +76,6 @@ func EncodeOrDie(e Encoder, obj Object) string {
|
|||||||
return string(bytes)
|
return string(bytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
// DefaultingSerializer invokes defaulting after decoding.
|
|
||||||
type DefaultingSerializer struct {
|
|
||||||
Defaulter ObjectDefaulter
|
|
||||||
Decoder Decoder
|
|
||||||
// Encoder is optional to allow this type to be used as both a Decoder and an Encoder
|
|
||||||
Encoder
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decode performs a decode and then allows the defaulter to act on the provided object.
|
|
||||||
func (d DefaultingSerializer) Decode(data []byte, defaultGVK *schema.GroupVersionKind, into Object) (Object, *schema.GroupVersionKind, error) {
|
|
||||||
obj, gvk, err := d.Decoder.Decode(data, defaultGVK, into)
|
|
||||||
if err != nil {
|
|
||||||
return obj, gvk, err
|
|
||||||
}
|
|
||||||
d.Defaulter.Default(obj)
|
|
||||||
return obj, gvk, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// UseOrCreateObject returns obj if the canonical ObjectKind returned by the provided typer matches gvk, or
|
// UseOrCreateObject returns obj if the canonical ObjectKind returned by the provided typer matches gvk, or
|
||||||
// invokes the ObjectCreator to instantiate a new gvk. Returns an error if the typer cannot find the object.
|
// invokes the ObjectCreator to instantiate a new gvk. Returns an error if the typer cannot find the object.
|
||||||
func UseOrCreateObject(t ObjectTyper, c ObjectCreater, gvk schema.GroupVersionKind, obj Object) (Object, error) {
|
func UseOrCreateObject(t ObjectTyper, c ObjectCreater, gvk schema.GroupVersionKind, obj Object) (Object, error) {
|
||||||
|
6
vendor/k8s.io/apimachinery/pkg/runtime/conversion.go
generated
vendored
6
vendor/k8s.io/apimachinery/pkg/runtime/conversion.go
generated
vendored
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Defines conversions between generic types and structs to map query strings
|
// Package runtime defines conversions between generic types and structs to map query strings
|
||||||
// to struct objects.
|
// to struct objects.
|
||||||
package runtime
|
package runtime
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/conversion"
|
"k8s.io/apimachinery/pkg/conversion"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DefaultFieldSelectorConversion auto-accepts metav1 values for name and namespace.
|
// DefaultMetaV1FieldSelectorConversion auto-accepts metav1 values for name and namespace.
|
||||||
// A cluster scoped resource specifying namespace empty works fine and specifying a particular
|
// A cluster scoped resource specifying namespace empty works fine and specifying a particular
|
||||||
// namespace will return no results, as expected.
|
// namespace will return no results, as expected.
|
||||||
func DefaultMetaV1FieldSelectorConversion(label, value string) (string, string, error) {
|
func DefaultMetaV1FieldSelectorConversion(label, value string) (string, string, error) {
|
||||||
@ -82,7 +82,7 @@ func Convert_Slice_string_To_int(input *[]string, out *int, s conversion.Scope)
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Conver_Slice_string_To_bool will convert a string parameter to boolean.
|
// Convert_Slice_string_To_bool will convert a string parameter to boolean.
|
||||||
// Only the absence of a value, a value of "false", or a value of "0" resolve to false.
|
// Only the absence of a value, a value of "false", or a value of "0" resolve to false.
|
||||||
// Any other value (including empty string) resolves to true.
|
// Any other value (including empty string) resolves to true.
|
||||||
func Convert_Slice_string_To_bool(input *[]string, out *bool, s conversion.Scope) error {
|
func Convert_Slice_string_To_bool(input *[]string, out *bool, s conversion.Scope) error {
|
||||||
|
22
vendor/k8s.io/apimachinery/pkg/runtime/doc.go
generated
vendored
22
vendor/k8s.io/apimachinery/pkg/runtime/doc.go
generated
vendored
@ -18,20 +18,27 @@ limitations under the License.
|
|||||||
// that follow the kubernetes API object conventions, which are:
|
// that follow the kubernetes API object conventions, which are:
|
||||||
//
|
//
|
||||||
// 0. Your API objects have a common metadata struct member, TypeMeta.
|
// 0. Your API objects have a common metadata struct member, TypeMeta.
|
||||||
|
//
|
||||||
// 1. Your code refers to an internal set of API objects.
|
// 1. Your code refers to an internal set of API objects.
|
||||||
|
//
|
||||||
// 2. In a separate package, you have an external set of API objects.
|
// 2. In a separate package, you have an external set of API objects.
|
||||||
|
//
|
||||||
// 3. The external set is considered to be versioned, and no breaking
|
// 3. The external set is considered to be versioned, and no breaking
|
||||||
// changes are ever made to it (fields may be added but not changed
|
// changes are ever made to it (fields may be added but not changed
|
||||||
// or removed).
|
// or removed).
|
||||||
|
//
|
||||||
// 4. As your api evolves, you'll make an additional versioned package
|
// 4. As your api evolves, you'll make an additional versioned package
|
||||||
// with every major change.
|
// with every major change.
|
||||||
|
//
|
||||||
// 5. Versioned packages have conversion functions which convert to
|
// 5. Versioned packages have conversion functions which convert to
|
||||||
// and from the internal version.
|
// and from the internal version.
|
||||||
|
//
|
||||||
// 6. You'll continue to support older versions according to your
|
// 6. You'll continue to support older versions according to your
|
||||||
// deprecation policy, and you can easily provide a program/library
|
// deprecation policy, and you can easily provide a program/library
|
||||||
// to update old versions into new versions because of 5.
|
// to update old versions into new versions because of 5.
|
||||||
|
//
|
||||||
// 7. All of your serializations and deserializations are handled in a
|
// 7. All of your serializations and deserializations are handled in a
|
||||||
// centralized place.
|
// centralized place.
|
||||||
//
|
//
|
||||||
// Package runtime provides a conversion helper to make 5 easy, and the
|
// Package runtime provides a conversion helper to make 5 easy, and the
|
||||||
// Encode/Decode/DecodeInto trio to accomplish 7. You can also register
|
// Encode/Decode/DecodeInto trio to accomplish 7. You can also register
|
||||||
@ -41,5 +48,4 @@ limitations under the License.
|
|||||||
//
|
//
|
||||||
// As a bonus, a few common types useful from all api objects and versions
|
// As a bonus, a few common types useful from all api objects and versions
|
||||||
// are provided in types.go.
|
// are provided in types.go.
|
||||||
|
|
||||||
package runtime // import "k8s.io/apimachinery/pkg/runtime"
|
package runtime // import "k8s.io/apimachinery/pkg/runtime"
|
||||||
|
28
vendor/k8s.io/apimachinery/pkg/runtime/embedded.go
generated
vendored
28
vendor/k8s.io/apimachinery/pkg/runtime/embedded.go
generated
vendored
@ -31,7 +31,7 @@ type encodable struct {
|
|||||||
|
|
||||||
func (e encodable) GetObjectKind() schema.ObjectKind { return e.obj.GetObjectKind() }
|
func (e encodable) GetObjectKind() schema.ObjectKind { return e.obj.GetObjectKind() }
|
||||||
func (e encodable) DeepCopyObject() Object {
|
func (e encodable) DeepCopyObject() Object {
|
||||||
var out encodable = e
|
out := e
|
||||||
out.obj = e.obj.DeepCopyObject()
|
out.obj = e.obj.DeepCopyObject()
|
||||||
copy(out.versions, e.versions)
|
copy(out.versions, e.versions)
|
||||||
return out
|
return out
|
||||||
@ -46,14 +46,14 @@ func NewEncodable(e Encoder, obj Object, versions ...schema.GroupVersion) Object
|
|||||||
return encodable{e, obj, versions}
|
return encodable{e, obj, versions}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (re encodable) UnmarshalJSON(in []byte) error {
|
func (e encodable) UnmarshalJSON(in []byte) error {
|
||||||
return errors.New("runtime.encodable cannot be unmarshalled from JSON")
|
return errors.New("runtime.encodable cannot be unmarshalled from JSON")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Marshal may get called on pointers or values, so implement MarshalJSON on value.
|
// Marshal may get called on pointers or values, so implement MarshalJSON on value.
|
||||||
// http://stackoverflow.com/questions/21390979/custom-marshaljson-never-gets-called-in-go
|
// http://stackoverflow.com/questions/21390979/custom-marshaljson-never-gets-called-in-go
|
||||||
func (re encodable) MarshalJSON() ([]byte, error) {
|
func (e encodable) MarshalJSON() ([]byte, error) {
|
||||||
return Encode(re.E, re.obj)
|
return Encode(e.E, e.obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewEncodableList creates an object that will be encoded with the provided codec on demand.
|
// NewEncodableList creates an object that will be encoded with the provided codec on demand.
|
||||||
@ -70,28 +70,28 @@ func NewEncodableList(e Encoder, objects []Object, versions ...schema.GroupVersi
|
|||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
func (re *Unknown) UnmarshalJSON(in []byte) error {
|
func (e *Unknown) UnmarshalJSON(in []byte) error {
|
||||||
if re == nil {
|
if e == nil {
|
||||||
return errors.New("runtime.Unknown: UnmarshalJSON on nil pointer")
|
return errors.New("runtime.Unknown: UnmarshalJSON on nil pointer")
|
||||||
}
|
}
|
||||||
re.TypeMeta = TypeMeta{}
|
e.TypeMeta = TypeMeta{}
|
||||||
re.Raw = append(re.Raw[0:0], in...)
|
e.Raw = append(e.Raw[0:0], in...)
|
||||||
re.ContentEncoding = ""
|
e.ContentEncoding = ""
|
||||||
re.ContentType = ContentTypeJSON
|
e.ContentType = ContentTypeJSON
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Marshal may get called on pointers or values, so implement MarshalJSON on value.
|
// Marshal may get called on pointers or values, so implement MarshalJSON on value.
|
||||||
// http://stackoverflow.com/questions/21390979/custom-marshaljson-never-gets-called-in-go
|
// http://stackoverflow.com/questions/21390979/custom-marshaljson-never-gets-called-in-go
|
||||||
func (re Unknown) MarshalJSON() ([]byte, error) {
|
func (e Unknown) MarshalJSON() ([]byte, error) {
|
||||||
// If ContentType is unset, we assume this is JSON.
|
// If ContentType is unset, we assume this is JSON.
|
||||||
if re.ContentType != "" && re.ContentType != ContentTypeJSON {
|
if e.ContentType != "" && e.ContentType != ContentTypeJSON {
|
||||||
return nil, errors.New("runtime.Unknown: MarshalJSON on non-json data")
|
return nil, errors.New("runtime.Unknown: MarshalJSON on non-json data")
|
||||||
}
|
}
|
||||||
if re.Raw == nil {
|
if e.Raw == nil {
|
||||||
return []byte("null"), nil
|
return []byte("null"), nil
|
||||||
}
|
}
|
||||||
return re.Raw, nil
|
return e.Raw, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Convert_runtime_Object_To_runtime_RawExtension(in *Object, out *RawExtension, s conversion.Scope) error {
|
func Convert_runtime_Object_To_runtime_RawExtension(in *Object, out *RawExtension, s conversion.Scope) error {
|
||||||
|
35
vendor/k8s.io/apimachinery/pkg/runtime/error.go
generated
vendored
35
vendor/k8s.io/apimachinery/pkg/runtime/error.go
generated
vendored
@ -24,46 +24,47 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type notRegisteredErr struct {
|
type notRegisteredErr struct {
|
||||||
gvk schema.GroupVersionKind
|
schemeName string
|
||||||
target GroupVersioner
|
gvk schema.GroupVersionKind
|
||||||
t reflect.Type
|
target GroupVersioner
|
||||||
|
t reflect.Type
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewNotRegisteredErrForKind(gvk schema.GroupVersionKind) error {
|
func NewNotRegisteredErrForKind(schemeName string, gvk schema.GroupVersionKind) error {
|
||||||
return ¬RegisteredErr{gvk: gvk}
|
return ¬RegisteredErr{schemeName: schemeName, gvk: gvk}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewNotRegisteredErrForType(t reflect.Type) error {
|
func NewNotRegisteredErrForType(schemeName string, t reflect.Type) error {
|
||||||
return ¬RegisteredErr{t: t}
|
return ¬RegisteredErr{schemeName: schemeName, t: t}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewNotRegisteredErrForTarget(t reflect.Type, target GroupVersioner) error {
|
func NewNotRegisteredErrForTarget(schemeName string, t reflect.Type, target GroupVersioner) error {
|
||||||
return ¬RegisteredErr{t: t, target: target}
|
return ¬RegisteredErr{schemeName: schemeName, t: t, target: target}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewNotRegisteredGVKErrForTarget(gvk schema.GroupVersionKind, target GroupVersioner) error {
|
func NewNotRegisteredGVKErrForTarget(schemeName string, gvk schema.GroupVersionKind, target GroupVersioner) error {
|
||||||
return ¬RegisteredErr{gvk: gvk, target: target}
|
return ¬RegisteredErr{schemeName: schemeName, gvk: gvk, target: target}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (k *notRegisteredErr) Error() string {
|
func (k *notRegisteredErr) Error() string {
|
||||||
if k.t != nil && k.target != nil {
|
if k.t != nil && k.target != nil {
|
||||||
return fmt.Sprintf("%v is not suitable for converting to %q", k.t, k.target)
|
return fmt.Sprintf("%v is not suitable for converting to %q in scheme %q", k.t, k.target, k.schemeName)
|
||||||
}
|
}
|
||||||
nullGVK := schema.GroupVersionKind{}
|
nullGVK := schema.GroupVersionKind{}
|
||||||
if k.gvk != nullGVK && k.target != nil {
|
if k.gvk != nullGVK && k.target != nil {
|
||||||
return fmt.Sprintf("%q is not suitable for converting to %q", k.gvk.GroupVersion(), k.target)
|
return fmt.Sprintf("%q is not suitable for converting to %q in scheme %q", k.gvk.GroupVersion(), k.target, k.schemeName)
|
||||||
}
|
}
|
||||||
if k.t != nil {
|
if k.t != nil {
|
||||||
return fmt.Sprintf("no kind is registered for the type %v", k.t)
|
return fmt.Sprintf("no kind is registered for the type %v in scheme %q", k.t, k.schemeName)
|
||||||
}
|
}
|
||||||
if len(k.gvk.Kind) == 0 {
|
if len(k.gvk.Kind) == 0 {
|
||||||
return fmt.Sprintf("no version %q has been registered", k.gvk.GroupVersion())
|
return fmt.Sprintf("no version %q has been registered in scheme %q", k.gvk.GroupVersion(), k.schemeName)
|
||||||
}
|
}
|
||||||
if k.gvk.Version == APIVersionInternal {
|
if k.gvk.Version == APIVersionInternal {
|
||||||
return fmt.Sprintf("no kind %q is registered for the internal version of group %q", k.gvk.Kind, k.gvk.Group)
|
return fmt.Sprintf("no kind %q is registered for the internal version of group %q in scheme %q", k.gvk.Kind, k.gvk.Group, k.schemeName)
|
||||||
}
|
}
|
||||||
|
|
||||||
return fmt.Sprintf("no kind %q is registered for version %q", k.gvk.Kind, k.gvk.GroupVersion())
|
return fmt.Sprintf("no kind %q is registered for version %q in scheme %q", k.gvk.Kind, k.gvk.GroupVersion(), k.schemeName)
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsNotRegisteredError returns true if the error indicates the provided
|
// IsNotRegisteredError returns true if the error indicates the provided
|
||||||
|
2
vendor/k8s.io/apimachinery/pkg/runtime/extension.go
generated
vendored
2
vendor/k8s.io/apimachinery/pkg/runtime/extension.go
generated
vendored
@ -32,7 +32,7 @@ func (re *RawExtension) UnmarshalJSON(in []byte) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Marshal may get called on pointers or values, so implement MarshalJSON on value.
|
// MarshalJSON may get called on pointers or values, so implement MarshalJSON on value.
|
||||||
// http://stackoverflow.com/questions/21390979/custom-marshaljson-never-gets-called-in-go
|
// http://stackoverflow.com/questions/21390979/custom-marshaljson-never-gets-called-in-go
|
||||||
func (re RawExtension) MarshalJSON() ([]byte, error) {
|
func (re RawExtension) MarshalJSON() ([]byte, error) {
|
||||||
if re.Raw == nil {
|
if re.Raw == nil {
|
||||||
|
51
vendor/k8s.io/apimachinery/pkg/runtime/generated.pb.go
generated
vendored
51
vendor/k8s.io/apimachinery/pkg/runtime/generated.pb.go
generated
vendored
@ -744,30 +744,29 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var fileDescriptorGenerated = []byte{
|
var fileDescriptorGenerated = []byte{
|
||||||
// 395 bytes of a gzipped FileDescriptorProto
|
// 378 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x90, 0x4f, 0x6f, 0xd3, 0x30,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x8f, 0x4f, 0xab, 0x13, 0x31,
|
||||||
0x18, 0xc6, 0xe3, 0xb5, 0x52, 0x87, 0x5b, 0x69, 0xc8, 0x1c, 0x08, 0x3b, 0x38, 0x53, 0x4f, 0xec,
|
0x14, 0xc5, 0x27, 0xaf, 0x85, 0x3e, 0xd3, 0xc2, 0x93, 0xb8, 0x70, 0x74, 0x91, 0x79, 0x74, 0xe5,
|
||||||
0x30, 0x5b, 0x1a, 0x42, 0xe2, 0xba, 0x4c, 0x93, 0x40, 0x08, 0x09, 0x59, 0xfc, 0x91, 0x38, 0xe1,
|
0x5b, 0xbc, 0x04, 0x1e, 0x08, 0x6e, 0x3b, 0xa5, 0xa0, 0x88, 0x20, 0xc1, 0x3f, 0xe0, 0xca, 0x74,
|
||||||
0x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x43, 0xde, 0xd5, 0xf8, 0x4f, 0x59, 0xfc, 0xed, 0x27, 0x4f, 0x71, 0x3f, 0x8c, 0xf6, 0xab, 0xe3,
|
||||||
0x0f, 0x43, 0xde, 0xd1, 0xe5, 0xdf, 0xb2, 0xd8, 0xf7, 0x93, 0xa7, 0x78, 0x18, 0x46, 0xab, 0xd5,
|
0xae, 0xc7, 0x1f, 0x04, 0xbc, 0x3f, 0xfe, 0x2d, 0x89, 0x73, 0x5f, 0x7a, 0xbb, 0xda, 0xd1, 0x68,
|
||||||
0x71, 0xdf, 0xe3, 0x0f, 0x02, 0x3e, 0xbc, 0xfc, 0x23, 0x89, 0x5d, 0x5f, 0x7a, 0x36, 0x5b, 0xd2,
|
0xbd, 0xa3, 0xd1, 0x66, 0x47, 0xa3, 0xaf, 0x2d, 0x45, 0xab, 0x96, 0xa2, 0x75, 0x4b, 0xd1, 0xa6,
|
||||||
0xe8, 0x76, 0x49, 0xa3, 0xf9, 0x92, 0x46, 0xdf, 0x3a, 0x8a, 0x66, 0x1d, 0x45, 0xb7, 0x1d, 0x45,
|
0xa5, 0xe8, 0x7b, 0x4b, 0xd1, 0xb7, 0x1f, 0x34, 0xfa, 0xd0, 0x0b, 0x45, 0x7f, 0x05, 0x00, 0x00,
|
||||||
0xf3, 0x8e, 0xa2, 0x1f, 0x1d, 0x45, 0xdf, 0x7f, 0xd2, 0xe8, 0xc3, 0x20, 0x1c, 0xfa, 0x3b, 0x00,
|
0xff, 0xff, 0xe3, 0x33, 0x18, 0x0b, 0x50, 0x02, 0x00, 0x00,
|
||||||
0x00, 0xff, 0xff, 0x3f, 0x1e, 0x24, 0x09, 0x85, 0x02, 0x00, 0x00,
|
|
||||||
}
|
}
|
||||||
|
2
vendor/k8s.io/apimachinery/pkg/runtime/generated.proto
generated
vendored
2
vendor/k8s.io/apimachinery/pkg/runtime/generated.proto
generated
vendored
@ -21,8 +21,6 @@ syntax = 'proto2';
|
|||||||
|
|
||||||
package k8s.io.apimachinery.pkg.runtime;
|
package k8s.io.apimachinery.pkg.runtime;
|
||||||
|
|
||||||
import "k8s.io/apimachinery/pkg/util/intstr/generated.proto";
|
|
||||||
|
|
||||||
// Package-wide variables from generator "generated".
|
// Package-wide variables from generator "generated".
|
||||||
option go_package = "runtime";
|
option go_package = "runtime";
|
||||||
|
|
||||||
|
2
vendor/k8s.io/apimachinery/pkg/runtime/helper.go
generated
vendored
2
vendor/k8s.io/apimachinery/pkg/runtime/helper.go
generated
vendored
@ -87,7 +87,7 @@ func Field(v reflect.Value, fieldName string, dest interface{}) error {
|
|||||||
return fmt.Errorf("couldn't assign/convert %v to %v", field.Type(), destValue.Type())
|
return fmt.Errorf("couldn't assign/convert %v to %v", field.Type(), destValue.Type())
|
||||||
}
|
}
|
||||||
|
|
||||||
// fieldPtr puts the address of fieldName, which must be a member of v,
|
// FieldPtr puts the address of fieldName, which must be a member of v,
|
||||||
// into dest, which must be an address of a variable to which this field's
|
// into dest, which must be an address of a variable to which this field's
|
||||||
// address can be assigned.
|
// address can be assigned.
|
||||||
func FieldPtr(v reflect.Value, fieldName string, dest interface{}) error {
|
func FieldPtr(v reflect.Value, fieldName string, dest interface{}) error {
|
||||||
|
8
vendor/k8s.io/apimachinery/pkg/runtime/interfaces.go
generated
vendored
8
vendor/k8s.io/apimachinery/pkg/runtime/interfaces.go
generated
vendored
@ -39,14 +39,14 @@ type GroupVersioner interface {
|
|||||||
KindForGroupVersionKinds(kinds []schema.GroupVersionKind) (target schema.GroupVersionKind, ok bool)
|
KindForGroupVersionKinds(kinds []schema.GroupVersionKind) (target schema.GroupVersionKind, ok bool)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Encoders write objects to a serialized form
|
// Encoder writes objects to a serialized form
|
||||||
type Encoder interface {
|
type Encoder interface {
|
||||||
// Encode writes an object to a stream. Implementations may return errors if the versions are
|
// Encode writes an object to a stream. Implementations may return errors if the versions are
|
||||||
// incompatible, or if no conversion is defined.
|
// incompatible, or if no conversion is defined.
|
||||||
Encode(obj Object, w io.Writer) error
|
Encode(obj Object, w io.Writer) error
|
||||||
}
|
}
|
||||||
|
|
||||||
// Decoders attempt to load an object from data.
|
// Decoder attempts to load an object from data.
|
||||||
type Decoder interface {
|
type Decoder interface {
|
||||||
// Decode attempts to deserialize the provided data using either the innate typing of the scheme or the
|
// Decode attempts to deserialize the provided data using either the innate typing of the scheme or the
|
||||||
// default kind, group, and version provided. It returns a decoded object as well as the kind, group, and
|
// default kind, group, and version provided. It returns a decoded object as well as the kind, group, and
|
||||||
@ -185,7 +185,7 @@ type ObjectConvertor interface {
|
|||||||
// This method is similar to Convert() but handles specific details of choosing the correct
|
// This method is similar to Convert() but handles specific details of choosing the correct
|
||||||
// output version.
|
// output version.
|
||||||
ConvertToVersion(in Object, gv GroupVersioner) (out Object, err error)
|
ConvertToVersion(in Object, gv GroupVersioner) (out Object, err error)
|
||||||
ConvertFieldLabel(version, kind, label, value string) (string, string, error)
|
ConvertFieldLabel(gvk schema.GroupVersionKind, label, value string) (string, string, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ObjectTyper contains methods for extracting the APIVersion and Kind
|
// ObjectTyper contains methods for extracting the APIVersion and Kind
|
||||||
@ -224,7 +224,7 @@ type SelfLinker interface {
|
|||||||
Namespace(obj Object) (string, error)
|
Namespace(obj Object) (string, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// All API types registered with Scheme must support the Object interface. Since objects in a scheme are
|
// Object interface must be supported by all API types registered with Scheme. Since objects in a scheme are
|
||||||
// expected to be serialized to the wire, the interface an Object must provide to the Scheme allows
|
// expected to be serialized to the wire, the interface an Object must provide to the Scheme allows
|
||||||
// serializers to set the kind, version, and group the object is represented as. An Object may choose
|
// serializers to set the kind, version, and group the object is represented as. An Object may choose
|
||||||
// to return a no-op ObjectKindAccessor in cases where it is not expected to be serialized.
|
// to return a no-op ObjectKindAccessor in cases where it is not expected to be serialized.
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user