common

package
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Copyright (C) 2020 VMware, Inc. SPDX-License-Identifier: Apache-2.0

Copyright (C) 2020 VMware, Inc. SPDX-License-Identifier: Apache-2.0

Copyright (C) 2020 VMware, Inc. SPDX-License-Identifier: Apache-2.0

Copyright (C) 2020 VMware, Inc. SPDX-License-Identifier: Apache-2.0

Copyright (C) 2020 VMware, Inc. SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

View Source
var (
	// TmpDirPattern sets the pattern for temporary files
	TmpDirPattern = "build_cli_tests"
)

Functions

func GetKubeClientset added in v0.1.3

func GetKubeClientset() (*kubernetes.Clientset, string, error)

GetKubeClientset retrieves the clientset and namespace

func GetRuntime added in v0.1.4

func GetRuntime(ctx context.Context, clientset *kubernetes.Clientset) (string, error)

GetRuntime will return the runtime detected in the cluster Assumes a common runtime (first node found is returned)

func LogBuilderLogs added in v0.1.4

func LogBuilderLogs(ctx context.Context, name, namespace string, clientset *kubernetes.Clientset)

LogBuilderLogs attempts to replay the log messages from the builder(s)

func NewBuildContext

func NewBuildContext(payloads map[string]string) (string, func(), error)

NewBuildContext creates a temporary directory with a set of files populated. The input payload keys represent the filenames, and values are the contents of the files. Returns the directory path, a cleanup function, and error Callers should always call the cleanup, even in the case of an error

func NewSimpleBuildContext

func NewSimpleBuildContext() (string, func(), error)

NewSimpleBuildContext creates a very simple Dockerfile for exercising the builder

func RunBuild

func RunBuild(args []string, streams RunBuildStreams) error

func RunBuildkit

func RunBuildkit(command string, args []string, streams RunBuildStreams) error

func RunSimpleBuildImageAsPod added in v0.1.3

func RunSimpleBuildImageAsPod(ctx context.Context, name, imageName, namespace string, clientset *kubernetes.Clientset) error

func Skipper

func Skipper(t *testing.T)

Skipper will skip this test if we're not in integration mode

Types

type BaseSuite

type BaseSuite struct {
	suite.Suite
	Name            string
	CreateFlags     []string
	SkipSetupCreate bool

	ClientSet *kubernetes.Clientset
	Namespace string
}

func (*BaseSuite) SetupSuite added in v0.1.3

func (s *BaseSuite) SetupSuite()

func (*BaseSuite) TearDownSuite added in v0.1.3

func (s *BaseSuite) TearDownSuite()

func (*BaseSuite) TestLocalOutputTarBuild added in v0.1.3

func (s *BaseSuite) TestLocalOutputTarBuild()

func (*BaseSuite) TestLs added in v0.1.4

func (s *BaseSuite) TestLs()

func (*BaseSuite) TestSimpleBuild

func (s *BaseSuite) TestSimpleBuild()

type RunBuildStreams added in v0.1.4

type RunBuildStreams struct {
	In  io.Reader
	Out io.Writer
	Err io.Writer
}

RunBuildStreams can override in/out/err streams if the output needs to be evaluated if unset, stdin/stdout/stderr will be used

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL