Skip to content

Commit

Permalink
feat: single sidecar container to surface artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
ericzzzzzzz committed Apr 24, 2024
1 parent 2171841 commit 096b34d
Show file tree
Hide file tree
Showing 21 changed files with 364 additions and 699 deletions.
1 change: 0 additions & 1 deletion cmd/controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ func main() {
flag.StringVar(&opts.Images.ShellImage, "shell-image", "", "The container image containing a shell")
flag.StringVar(&opts.Images.ShellImageWin, "shell-image-win", "", "The container image containing a windows shell")
flag.StringVar(&opts.Images.WorkingDirInitImage, "workingdirinit-image", "", "The container image containing our working dir init binary.")
flag.StringVar(&opts.Images.SidecarLogArtifactsImage, "sidecarlogartifacts-image", "", "The container image containing the binary for accessing artifacts.")
// This parses flags.
cfg := injection.ParseAndGetRESTConfigOrDie()

Expand Down
44 changes: 0 additions & 44 deletions cmd/sidecarlogartifacts/main.go

This file was deleted.

13 changes: 10 additions & 3 deletions cmd/sidecarlogresults/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ func main() {
var resultsDir string
var resultNames string
var stepResultsStr string
var stepNames string

flag.StringVar(&resultsDir, "results-dir", pipeline.DefaultResultPath, "Path to the results directory. Default is /tekton/results")
flag.StringVar(&resultNames, "result-names", "", "comma separated result names to expect from the steps running in the pod. eg. foo,bar,baz")
flag.StringVar(&stepResultsStr, "step-results", "", "json containing a map of step Name as key and list of result Names. eg. {\"stepName\":[\"foo\",\"bar\",\"baz\"]}")
flag.StringVar(&stepNames, "step-names", "", "comma separated step names. eg. foo,bar,baz")
flag.Parse()
if resultNames == "" {
log.Fatal("result-names were not provided")
}

expectedResults := strings.Split(resultNames, ",")
expectedStepResults := map[string][]string{}
if err := json.Unmarshal([]byte(stepResultsStr), &expectedStepResults); err != nil {
Expand All @@ -48,4 +49,10 @@ func main() {
if err != nil {
log.Fatal(err)
}

names := strings.Split(stepNames, ",")
err = sidecarlogresults.LookForArtifacts(os.Stdout, names, pod.RunDir)
if err != nil {
log.Fatal(err)
}
}
1 change: 0 additions & 1 deletion config/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ spec:
"-entrypoint-image", "ko://github.com/tektoncd/pipeline/cmd/entrypoint",
"-nop-image", "ko://github.com/tektoncd/pipeline/cmd/nop",
"-sidecarlogresults-image", "ko://github.com/tektoncd/pipeline/cmd/sidecarlogresults",
"-sidecarlogartifacts-image", "ko://github.com/tektoncd/pipeline/cmd/sidecarlogartifacts",
"-workingdirinit-image", "ko://github.com/tektoncd/pipeline/cmd/workingdirinit",

# The shell image must allow root in order to create directories and copy files to PVCs.
Expand Down
141 changes: 0 additions & 141 deletions internal/sidecarlogartifacts/sidecarlogartifacts.go

This file was deleted.

Loading

0 comments on commit 096b34d

Please sign in to comment.