-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kubehound with no Docker lib dependency (#315)
* adding go tag for docker dependencies * adding tag to makefile
- Loading branch information
Showing
10 changed files
with
99 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//go:build !no_backend | ||
|
||
package main | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/DataDog/KubeHound/pkg/telemetry/log" | ||
) | ||
|
||
func runBackend(ctx context.Context) error { | ||
l := log.Logger(ctx) | ||
l.Warn("Backend is not supported in this build") | ||
|
||
return nil | ||
} | ||
|
||
func runBackendCompose(ctx context.Context) error { | ||
l := log.Logger(ctx) | ||
l.Warn("Backend is not supported in this build") | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
//go:build no_backend | ||
|
||
package main | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/DataDog/KubeHound/pkg/backend" | ||
"github.com/DataDog/KubeHound/pkg/telemetry/log" | ||
) | ||
|
||
func runBackend(ctx context.Context) error { | ||
l := log.Logger(ctx) | ||
|
||
// Forcing the embed docker config to be loaded | ||
err := backend.NewBackend(ctx, []string{""}, backend.DefaultUIProfile) | ||
if err != nil { | ||
return err | ||
} | ||
res, err := backend.IsStackRunning(ctx) | ||
if err != nil { | ||
return err | ||
} | ||
if !res { | ||
err = backend.Up(ctx) | ||
if err != nil { | ||
return err | ||
} | ||
} else { | ||
l.Info("Backend stack is already running") | ||
} | ||
|
||
return nil | ||
} | ||
|
||
func runBackendCompose(ctx context.Context) error { | ||
err := backend.NewBackend(ctx, composePath, backend.DefaultUIProfile) | ||
if err != nil { | ||
return fmt.Errorf("new backend: %w", err) | ||
} | ||
err = backend.Up(ctx) | ||
if err != nil { | ||
return fmt.Errorf("docker up: %w", err) | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//go:build no_backend | ||
|
||
package backend | ||
|
||
import ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//go:build no_backend | ||
|
||
package backend | ||
|
||
import ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters