Extract cmd/helm to external package

Prior to this commit we couldn't import "helm.sh/helm/v3/cmd/helm"
because "helm.sh/helm/v3/cmd/helm" is a program, not an importable
package.

Signed-off-by: Juan-Luis de Sousa-Valadas Castaño <jvaladas@mirantis.com>
pull/12772/head
Juan-Luis de Sousa-Valadas Castaño 2 years ago
parent e81f6140dd
commit 7c6dfc3e3e

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"io"

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"runtime"

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"io"

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"testing"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"testing"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"flag"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"io"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"io"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"testing"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"testing"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"testing"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"testing"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"testing"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"testing"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"testing"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main // import "helm.sh/helm/v3/cmd/helm"
package app
import (
"fmt"
@ -55,7 +55,7 @@ func warning(format string, v ...interface{}) {
fmt.Fprintf(os.Stderr, format, v...)
}
func main() {
func Main() {
// Setting the name of the app for managedFields in the Kubernetes client.
// It is set here to the full name of "helm" so that renaming of helm to
// another name (e.g., helm2 or helm3) does not change the name of the

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"bytes"
@ -170,7 +170,7 @@ func TestPluginExitCode(t *testing.T) {
os.Args = []string{"helm", "exitwith", "2"}
// We DO call helm's main() here. So this looks like a normal `helm` process.
main()
Main()
// As main calls os.Exit, we never reach this line.
// But the test called this block of code catches and verifies the exit code.

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"context"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"testing"

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"bytes"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"io"

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"bytes"

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"io"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"testing"

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"io"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"bufio"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"testing"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"io"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"testing"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"testing"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"io"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"context"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"io"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"bytes"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"testing"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"bytes"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"testing"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"bytes"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main // import "helm.sh/helm/v3/cmd/helm"
package app
import (
"context"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"os"

@ -16,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"os"

@ -16,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"bytes"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
func checkPerms() {
// Not yet implemented on Windows. If you know how to do a comprehensive perms

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"io"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"bufio"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"testing"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import "testing"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"bytes"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"testing"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"bytes"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"testing"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"context"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"fmt"

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package app
import (
"testing"

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save