Skip to content

Commit

Permalink
Merge pull request #17 from alcounit/develop
Browse files Browse the repository at this point in the history
Implement pod tolerations #16
  • Loading branch information
alcounit authored Feb 23, 2021
2 parents 756cf24 + 2d7fc7b commit e4e5d7b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
5 changes: 1 addition & 4 deletions platform/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"path"
"time"

"github.com/alcounit/selenosis/tools"
apiv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
Expand Down Expand Up @@ -240,6 +239,7 @@ func (cl *Client) Create(layout *ServiceSpec) (*Service, error) {
RestartPolicy: apiv1.RestartPolicyNever,
Affinity: &layout.Template.Spec.Affinity,
DNSConfig: &layout.Template.Spec.DNSConfig,
Tolerations: layout.Template.Spec.Tolerations,
ImagePullSecrets: getImagePullSecretList(cl.imagePullSecretName),
},
}
Expand Down Expand Up @@ -323,7 +323,6 @@ func (cl *Client) Create(layout *ServiceSpec) (*Service, error) {
cancel()
},
Started: pod.CreationTimestamp.Time,
Uptime: tools.TimeElapsed(pod.CreationTimestamp.Time),
}

return svc, nil
Expand Down Expand Up @@ -377,7 +376,6 @@ func (cl *Client) List() ([]*Service, error) {
},
Status: status,
Started: pod.CreationTimestamp.Time,
Uptime: tools.TimeElapsed(pod.CreationTimestamp.Time),
}
services = append(services, service)
}
Expand Down Expand Up @@ -417,7 +415,6 @@ func (cl Client) Watch() <-chan Event {
},
Status: status,
Started: pod.CreationTimestamp.Time,
Uptime: tools.TimeElapsed(pod.CreationTimestamp.Time),
}
}

Expand Down
1 change: 1 addition & 0 deletions platform/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type Spec struct {
NodeSelector map[string]string `yaml:"nodeSelector,omitempty" json:"nodeSelector,omitempty"`
Affinity apiv1.Affinity `yaml:"affinity,omitempty" json:"affinity,omitempty"`
DNSConfig apiv1.PodDNSConfig `yaml:"dnsConfig,omitempty" json:"dnsConfig,omitempty"`
Tolerations []apiv1.Toleration `yaml:"tolerations,omitempty" json:"tolerations,omitempty"`
}

//BrowserSpec describes settings for Service
Expand Down
2 changes: 2 additions & 0 deletions storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"sync"

"github.com/alcounit/selenosis/platform"
"github.com/alcounit/selenosis/tools"
)

//Storage ...
Expand Down Expand Up @@ -41,6 +42,7 @@ func (s *Storage) List() []platform.Service {

for _, p := range s.sessions {
c := *p
c.Uptime = tools.TimeElapsed(c.Started)
l = append(l, c)
}
return l
Expand Down

0 comments on commit e4e5d7b

Please sign in to comment.