@@ -29,12 +29,12 @@ import (
2929 "github.com/arangodb/kube-arangodb/pkg/apis/shared"
3030
3131 "github.com/pkg/errors"
32- v1 "k8s.io/api/core/v1"
32+ core "k8s.io/api/core/v1"
3333 "k8s.io/apimachinery/pkg/api/resource"
3434
3535 "github.com/arangodb/kube-arangodb/pkg/util"
36- arangod_options "github.com/arangodb/kube-arangodb/pkg/util/arangod/options"
37- arangosync_options "github.com/arangodb/kube-arangodb/pkg/util/arangosync/options"
36+ arangodOptions "github.com/arangodb/kube-arangodb/pkg/util/arangod/options"
37+ arangosyncOptions "github.com/arangodb/kube-arangodb/pkg/util/arangosync/options"
3838 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil"
3939)
4040
@@ -51,11 +51,11 @@ type ServerGroupSpec struct {
5151 // StorageClassName specifies the classname for storage of the servers.
5252 StorageClassName * string `json:"storageClassName,omitempty"`
5353 // Resources holds resource requests & limits
54- Resources v1 .ResourceRequirements `json:"resources,omitempty"`
54+ Resources core .ResourceRequirements `json:"resources,omitempty"`
5555 // OverrideDetectedTotalMemory determines if memory should be overrided based on values in resources.
5656 OverrideDetectedTotalMemory * bool `json:"overrideDetectedTotalMemory,omitempty"`
5757 // Tolerations specifies the tolerations added to Pods in this group.
58- Tolerations []v1 .Toleration `json:"tolerations,omitempty"`
58+ Tolerations []core .Toleration `json:"tolerations,omitempty"`
5959 // Annotations specified the annotations added to Pods in this group.
6060 Annotations map [string ]string `json:"annotations,omitempty"`
6161 // ServiceAccountName specifies the name of the service account used for Pods in this group.
@@ -67,17 +67,17 @@ type ServerGroupSpec struct {
6767 // PriorityClassName specifies a priority class name
6868 PriorityClassName string `json:"priorityClassName,omitempty"`
6969 // VolumeClaimTemplate specifies a template for volume claims
70- VolumeClaimTemplate * v1 .PersistentVolumeClaim `json:"volumeClaimTemplate,omitempty"`
70+ VolumeClaimTemplate * core .PersistentVolumeClaim `json:"volumeClaimTemplate,omitempty"`
7171 // VolumeResizeMode specified resize mode for pvc
7272 VolumeResizeMode * PVCResizeMode `json:"pvcResizeMode,omitempty"`
7373 // AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions
74- AntiAffinity * v1 .PodAntiAffinity `json:"antiAffinity,omitempty"`
74+ AntiAffinity * core .PodAntiAffinity `json:"antiAffinity,omitempty"`
7575 // Affinity specified additional affinity settings in ArangoDB Pod definitions
76- Affinity * v1 .PodAffinity `json:"affinity,omitempty"`
76+ Affinity * core .PodAffinity `json:"affinity,omitempty"`
7777 // NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions
78- NodeAffinity * v1 .NodeAffinity `json:"nodeAffinity,omitempty"`
78+ NodeAffinity * core .NodeAffinity `json:"nodeAffinity,omitempty"`
7979 // Sidecars specifies a list of additional containers to be started
80- Sidecars []v1 .Container `json:"sidecars,omitempty"`
80+ Sidecars []core .Container `json:"sidecars,omitempty"`
8181 // SecurityContext specifies security context for group
8282 SecurityContext * ServerGroupSpecSecurityContext `json:"securityContext,omitempty"`
8383 // Volumes define list of volumes mounted to pod
@@ -95,7 +95,7 @@ type ServerGroupSpecSecurityContext struct {
9595 // Deprecated: This field is added for backward compatibility. Will be removed in 1.1.0.
9696 DropAllCapabilities * bool `json:"dropAllCapabilities,omitempty"`
9797 // AddCapabilities add new capabilities to containers
98- AddCapabilities []v1 .Capability `json:"addCapabilities,omitempty"`
98+ AddCapabilities []core .Capability `json:"addCapabilities,omitempty"`
9999}
100100
101101// GetDropAllCapabilities returns flag if capabilities should be dropped
@@ -114,7 +114,7 @@ func (s *ServerGroupSpecSecurityContext) GetDropAllCapabilities() bool {
114114}
115115
116116// GetAddCapabilities add capabilities to pod context
117- func (s * ServerGroupSpecSecurityContext ) GetAddCapabilities () []v1 .Capability {
117+ func (s * ServerGroupSpecSecurityContext ) GetAddCapabilities () []core .Capability {
118118 if s == nil {
119119 return nil
120120 }
@@ -127,19 +127,19 @@ func (s *ServerGroupSpecSecurityContext) GetAddCapabilities() []v1.Capability {
127127}
128128
129129// NewSecurityContext creates new security context
130- func (s * ServerGroupSpecSecurityContext ) NewSecurityContext () * v1 .SecurityContext {
131- r := & v1 .SecurityContext {}
130+ func (s * ServerGroupSpecSecurityContext ) NewSecurityContext () * core .SecurityContext {
131+ r := & core .SecurityContext {}
132132
133- capabilities := & v1 .Capabilities {}
133+ capabilities := & core .Capabilities {}
134134
135135 if s .GetDropAllCapabilities () {
136- capabilities .Drop = []v1 .Capability {
136+ capabilities .Drop = []core .Capability {
137137 "ALL" ,
138138 }
139139 }
140140
141141 if caps := s .GetAddCapabilities (); caps != nil {
142- capabilities .Add = []v1 .Capability {}
142+ capabilities .Add = []core .Capability {}
143143
144144 capabilities .Add = append (capabilities .Add , caps ... )
145145 }
@@ -246,7 +246,7 @@ func (s *ServerGroupProbeSpec) GetFailureThreshold(d int32) int32 {
246246}
247247
248248// GetSidecars returns a list of sidecars the use wish to add
249- func (s ServerGroupSpec ) GetSidecars () []v1 .Container {
249+ func (s ServerGroupSpec ) GetSidecars () []core .Container {
250250 return s .Sidecars
251251}
252252
@@ -256,7 +256,7 @@ func (s ServerGroupSpec) HasVolumeClaimTemplate() bool {
256256}
257257
258258// GetVolumeClaimTemplate returns a pointer to a volume claim template or nil if none is specified
259- func (s ServerGroupSpec ) GetVolumeClaimTemplate () * v1 .PersistentVolumeClaim {
259+ func (s ServerGroupSpec ) GetVolumeClaimTemplate () * core .PersistentVolumeClaim {
260260 return s .VolumeClaimTemplate
261261}
262262
@@ -299,7 +299,7 @@ func (s ServerGroupSpec) GetStorageClassName() string {
299299}
300300
301301// GetTolerations returns the value of tolerations.
302- func (s ServerGroupSpec ) GetTolerations () []v1 .Toleration {
302+ func (s ServerGroupSpec ) GetTolerations () []core .Toleration {
303303 return s .Tolerations
304304}
305305
@@ -377,11 +377,11 @@ func (s ServerGroupSpec) Validate(group ServerGroup, used bool, mode DeploymentM
377377 parts := strings .Split (arg , "=" )
378378 optionKey := strings .TrimSpace (parts [0 ])
379379 if group .IsArangod () {
380- if arangod_options .IsCriticalOption (optionKey ) {
380+ if arangodOptions .IsCriticalOption (optionKey ) {
381381 return maskAny (errors .Wrapf (ValidationError , "Critical option '%s' cannot be overriden" , optionKey ))
382382 }
383383 } else if group .IsArangosync () {
384- if arangosync_options .IsCriticalOption (optionKey ) {
384+ if arangosyncOptions .IsCriticalOption (optionKey ) {
385385 return maskAny (errors .Wrapf (ValidationError , "Critical option '%s' cannot be overriden" , optionKey ))
386386 }
387387 }
@@ -443,19 +443,19 @@ func (s *ServerGroupSpec) SetDefaults(group ServerGroup, used bool, mode Deploym
443443 s .MaxCount = nil
444444 }
445445 if ! s .HasVolumeClaimTemplate () {
446- if _ , found := s .Resources .Requests [v1 .ResourceStorage ]; ! found {
446+ if _ , found := s .Resources .Requests [core .ResourceStorage ]; ! found {
447447 switch group {
448448 case ServerGroupSingle , ServerGroupAgents , ServerGroupDBServers :
449- volumeMode := v1 .PersistentVolumeFilesystem
450- s .VolumeClaimTemplate = & v1 .PersistentVolumeClaim {
451- Spec : v1 .PersistentVolumeClaimSpec {
452- AccessModes : []v1 .PersistentVolumeAccessMode {
453- v1 .ReadWriteOnce ,
449+ volumeMode := core .PersistentVolumeFilesystem
450+ s .VolumeClaimTemplate = & core .PersistentVolumeClaim {
451+ Spec : core .PersistentVolumeClaimSpec {
452+ AccessModes : []core .PersistentVolumeAccessMode {
453+ core .ReadWriteOnce ,
454454 },
455455 VolumeMode : & volumeMode ,
456- Resources : v1 .ResourceRequirements {
457- Requests : v1 .ResourceList {
458- v1 .ResourceStorage : resource .MustParse ("8Gi" ),
456+ Resources : core .ResourceRequirements {
457+ Requests : core .ResourceList {
458+ core .ResourceStorage : resource .MustParse ("8Gi" ),
459459 },
460460 },
461461 },
@@ -466,10 +466,10 @@ func (s *ServerGroupSpec) SetDefaults(group ServerGroup, used bool, mode Deploym
466466}
467467
468468// setDefaultsFromResourceList fills unspecified fields with a value from given source spec.
469- func setDefaultsFromResourceList (s * v1 .ResourceList , source v1 .ResourceList ) {
469+ func setDefaultsFromResourceList (s * core .ResourceList , source core .ResourceList ) {
470470 for k , v := range source {
471471 if * s == nil {
472- * s = make (v1 .ResourceList )
472+ * s = make (core .ResourceList )
473473 }
474474 if _ , found := (* s )[k ]; ! found {
475475 (* s )[k ] = v
0 commit comments