github.com/helmwave/helmwave@v0.36.4-0.20240509190856-b35563eba4c6/pkg/plan/new_export_test.go (about)

     1  package plan
     2  
     3  import (
     4  	"github.com/helmwave/helmwave/pkg/helper"
     5  	regi "github.com/helmwave/helmwave/pkg/registry"
     6  	"github.com/helmwave/helmwave/pkg/release"
     7  	"github.com/helmwave/helmwave/pkg/repo"
     8  )
     9  
    10  func (p *Plan) NewBody() *planBody {
    11  	p.body = &planBody{}
    12  
    13  	return p.body
    14  }
    15  
    16  func (p *Plan) SetReleases(r ...*MockReleaseConfig) {
    17  	if p.body == nil {
    18  		p.NewBody()
    19  	}
    20  
    21  	p.body.Releases = helper.SlicesMap(r, func(r *MockReleaseConfig) release.Config {
    22  		return r
    23  	})
    24  }
    25  
    26  func (p *Plan) SetRepositories(r ...*MockRepositoryConfig) {
    27  	if p.body == nil {
    28  		p.NewBody()
    29  	}
    30  
    31  	p.body.Repositories = helper.SlicesMap(r, func(r *MockRepositoryConfig) repo.Config {
    32  		return r
    33  	})
    34  }
    35  
    36  func (p *Plan) SetRegistries(r ...*MockRegistryConfig) {
    37  	if p.body == nil {
    38  		p.NewBody()
    39  	}
    40  
    41  	p.body.Registries = helper.SlicesMap(r, func(r *MockRegistryConfig) regi.Config {
    42  		return r
    43  	})
    44  }