-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite framework to run as standalone binary instead of testing modu…
…le (#68)
- Loading branch information
Showing
57 changed files
with
1,804 additions
and
1,269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library") | ||
|
||
go_library( | ||
name = "go_default_library", | ||
srcs = [ | ||
"root.go", | ||
"test.go", | ||
"version.go", | ||
], | ||
importpath = "github.com/GoogleCloudPlatform/container-structure-test/cmd", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//pkg/drivers:go_default_library", | ||
"//pkg/output:go_default_library", | ||
"//pkg/types:go_default_library", | ||
"//pkg/types/unversioned:go_default_library", | ||
"//pkg/utils:go_default_library", | ||
"//pkg/version:go_default_library", | ||
"//vendor/github.com/fsouza/go-dockerclient:go_default_library", | ||
"//vendor/github.com/sirupsen/logrus:go_default_library", | ||
"//vendor/github.com/spf13/cobra:go_default_library", | ||
"//vendor/gopkg.in/yaml.v2:go_default_library", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright 2018 Google Inc. All rights reserved. | ||
|
||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
|
||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
"github.com/sirupsen/logrus" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var logLevel string | ||
var imagePath, driver, metadata string | ||
var save, pull, force, quiet, verbose bool | ||
|
||
var configFiles []string | ||
|
||
var RootCmd = &cobra.Command{ | ||
Use: "container-structure-test", | ||
Short: "container-structure-test provides a framework to test the structure of a container image", | ||
Long: `container-structure-test provides a powerful framework to validate | ||
the structure of a container image. | ||
These tests can be used to check the output of commands in an image, | ||
as well as verify metadata and contents of the filesystem.`, | ||
PersistentPreRun: func(c *cobra.Command, s []string) { | ||
ll, err := logrus.ParseLevel(logLevel) | ||
if err != nil { | ||
fmt.Println(err) | ||
os.Exit(1) | ||
} | ||
logrus.SetLevel(ll) | ||
}, | ||
} | ||
|
||
func init() { | ||
RootCmd.PersistentFlags().StringVar(&logLevel, "logLevel", "warning", "This flag controls the verbosity of container-structure-test.") | ||
} |
Oops, something went wrong.