-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add error codes for test failures (#5385)
* Adding error codes for test failures * Adding error code for structure tests * Updating Copyright year
- Loading branch information
1 parent
0ba3ee7
commit 607eedc
Showing
9 changed files
with
435 additions
and
293 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
Copyright 2021 The Skaffold Authors | ||
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 test | ||
|
||
import ( | ||
"fmt" | ||
|
||
sErrors "github.com/GoogleContainerTools/skaffold/pkg/skaffold/errors" | ||
"github.com/GoogleContainerTools/skaffold/proto" | ||
) | ||
|
||
func dockerPullImageErr(fqn string, err error) error { | ||
return sErrors.NewError(err, | ||
proto.ActionableErr{ | ||
Message: fmt.Sprintf("unable to docker pull image %s: %s", fqn, err), | ||
ErrCode: proto.StatusCode_TEST_IMG_PULL_ERR, | ||
}, | ||
) | ||
} | ||
|
||
func expandingFilePathsErr(err error) error { | ||
return sErrors.NewError(err, | ||
proto.ActionableErr{ | ||
Message: fmt.Sprintf("expanding test file paths: %s", err), | ||
ErrCode: proto.StatusCode_TEST_USER_CONFIG_ERR, | ||
}, | ||
) | ||
} |
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,33 @@ | ||
/* | ||
Copyright 2021 The Skaffold Authors | ||
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 structure | ||
|
||
import ( | ||
"fmt" | ||
|
||
sErrors "github.com/GoogleContainerTools/skaffold/pkg/skaffold/errors" | ||
"github.com/GoogleContainerTools/skaffold/proto" | ||
) | ||
|
||
func containerStructureTestErr(err error) error { | ||
return sErrors.NewError(err, | ||
proto.ActionableErr{ | ||
Message: fmt.Sprintf("running container-structure-test: %s", err), | ||
ErrCode: proto.StatusCode_TEST_CST_USER_ERR, | ||
}, | ||
) | ||
} |
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
Large diffs are not rendered by default.
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