Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

transport cmd #64

Open
wants to merge 105 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
8d25c2e
implements first version of new transport command
jschicktanz Sep 8, 2021
3f75dc1
reduces unix domain socket filepath length
jschicktanz Sep 8, 2021
b829dc0
working on down/upload of localOciBlob resources
jschicktanz Sep 9, 2021
f9269d0
refactoring
jschicktanz Sep 10, 2021
cd1102b
refactored
jschicktanz Sep 14, 2021
2d6b4f1
refactoring
jschicktanz Sep 14, 2021
58a6494
init
jschicktanz Sep 14, 2021
2813a7d
refactoring
jschicktanz Sep 14, 2021
a5bdb52
review feedback
jschicktanz Sep 16, 2021
4475238
run formatter
jschicktanz Sep 16, 2021
9d7a1d3
renames extension pkg and adds tests
jschicktanz Sep 20, 2021
38fd5ff
adds license headers
jschicktanz Sep 20, 2021
8fe0835
refactoring + adds test
jschicktanz Sep 20, 2021
5fbf6ba
fix tests and adds check for test processor binary
jschicktanz Sep 21, 2021
94da006
formatting
jschicktanz Sep 21, 2021
2c8504e
improves before suite check
jschicktanz Sep 21, 2021
a878e86
refactoring + adds processor timeouts
jschicktanz Sep 21, 2021
acc06be
refactoring + updates doc
jschicktanz Sep 21, 2021
e41fd55
refactoring, adds pipeline tests, adds labelling processor
jschicktanz Sep 22, 2021
d343d8c
wip
jschicktanz Sep 22, 2021
2103309
Merge branch 'transport-cmd-0' into transport-cmd
jschicktanz Sep 22, 2021
93933fa
restores deleted files and fixes compile errors
jschicktanz Sep 22, 2021
a5a016e
wip
jschicktanz Sep 27, 2021
dd28da3
wip
jschicktanz Oct 5, 2021
8acaba7
add config parser and pipeline compiler
enrico-kaack-comp Oct 6, 2021
b8908cb
wip
jschicktanz Oct 8, 2021
fa93196
Merge branch 'main' into transport-cmd
jschicktanz Oct 8, 2021
b59ae47
wip
jschicktanz Oct 12, 2021
3f84f86
wip
jschicktanz Oct 12, 2021
45818cc
should fix oci image filter
jschicktanz Oct 13, 2021
e62058b
refactoring and godoc
jschicktanz Oct 13, 2021
8b18f1e
refactors and improves config parsing
jschicktanz Oct 14, 2021
3c2a1ef
implements object factories
jschicktanz Oct 15, 2021
555ca81
implements processor factory
jschicktanz Oct 15, 2021
f21513a
fix compile errors + refactoring
jschicktanz Oct 18, 2021
7845707
adds upload of patched component descriptors
jschicktanz Oct 18, 2021
5d1142b
implement additional filters
jschicktanz Oct 19, 2021
5c3a5c2
makes transport cmd run through
jschicktanz Oct 19, 2021
21ce176
fixes filtering of gzip compressed layers
jschicktanz Oct 20, 2021
48955f9
increase processor timeout
jschicktanz Oct 20, 2021
4ca458d
refactoring
jschicktanz Oct 20, 2021
e183dc3
refactoring
jschicktanz Oct 20, 2021
75f5ba5
refactors filter package and adds tests
jschicktanz Oct 21, 2021
f6611fb
renames accessTypeFilter
jschicktanz Oct 21, 2021
6e247b6
format and lint
jschicktanz Oct 21, 2021
d2538a8
refactors filters package
jschicktanz Oct 21, 2021
c7c2cc3
adds filters package
jschicktanz Oct 21, 2021
6dbba63
Merge branch 'filters-package' into transport-cmd
jschicktanz Oct 21, 2021
02d0bb2
refactoring + added tests
jschicktanz Oct 26, 2021
54b89b9
adds tests for local oci blob downloader
jschicktanz Oct 26, 2021
6304559
refactoring + adds test for oci artifact downloader
jschicktanz Oct 26, 2021
4953cc3
refactoring + adds tests
jschicktanz Oct 28, 2021
00cb568
wip
jschicktanz Oct 28, 2021
06815ff
adds first test for oci image serialization
jschicktanz Oct 29, 2021
162707f
improves tests of oci artifact serialization
jschicktanz Nov 2, 2021
db92cd5
improves uploaders package
jschicktanz Nov 2, 2021
3b4a5dc
renames file
jschicktanz Nov 2, 2021
5b1ab2b
moves function to utils package and adds tests
jschicktanz Nov 2, 2021
e5fc684
renames labeling processor and adds test
jschicktanz Nov 3, 2021
e1d99f4
refactoring
jschicktanz Nov 3, 2021
779cd8c
refactoring
jschicktanz Nov 3, 2021
526e68f
use map[string]string for passing env variables
jschicktanz Nov 3, 2021
9fbcdc7
refactoring + changes doc
jschicktanz Nov 3, 2021
fc6e1a0
Merge branch 'transport-cmd-0' into transport-cmd
jschicktanz Nov 3, 2021
5325cbc
moves oci artifact serialization to process/utils package
jschicktanz Nov 3, 2021
2b2710c
updates license headers
jschicktanz Nov 3, 2021
fd1bf55
Merge branch 'main' into transport-cmd
jschicktanz Nov 3, 2021
5385d57
adds tests for utils
jschicktanz Nov 4, 2021
7c694d1
adds tests for filtering
jschicktanz Nov 9, 2021
9630a31
wip
jschicktanz Nov 10, 2021
2b9b508
adds test for image index in oci image filter
jschicktanz Nov 11, 2021
bc7da1d
comment out unnecessary code
jschicktanz Nov 11, 2021
a6e85fb
adds tests for config package
jschicktanz Nov 11, 2021
a2a335a
refactoring and docs added
jschicktanz Nov 12, 2021
648abf7
wip
jschicktanz Nov 19, 2021
e5b943b
wip
jschicktanz Nov 22, 2021
7f0e10c
adds testcase for oci artifact uploader
jschicktanz Nov 22, 2021
7ea523d
refactors oci uploader tests
jschicktanz Nov 24, 2021
9b24bd4
refactors test coding
jschicktanz Nov 24, 2021
2690218
refactors test coding
jschicktanz Nov 24, 2021
a296000
renames uds to unix domain socket
jschicktanz Nov 29, 2021
9dc8e97
review feedback
jschicktanz Nov 29, 2021
6d0d6d2
remove unix domain socket file after processor finished
jschicktanz Nov 29, 2021
128e337
Merge branch 'transport-cmd-0' into transport-cmd
jschicktanz Nov 30, 2021
38acc5b
fix compile error
jschicktanz Nov 30, 2021
4f49aa6
increase processor timeout
jschicktanz Nov 30, 2021
6dea353
wip
jschicktanz Dec 1, 2021
bea11b5
Merge branch 'main' into transport-cmd
jschicktanz Dec 2, 2021
d675ef2
adds component descriptor signature generation
jschicktanz Dec 13, 2021
ade22ae
improves logging and error handling
jschicktanz Dec 13, 2021
038e794
implements dry-run + refactoring
jschicktanz Dec 14, 2021
aa6e24f
refactoring
jschicktanz Dec 14, 2021
61edcc3
adds processor timeout cli option
jschicktanz Dec 14, 2021
0baa125
moves processing job to proces package
jschicktanz Dec 14, 2021
30e4a65
refactoring
jschicktanz Dec 15, 2021
f1074d6
Merge branch 'main' into transport-cmd
jschicktanz Dec 16, 2021
f848587
Merge branch 'main' into transport-cmd
jschicktanz Dec 21, 2021
1d9dce8
adds newline to output
jschicktanz Dec 21, 2021
afb2371
adds test for repo ctx override
jschicktanz Dec 21, 2021
92ca076
Merge branch 'main' into transport-cmd
jschicktanz Dec 21, 2021
a0dc11a
adds doc
jschicktanz Jan 10, 2022
f996602
Merge branch 'main' into transport-cmd
jschicktanz Jan 24, 2022
302d47c
removes signature coding
jschicktanz Jan 24, 2022
fb08e8b
remove unix domain socket file after processor exit
jschicktanz Jan 24, 2022
fb6cf9d
moves transport cmd to remote command
jschicktanz Jan 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
implements processor factory
  • Loading branch information
jschicktanz committed Oct 15, 2021
commit 555ca810497aaa1861e1ae3ca09a1214bdbf6215
45 changes: 42 additions & 3 deletions pkg/transport/config/processor_factory.go
Original file line number Diff line number Diff line change
@@ -7,21 +7,60 @@ import (
"encoding/json"
"fmt"

"github.com/gardener/component-cli/ociclient/cache"
"github.com/gardener/component-cli/pkg/transport/process"
"github.com/gardener/component-cli/pkg/transport/process/processors"
cdv2 "github.com/gardener/component-spec/bindings-go/apis/v2"
"sigs.k8s.io/yaml"
)

func NewProcessorFactory() *ProcessorFactory{
return &ProcessorFactory{}
func NewProcessorFactory(ociCache cache.Cache) *ProcessorFactory {
return &ProcessorFactory{
cache: ociCache,
}
}

type ProcessorFactory struct {
cache cache.Cache
}

func (f *ProcessorFactory) Create(typ string, spec *json.RawMessage) (process.ResourceStreamProcessor, error) {
switch typ {
case "label":
return f.createLabellingProcessor(spec)
case "ociImageFilter":
return f.createOCIImageFilter(spec)
case "executable":
return createExecutable(spec)
default:
return nil, fmt.Errorf("unknown processor type %s", typ)
}
}
}

func (f *ProcessorFactory) createLabellingProcessor(rawSpec *json.RawMessage) (process.ResourceStreamProcessor, error) {
type processorSpec struct {
Labels cdv2.Labels `json:"labels"`
}

var spec processorSpec
err := yaml.Unmarshal(*rawSpec, &spec)
if err != nil {
return nil, fmt.Errorf("unable to parse spec: %w", err)
}

return processors.NewLabellingProcessor(spec.Labels...), nil
}

func (f *ProcessorFactory) createOCIImageFilter(rawSpec *json.RawMessage) (process.ResourceStreamProcessor, error) {
type processorSpec struct {
RemovePatterns []string `json:"removePatterns"`
}

var spec processorSpec
err := yaml.Unmarshal(*rawSpec, &spec)
if err != nil {
return nil, fmt.Errorf("unable to parse spec: %w", err)
}

return processors.NewOCIImageFilter(f.cache, spec.RemovePatterns), nil
}