hotfix

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2020 License: BSD-3-Clause Imports: 27 Imported by: 0

README

DISCLAIMER: This package is pre v1.x and not stable

hotfix

dumb file sync/transfer to your labelled pods

installation

releases are tagged in git and uploaded to https://steady.supply/git/hotfix/release/

usage

command line options are -v, etc for glog, and -c to specify a configuration file, eg.

namespace: xyz
ignore:
  - "*.tmp"
  - "*.{html,css,js}"
include:
  - "*.py"
shell: ash
path: src:/app
target:
  - label: service in (web, api)
  - label: service=postgres
    path: src/database:/app/database
  - label: service=chrome
    shell: bash
  - label: service=static
    include:
      - "*.{html,css,js}"

which specifes defaults for the namespace to work in, the transfer paths (in standard local:remote format), the globs to be ignored / included and the shell offered by the default container in matched pods. this configuration will be used for each target, having label filter and being able to specify any of namespace, shell and path. see below for discussion on how ignore and include rules are evalulated.

for each target the local path is watched, and when a file changes, that file is streamed to all the pods matching the label specification.

why is it dumb?

the dumb part is how we stream files; the method is essentially cat local_file | cat > remote_file. this is perfectly sufficient since, when writing code (unless you’re an octopus), you probably only write to handful of files at a given time and you probably don’t write to files more frequently than every few seconds (unless you’re a hummingbird).

ignore and include

when hotfix receives a file change event, both the “outer” and “inner” ignore and include rules for a particular target are evaluated against the path that is the subject of the event.

  • include takes precedence over ignore
  • “inner” rules take precedence over “outer” rules

alternatives to hotfix

there are already too many tools on the market that attempt to scratch the same itch; “i miss docker run -v $(pwd):/app.

but ... why?

yes, quite. perhaps a more pertinent question would be “why not any of the others?”. let’s enumerate

  • ksync seems rather complicated for a noddy development tool, and doesn’t quite work
  • kubectl-warp is also complicated and requires rsync on the remote
  • devspace sync is pretty nice (they somewhat built their own rsync-a-like lib), but it’s part of an ecosystem i don’t want and has odd behaviours
  • oc rsync doesn’t watch files for me

none of the above let you spam files out based on labels (eg. you want to send a file out to all the pods in a deployment) and all of the above require either special software on your containers or additional pods in your cluster.

hotfix is a simple solution to a simple problem.

contributions

drop a line to git@steady.supply

:)

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL