Skip to content

Commit

Permalink
Dont use envfile for storage
Browse files Browse the repository at this point in the history
  • Loading branch information
cdrage committed Jul 7, 2022
1 parent 063b3fc commit df24674
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pkg/component/pushed_component.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func GetPushedComponent(c kclient.ClientInterface, componentName, applicationNam
}
return nil, err
}
storageClient := storage.NewClient(storage.ClientOptions{
storageClient := storage.NewClient(componentName, applicationName, storage.ClientOptions{
Client: c,
Deployment: d,
})
Expand Down
2 changes: 1 addition & 1 deletion pkg/devfile/adapters/kubernetes/component/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ func (a *Adapter) createOrUpdateComponent(
ei.SetDevfileObj(a.Devfile)
componentName := a.ComponentName

storageClient := storagepkg.NewClient(storagepkg.ClientOptions{
storageClient := storagepkg.NewClient(componentName, a.AppName, storagepkg.ClientOptions{
Client: a.kubeClient,
LocalConfigProvider: &ei,
})
Expand Down
11 changes: 3 additions & 8 deletions pkg/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
v1 "k8s.io/api/apps/v1"

"github.com/redhat-developer/odo/pkg/kclient"
"github.com/redhat-developer/odo/pkg/labels"
"github.com/redhat-developer/odo/pkg/localConfigProvider"
"github.com/redhat-developer/odo/pkg/log"
)
Expand Down Expand Up @@ -46,21 +45,17 @@ type Client interface {
}

// NewClient gets the appropriate Storage client based on the parameters
func NewClient(options ClientOptions) Client {
func NewClient(componentName string, appName string, options ClientOptions) Client {
var genericInfo generic

if options.LocalConfigProvider != nil {
genericInfo = generic{
appName: options.LocalConfigProvider.GetApplication(),
componentName: options.LocalConfigProvider.GetName(),
localConfigProvider: options.LocalConfigProvider,
}
}

if options.Deployment != nil {
genericInfo.appName = labels.GetAppName(options.Deployment.Labels)
genericInfo.componentName = labels.GetComponentName(options.Deployment.Labels)
}
genericInfo.componentName = componentName
genericInfo.appName = appName

return kubernetesClient{
generic: genericInfo,
Expand Down

0 comments on commit df24674

Please sign in to comment.