github.com/docker/compose-on-kubernetes@v0.5.0/api/compose/v1alpha3/scale.go (about) 1 package v1alpha3 2 3 import ( 4 "github.com/docker/compose-on-kubernetes/api/compose/clone" 5 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 6 "k8s.io/apimachinery/pkg/runtime" 7 ) 8 9 // Scale contains the current/desired replica count for services in a stack. 10 type Scale struct { 11 metav1.TypeMeta `json:",inline"` 12 metav1.ObjectMeta `json:"metadata,omitempty"` 13 Spec map[string]int `json:"spec,omitempty"` 14 Status map[string]int `json:"status,omitempty"` 15 } 16 17 func (s *Scale) clone() *Scale { 18 return &Scale{ 19 TypeMeta: s.TypeMeta, 20 ObjectMeta: s.ObjectMeta, 21 Spec: clone.MapOfStringToInt(s.Spec), 22 Status: clone.MapOfStringToInt(s.Status), 23 } 24 } 25 26 // DeepCopyObject clones the scale 27 func (s *Scale) DeepCopyObject() runtime.Object { 28 return s.clone() 29 }