|
|
@ -16,6 +16,7 @@ limitations under the License.
|
|
|
|
package installer // import "k8s.io/helm/pkg/plugin/installer"
|
|
|
|
package installer // import "k8s.io/helm/pkg/plugin/installer"
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
|
|
|
|
"fmt"
|
|
|
|
"path/filepath"
|
|
|
|
"path/filepath"
|
|
|
|
|
|
|
|
|
|
|
|
"k8s.io/helm/pkg/helm/helmpath"
|
|
|
|
"k8s.io/helm/pkg/helm/helmpath"
|
|
|
@ -28,8 +29,12 @@ type LocalInstaller struct {
|
|
|
|
|
|
|
|
|
|
|
|
// NewLocalInstaller creates a new LocalInstaller.
|
|
|
|
// NewLocalInstaller creates a new LocalInstaller.
|
|
|
|
func NewLocalInstaller(source string, home helmpath.Home) (*LocalInstaller, error) {
|
|
|
|
func NewLocalInstaller(source string, home helmpath.Home) (*LocalInstaller, error) {
|
|
|
|
|
|
|
|
src, err := filepath.Abs(source)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return nil, fmt.Errorf("unable to get absolute path to plugin: %v", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
i := &LocalInstaller{
|
|
|
|
i := &LocalInstaller{
|
|
|
|
base: newBase(source, home),
|
|
|
|
base: newBase(src, home),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return i, nil
|
|
|
|
return i, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -41,11 +46,7 @@ func (i *LocalInstaller) Install() error {
|
|
|
|
if !isPlugin(i.Source) {
|
|
|
|
if !isPlugin(i.Source) {
|
|
|
|
return ErrMissingMetadata
|
|
|
|
return ErrMissingMetadata
|
|
|
|
}
|
|
|
|
}
|
|
|
|
src, err := filepath.Abs(i.Source)
|
|
|
|
return i.link(i.Source)
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return i.link(src)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Update updates a local repository
|
|
|
|
// Update updates a local repository
|
|
|
|