Fixes for runtime builder (#2029)

* util/tar: add archive util funcs

* runtime: add store, builder options

* runtime/local: update RuntimeSource func

* runtime/builder/golang: use tar util

* store/s3: make keys safe

* runtime: add entrypoint options

* runtime/builder: remove debugging

* wip: integrate builder into k8s runtime

* runtime/builder/golang: build for a linux architecture

* runtime/kubernetes: write builds to the users namespace

* runtime/local/source: fixes for mono-repo builds

* runtime/local: stop checking out source (the responsibility is on the client)

* runtime/builder: fix golang tests

* runtime/local: fix out of bounds panic

* Update

* revert changes

* runtime/local/source: refactor git package (wip)

* runtime/kubernetes: map err not found

* fix TestRunGenericRemote test

* runtime/local: fix update not reassining source

* Tidy go mod

* runtime.Pending => runtime.Starting

* store/s3: only use credentials option when set

* store/s3: add tls config option
This commit is contained in:
ben-toogood
2020-10-02 09:54:26 +01:00
committed by GitHub
parent 231cfc48f0
commit 0a6e451539
6 changed files with 111 additions and 106 deletions

View File

@@ -11,16 +11,16 @@ type Option func(o *Options)
// Options configure runtime
type Options struct {
// Scheduler for updates
Scheduler Scheduler
// Service type to manage
Type string
// Source of the services repository
Source string
// Base image to use
Image string
// Client to use when making requests
Client client.Client
// Base image to use
Image string
// Scheduler for updates
Scheduler Scheduler
// Source of the services repository
Source string
// Service type to manage
Type string
}
// WithSource sets the base image / repository
@@ -70,6 +70,8 @@ type CreateOptions struct {
Args []string
// Environment to configure
Env []string
// Entrypoint within the folder (e.g. in the case of a mono-repo)
Entrypoint string
// Log output
Output io.Writer
// Type of service to create
@@ -132,6 +134,13 @@ func CreateContext(ctx context.Context) CreateOption {
}
}
// CreateEntrypoint sets the entrypoint
func CreateEntrypoint(e string) CreateOption {
return func(o *CreateOptions) {
o.Entrypoint = e
}
}
// WithSecret sets a secret to provide the service with
func WithSecret(key, value string) CreateOption {
return func(o *CreateOptions) {
@@ -236,6 +245,8 @@ func ReadContext(ctx context.Context) ReadOption {
type UpdateOption func(o *UpdateOptions)
type UpdateOptions struct {
// Entrypoint within the folder (e.g. in the case of a mono-repo)
Entrypoint string
// Namespace the service is running in
Namespace string
// Specify the context to use
@@ -269,6 +280,13 @@ func UpdateContext(ctx context.Context) UpdateOption {
}
}
// UpdateEntrypoint sets the entrypoint
func UpdateEntrypoint(e string) UpdateOption {
return func(o *UpdateOptions) {
o.Entrypoint = e
}
}
type DeleteOption func(o *DeleteOptions)
type DeleteOptions struct {