-
Notifications
You must be signed in to change notification settings - Fork 70
Conversation
@@ -52,107 +37,48 @@ func (s *Ship) stateFileExists(ctx context.Context) bool { | |||
return !noExistingState | |||
} | |||
|
|||
func (s *Ship) Update(ctx context.Context) error { | |||
debug := level.Debug(log.With(s.Logger, "method", "update")) | |||
func (s *Ship) Init(ctx context.Context) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the diff on this file looks weird because I moved update/watch out of here. I recommend side-by-side
} | ||
} | ||
|
||
func (s *Ship) Update(ctx context.Context) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no changes here, just moved
return errors.New(`No current SHA found at ` + s.Viper.GetString("state-file") + `, please run "ship init"`) | ||
} | ||
|
||
debug.Log("event", "fetch latest chart") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new stuff starts here
defaultSpec *api.Spec, | ||
) (*api.Release, error) { | ||
debug := log.With(level.Debug(r.Logger), "method", "resolveChart") | ||
|
||
metadata, err := r.resolveMetadata(context.Background(), upstream, localPath) | ||
err := util.BackupIfPresent(r.FS, destPath, debug, r.ui) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this backup/rename logic got moved up out of determineApplicationType
@@ -60,6 +60,7 @@ var _ = Describe("ship app", func() { | |||
var testMetadata TestMetadata | |||
|
|||
BeforeEach(func() { | |||
os.Setenv("NO_OS_EXIT", "1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we store this and restore it after the integration tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why we'd need to do that? I don't think it persists into the parent process?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. Might be a good thing to check when running with ginkgo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(or I'm being silly, sorry)
What I Did ------------ Improve and fix some things with `ship watch`, Resolve #428 ``` $ bin/ship watch --interval 30s github.com/dexhorthy/sysdigcloud-kubernetes/sysdigcloud has an update available ``` How I Did it ------------ - apptype.Inspector no longer moves the cloned assets up from .ship/tmp into "base" or "k8s" - resolver.ResolveRelease handles moving chart up from .ship/tmp into "base" or "chart" - remove defer os.RemoveAll in apptype.Inspector, is in `.ship/tmp` now, so it will get cleaned up eventually - more/better debug logging in `ship watch` - bind viper flags in `cli/watch.go` so `viper.GetDuration("interval")` works in watch command - added some UI output for ship watch Other stuff: - move watch and update into their own files - clean .ship/tmp on startup in case its hanging around How to verify it ------------ `ship init ...; ship watch --interval 30s` Description for the Changelog ------------ Add configurable interval for `ship watch` via `--interval` flag ![](https://upload.wikimedia.org/wikipedia/commons/thumb/c/cf/Shipwreck_%289558712326%29.jpg/120px-Shipwreck_%289558712326%29.jpg)
// if there's a Chart.yaml, assume its a chart | ||
isChart, err := r.fs.Exists(path.Join(savePath, "Chart.yaml")) | ||
if err != nil { | ||
return "", "", errors.Wrap(err, "check for Chart.yaml") | ||
} | ||
debug.Log("event", "isChart.check", "isChart", isChart) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be before the check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think its for writing the result of the check, hence the isChart
field
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, that makes sense
What I Did
Improve and fix some things with
ship watch
, Resolve #428How I Did it
.ship/tmp
now, so it will get cleaned up eventuallyship watch
cli/watch.go
soviper.GetDuration("interval")
works in watch commandOther stuff:
How to verify it
ship init ...; ship watch --interval 30s
Description for the Changelog
Add configurable interval for
ship watch
via--interval
flagWhat I Did
How I Did it
How to verify it
Description for the Changelog
Picture of a Boat (not required but encouraged)