Skip to content
Permalink
Browse files
fix(final-repo): service values .Values.werf.repo should use --final-…
…repo instead of --repo

Signed-off-by: Timofey Kirillov <timofey.kirillov@flant.com>
  • Loading branch information
distorhead committed Jun 14, 2022
1 parent 79810cc commit e0562f6a6c1dc2662e02c8b30523affb6a2e2ce6
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 13 deletions.
@@ -224,7 +224,7 @@ func runExport(ctx context.Context) error {
logboek.LogOptionalLn()

var imagesInfoGetters []*image.InfoGetter
var imagesRepository string
var imagesRepo string

if len(werfConfig.StapelImages) != 0 || len(werfConfig.ImagesFromDockerfile) != 0 {
stagesStorage, err := common.GetStagesStorage(containerBackend, &commonCmdData)
@@ -258,7 +258,7 @@ func runExport(ctx context.Context) error {

storageManager := manager.NewStorageManager(projectName, stagesStorage, finalStagesStorage, secondaryStagesStorageList, cacheStagesStorageList, storageLockManager)

imagesRepository = storageManager.GetStagesStorage().String()
imagesRepo = storageManager.GetServiceValuesRepo()

conveyorOptions, err := common.GetConveyorOptionsWithParallel(&commonCmdData, buildOptions)
if err != nil {
@@ -322,7 +322,7 @@ func runExport(ctx context.Context) error {
return fmt.Errorf("getting HEAD commit time failed: %w", err)
}

if vals, err := helpers.GetServiceValues(ctx, werfConfig.Meta.Project, imagesRepository, imagesInfoGetters, helpers.ServiceValuesOptions{
if vals, err := helpers.GetServiceValues(ctx, werfConfig.Meta.Project, imagesRepo, imagesInfoGetters, helpers.ServiceValuesOptions{
Env: *commonCmdData.Environment,
CommitHash: headHash,
CommitDate: headTime,
@@ -250,7 +250,7 @@ func runPublish(ctx context.Context) error {
}

var imagesInfoGetters []*image.InfoGetter
var imagesRepository string
var imagesRepo string

if len(werfConfig.StapelImages) != 0 || len(werfConfig.ImagesFromDockerfile) != 0 {
stagesStorage, err := common.GetStagesStorage(containerBackend, &commonCmdData)
@@ -284,7 +284,7 @@ func runPublish(ctx context.Context) error {

storageManager := manager.NewStorageManager(projectName, stagesStorage, finalStagesStorage, secondaryStagesStorageList, cacheStagesStorageList, storageLockManager)

imagesRepository = storageManager.StagesStorage.String()
imagesRepo = storageManager.GetServiceValuesRepo()

conveyorOptions, err := common.GetConveyorOptionsWithParallel(&commonCmdData, buildOptions)
if err != nil {
@@ -353,7 +353,7 @@ func runPublish(ctx context.Context) error {
return fmt.Errorf("getting HEAD commit time failed: %w", err)
}

if vals, err := helpers.GetServiceValues(ctx, werfConfig.Meta.Project, imagesRepository, imagesInfoGetters, helpers.ServiceValuesOptions{
if vals, err := helpers.GetServiceValues(ctx, werfConfig.Meta.Project, imagesRepo, imagesInfoGetters, helpers.ServiceValuesOptions{
Env: *commonCmdData.Environment,
CommitHash: headHash,
CommitDate: headTime,
@@ -270,7 +270,7 @@ func run(ctx context.Context, containerBackend container_backend.ContainerBacken
}

var imagesInfoGetters []*image.InfoGetter
var imagesRepository string
var imagesRepo string
if len(werfConfig.StapelImages) != 0 || len(werfConfig.ImagesFromDockerfile) != 0 {
stagesStorage, err := common.GetStagesStorage(containerBackend, &commonCmdData)
if err != nil {
@@ -304,7 +304,7 @@ func run(ctx context.Context, containerBackend container_backend.ContainerBacken

storageManager := manager.NewStorageManager(projectName, stagesStorage, finalStagesStorage, secondaryStagesStorageList, cacheStagesStorageList, storageLockManager)

imagesRepository = storageManager.StagesStorage.String()
imagesRepo = storageManager.GetServiceValuesRepo()

conveyorOptions, err := common.GetConveyorOptionsWithParallel(&commonCmdData, buildOptions)
if err != nil {
@@ -404,7 +404,7 @@ func run(ctx context.Context, containerBackend container_backend.ContainerBacken
return fmt.Errorf("getting HEAD commit time failed: %w", err)
}

if vals, err := helpers.GetServiceValues(ctx, werfConfig.Meta.Project, imagesRepository, imagesInfoGetters, helpers.ServiceValuesOptions{
if vals, err := helpers.GetServiceValues(ctx, werfConfig.Meta.Project, imagesRepo, imagesInfoGetters, helpers.ServiceValuesOptions{
Namespace: namespace,
Env: *commonCmdData.Environment,
SetDockerConfigJsonValue: *commonCmdData.SetDockerConfigJsonValue,
@@ -247,7 +247,7 @@ func runRender(ctx context.Context) error {
logboek.LogOptionalLn()

var imagesInfoGetters []*image.InfoGetter
var imagesRepository string
var imagesRepo string
var isStub bool
var stubImagesNames []string

@@ -293,7 +293,7 @@ func runRender(ctx context.Context) error {

storageManager := manager.NewStorageManager(projectName, stagesStorage, finalStagesStorage, secondaryStagesStorageList, cacheStagesStorageList, storageLockManager)

imagesRepository = storageManager.StagesStorage.String()
imagesRepo = storageManager.GetServiceValuesRepo()

conveyorOptions, err := common.GetConveyorOptionsWithParallel(&commonCmdData, buildOptions)
if err != nil {
@@ -328,7 +328,7 @@ func runRender(ctx context.Context) error {

logboek.LogOptionalLn()
} else {
imagesRepository = "REPO"
imagesRepo = "REPO"
isStub = true

for _, img := range werfConfig.StapelImages {
@@ -371,7 +371,7 @@ func runRender(ctx context.Context) error {
return fmt.Errorf("getting HEAD commit time failed: %w", err)
}

if vals, err := helpers.GetServiceValues(ctx, werfConfig.Meta.Project, imagesRepository, imagesInfoGetters, helpers.ServiceValuesOptions{
if vals, err := helpers.GetServiceValues(ctx, werfConfig.Meta.Project, imagesRepo, imagesInfoGetters, helpers.ServiceValuesOptions{
Namespace: namespace,
Env: *commonCmdData.Environment,
IsStub: isStub,
@@ -176,6 +176,13 @@ func (m *StorageManager) GetSecondaryStagesStorageList() []storage.StagesStorage
return m.SecondaryStagesStorageList
}

func (m *StorageManager) GetServiceValuesRepo() string {
if m.FinalStagesStorage != nil {
return m.FinalStagesStorage.String()
}
return m.StagesStorage.String()
}

func (m *StorageManager) GetImageInfoGetter(imageName string, stg stage.Interface, opts image.InfoGetterOptions) *image.InfoGetter {
stageID := stg.GetStageImage().Image.GetStageDescription().StageID
info := stg.GetStageImage().Image.GetStageDescription().Info

0 comments on commit e0562f6

Please sign in to comment.