feat!: rename supported kernels to targets
BREAKING CHANGE: .out-of-tree.toml: s/[[supported_kernels]]/[[targets]]/
This commit is contained in:
@ -135,7 +135,7 @@ type Artifact struct {
|
||||
Type ArtifactType
|
||||
TestFiles []FileTransfer
|
||||
SourcePath string
|
||||
SupportedKernels []KernelMask
|
||||
Targets []KernelMask
|
||||
|
||||
Script string
|
||||
|
||||
@ -187,7 +187,7 @@ func (ka Artifact) checkSupport(ki KernelInfo, km KernelMask) (
|
||||
|
||||
// Supported returns true if given kernel is supported by artifact
|
||||
func (ka Artifact) Supported(ki KernelInfo) (supported bool, err error) {
|
||||
for _, km := range ka.SupportedKernels {
|
||||
for _, km := range ka.Targets {
|
||||
supported, err = ka.checkSupport(ki, km)
|
||||
if supported {
|
||||
break
|
||||
@ -331,8 +331,8 @@ func ReadArtifactConfig(path string) (ka Artifact, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
for i, _ := range ka.SupportedKernels {
|
||||
km := &ka.SupportedKernels[i]
|
||||
for i, _ := range ka.Targets {
|
||||
km := &ka.Targets[i]
|
||||
if len(km.Kernel.Version) != 0 && km.ReleaseMask != "" {
|
||||
s := "Only one way to define kernel version is allowed"
|
||||
err = errors.New(s)
|
||||
|
@ -17,7 +17,7 @@ func TestMarshalUnmarshal(t *testing.T) {
|
||||
Name: "Put name here",
|
||||
Type: KernelModule,
|
||||
}
|
||||
artifactCfg.SupportedKernels = append(artifactCfg.SupportedKernels,
|
||||
artifactCfg.Targets = append(artifactCfg.Targets,
|
||||
KernelMask{distro.Distro{
|
||||
ID: distro.Ubuntu,
|
||||
Release: "18.04",
|
||||
|
Reference in New Issue
Block a user