Skip to content

Commit

Permalink
Wrap polyglot hooks in an experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
moskyb committed May 4, 2023
1 parent a38c09a commit 81976a2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ func (b *Bootstrap) executeHook(ctx context.Context, hookCfg HookConfig) error {

b.shell.Headerf("Running %s hook", hookName)

if !experiments.IsEnabled(experiments.PolyglotHooks) {
return b.runWrappedShellScriptHook(ctx, hookName, hookCfg)
}

hookType, err := hook.Type(hookCfg.Path)
if err != nil {
return fmt.Errorf("determining hook type for %q hook: %w", hookName, err)
Expand Down
2 changes: 2 additions & 0 deletions experiments/experiments.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package experiments

const (
PolyglotHooks = "polyglot-hooks"
JobAPI = "job-api"
KubernetesExec = "kubernetes-exec"
ANSITimestamps = "ansi-timestamps"
Expand All @@ -18,6 +19,7 @@ const (

var (
Available = map[string]struct{}{
PolyglotHooks: {},
JobAPI: {},
KubernetesExec: {},
ANSITimestamps: {},
Expand Down

0 comments on commit 81976a2

Please sign in to comment.