mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
vendor update for CSI 0.3.0
This commit is contained in:
44
vendor/k8s.io/kubernetes/pkg/kubectl/deployment.go
generated
vendored
44
vendor/k8s.io/kubernetes/pkg/kubectl/deployment.go
generated
vendored
@ -20,6 +20,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
appsv1 "k8s.io/api/apps/v1"
|
||||
appsv1beta1 "k8s.io/api/apps/v1beta1"
|
||||
"k8s.io/api/core/v1"
|
||||
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
|
||||
@ -28,7 +29,7 @@ import (
|
||||
)
|
||||
|
||||
// BaseDeploymentGenerator: implement the common functionality of
|
||||
// DeploymentBasicGeneratorV1 and DeploymentBasicAppsGeneratorV1. To reduce
|
||||
// DeploymentBasicGeneratorV1, DeploymentBasicAppsGeneratorV1Beta1 and DeploymentBasicAppsGeneratorV1. To reduce
|
||||
// confusion, it's best to keep this struct in the same file as those
|
||||
// generators.
|
||||
type BaseDeploymentGenerator struct {
|
||||
@ -78,7 +79,8 @@ func buildPodSpec(images []string) v1.PodSpec {
|
||||
// Remove any tag or hash
|
||||
if strings.Contains(name, ":") {
|
||||
name = strings.Split(name, ":")[0]
|
||||
} else if strings.Contains(name, "@") {
|
||||
}
|
||||
if strings.Contains(name, "@") {
|
||||
name = strings.Split(name, "@")[0]
|
||||
}
|
||||
podSpec.Containers = append(podSpec.Containers, v1.Container{Name: name, Image: imageString})
|
||||
@ -116,16 +118,16 @@ func (s *DeploymentBasicGeneratorV1) StructuredGenerate() (runtime.Object, error
|
||||
}, err
|
||||
}
|
||||
|
||||
// DeploymentBasicAppsGeneratorV1 supports stable generation of a deployment under apps/v1beta1 endpoint
|
||||
type DeploymentBasicAppsGeneratorV1 struct {
|
||||
// DeploymentBasicAppsGeneratorV1Beta1 supports stable generation of a deployment under apps/v1beta1 endpoint
|
||||
type DeploymentBasicAppsGeneratorV1Beta1 struct {
|
||||
BaseDeploymentGenerator
|
||||
}
|
||||
|
||||
// Ensure it supports the generator pattern that uses parameters specified during construction
|
||||
var _ StructuredGenerator = &DeploymentBasicAppsGeneratorV1{}
|
||||
var _ StructuredGenerator = &DeploymentBasicAppsGeneratorV1Beta1{}
|
||||
|
||||
// StructuredGenerate outputs a deployment object using the configured fields
|
||||
func (s *DeploymentBasicAppsGeneratorV1) StructuredGenerate() (runtime.Object, error) {
|
||||
func (s *DeploymentBasicAppsGeneratorV1Beta1) StructuredGenerate() (runtime.Object, error) {
|
||||
podSpec, labels, selector, err := s.structuredGenerate()
|
||||
one := int32(1)
|
||||
return &appsv1beta1.Deployment{
|
||||
@ -145,3 +147,33 @@ func (s *DeploymentBasicAppsGeneratorV1) StructuredGenerate() (runtime.Object, e
|
||||
},
|
||||
}, err
|
||||
}
|
||||
|
||||
// DeploymentBasicAppsGeneratorV1 supports stable generation of a deployment under apps/v1 endpoint
|
||||
type DeploymentBasicAppsGeneratorV1 struct {
|
||||
BaseDeploymentGenerator
|
||||
}
|
||||
|
||||
// Ensure it supports the generator pattern that uses parameters specified during construction
|
||||
var _ StructuredGenerator = &DeploymentBasicAppsGeneratorV1{}
|
||||
|
||||
// StructuredGenerate outputs a deployment object using the configured fields
|
||||
func (s *DeploymentBasicAppsGeneratorV1) StructuredGenerate() (runtime.Object, error) {
|
||||
podSpec, labels, selector, err := s.structuredGenerate()
|
||||
one := int32(1)
|
||||
return &appsv1.Deployment{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: s.Name,
|
||||
Labels: labels,
|
||||
},
|
||||
Spec: appsv1.DeploymentSpec{
|
||||
Replicas: &one,
|
||||
Selector: &selector,
|
||||
Template: v1.PodTemplateSpec{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Labels: labels,
|
||||
},
|
||||
Spec: podSpec,
|
||||
},
|
||||
},
|
||||
}, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user