Skip to content

Commit

Permalink
Externalize TarBits Extract function
Browse files Browse the repository at this point in the history
This patch makes it possible to stage bits as a distinct step in the
TarBits Build process by invoking
pkg/build/kube.TarBitsExtract(kubeRoot, extractPath).
  • Loading branch information
akutz committed Mar 27, 2019
1 parent f25585d commit ee83d4d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pkg/build/kube/tarbits.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,20 @@ func init() {
RegisterNamedBits("tar", NewTarBits)
}

// TarBitsExtract extracts bits from a given kubeRoot to the given extractPath
// Please see NewTarBits for information on the valid kubeRoot values.
func TarBitsExtract(kubeRoot, extractPath string) error {
bits, err := NewTarBits(kubeRoot)
if err != nil {
return err
}
tarBits := bits.(*TarBits)
if _, err := tarBits.extract(tarBits.kubeRoot, extractPath); err != nil {
return err
}
return nil
}

// NewTarBits returns a new Bits backed by a version file, the release image
// archives and the kubeadm, kubectl, and kubelet binaries. The given kubeRoot
// may be defined three ways:
Expand Down

0 comments on commit ee83d4d

Please sign in to comment.