Skip to content

Commit

Permalink
VCenterPackager has Logger available
Browse files Browse the repository at this point in the history
- packager_factory passes logger when constructing
  • Loading branch information
aramprice committed Jul 23, 2024
1 parent 0e3cf2e commit 310e42c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
19 changes: 15 additions & 4 deletions package_stemcell/factory/packager_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,21 @@ func (f *PackagerFactory) Packager(sourceConfig config.SourceConfig, outputConfi

switch source {
case config.VCENTER:
runner := &iaas_cli.GovcRunner{}
client := iaas_clients.NewVcenterClient(sourceConfig.Username, sourceConfig.Password, sourceConfig.URL, sourceConfig.CaCertFile, runner)
vCenterPackager := &packagers.VCenterPackager{SourceConfig: sourceConfig, OutputConfig: outputConfig, Client: client}
return vCenterPackager, nil
client :=
iaas_clients.NewVcenterClient(
sourceConfig.Username,
sourceConfig.Password,
sourceConfig.URL,
sourceConfig.CaCertFile,
&iaas_cli.GovcRunner{},
)

return &packagers.VCenterPackager{
SourceConfig: sourceConfig,
OutputConfig: outputConfig,
Client: client,
Logger: logger,
}, nil
case config.VMDK:
options :=
package_parameters.VmdkPackageParameters{}
Expand Down
2 changes: 2 additions & 0 deletions package_stemcell/packagers/vcenter_packager.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"path/filepath"
"regexp"

"github.com/cloudfoundry/stembuild/colorlogger"
"github.com/cloudfoundry/stembuild/filesystem"
"github.com/cloudfoundry/stembuild/package_stemcell/config"
)
Expand All @@ -27,6 +28,7 @@ type VCenterPackager struct {
SourceConfig config.SourceConfig
OutputConfig config.OutputConfig
Client IaasClient
Logger colorlogger.Logger
}

func (v VCenterPackager) Package() error {
Expand Down

0 comments on commit 310e42c

Please sign in to comment.