Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: move process options to struct #1109

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 10 additions & 2 deletions cmds/ocm/commands/ocmcmds/common/addhdlrs/rscs/elements.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (h *ResourceSpecHandler) Set(v ocm.ComponentVersionAccess, r addhdlrs.Eleme
SourceRefs: compdescv2.ConvertSourcerefsTo(spec.SourceRefs),
}
opts := h.getModOpts()
if spec.SkipDigestGeneration {
if spec.Options.SkipDigestGeneration {
opts = append(opts, ocm.SkipDigest()) //nolint:staticcheck // skip digest still used for tests
}
/*
Expand Down Expand Up @@ -132,8 +132,16 @@ type ResourceSpec struct {

addhdlrs.ResourceInput `json:",inline"`

// additional process related options
// Options describes additional process related options
// see ResourceOptions for more details.
Options ResourceOptions `json:"options,omitempty"`
}

// ResourceOptions describes additional process related options
// which reflect the handling of the resource without describing it directly.
// Typical examples are any options that require specific changes in handling of the resource
// but are not reflected in the resource itself (outside of side effects)
type ResourceOptions struct {
// SkipDigestGeneration omits the digest generation.
SkipDigestGeneration bool `json:"skipDigestGeneration,omitempty"`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ labels:
resources:
- name: text
type: PlainText
skipDigestGeneration: true
labels:
- name: city
value: Karlsruhe
Expand All @@ -23,6 +22,8 @@ resources:
input:
type: file
path: testdata
options:
skipDigestGeneration: true
- name: data
type: PlainText
input:
Expand Down
Loading