Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1914894: get stdout only when invoking oc process #25826

Merged
merged 1 commit into from
Jan 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/extended/cli/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ var _ = g.Describe("[sig-cli] oc adm", func() {
})

g.It("role-reapers", func() {
policyRoles, err := ocns.Run("process").Args("-f", policyRolesPath, "-p", fmt.Sprintf("NAMESPACE=%s", ocns.Namespace())).Output()
policyRoles, _, err := ocns.Run("process").Args("-f", policyRolesPath, "-p", fmt.Sprintf("NAMESPACE=%s", ocns.Namespace())).Outputs()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(ocns.Run("create").Args("-f", "-").InputString(policyRoles).Execute()).To(o.Succeed())
o.Expect(ocns.Run("get").Args("rolebinding/basic-users").Execute()).To(o.Succeed())
Expand All @@ -333,7 +333,7 @@ var _ = g.Describe("[sig-cli] oc adm", func() {
g.It("cluster-role-reapers", func() {
clusterRole := gen.GenerateName("basic-user2-")
clusterBinding := gen.GenerateName("basic-users2-")
policyClusterRoles, err := ocns.Run("process").Args("-f", policyClusterRolesPath, "-p", fmt.Sprintf("ROLE_NAME=%s", clusterRole), "-p", fmt.Sprintf("BINDING_NAME=%s", clusterBinding)).Output()
policyClusterRoles, _, err := ocns.Run("process").Args("-f", policyClusterRolesPath, "-p", fmt.Sprintf("ROLE_NAME=%s", clusterRole), "-p", fmt.Sprintf("BINDING_NAME=%s", clusterBinding)).Outputs()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(oc.Run("create").Args("-f", "-").InputString(policyClusterRoles).Execute()).To(o.Succeed())

Expand Down Expand Up @@ -364,7 +364,7 @@ var _ = g.Describe("[sig-cli] oc adm", func() {
clusterRole := gen.GenerateName("basic-user2-")
clusterBinding := gen.GenerateName("basic-users2-")
// template processing requires a namespaced client
policyClusterRoles, err := ocns.Run("process").Args("-f", policyClusterRolesPath, "-p", fmt.Sprintf("ROLE_NAME=%s", clusterRole), "-p", fmt.Sprintf("BINDING_NAME=%s", clusterBinding)).Output()
policyClusterRoles, _, err := ocns.Run("process").Args("-f", policyClusterRolesPath, "-p", fmt.Sprintf("ROLE_NAME=%s", clusterRole), "-p", fmt.Sprintf("BINDING_NAME=%s", clusterBinding)).Outputs()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(oc.Run("create").Args("-f", "-").InputString(policyClusterRoles).Execute()).To(o.Succeed())

Expand Down Expand Up @@ -435,7 +435,7 @@ var _ = g.Describe("[sig-cli] oc adm", func() {
g.It("build-chain", func() {
// Test building a dependency tree
s2iBuildPath := exutil.FixturePath("..", "..", "examples", "sample-app", "application-template-stibuild.json")
out, err := ocns.Run("process").Args("-f", s2iBuildPath, "-l", "build=sti").Output()
out, _, err := ocns.Run("process").Args("-f", s2iBuildPath, "-l", "build=sti").Outputs()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(ocns.Run("create").Args("-f", "-").InputString(out).Execute()).To(o.Succeed())

Expand Down
2 changes: 1 addition & 1 deletion test/extended/util/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ func (c *CLI) outputs(stdOutBuff, stdErrBuff *bytes.Buffer) (string, string, err

// OutputToFile executes the command and store output to a file
func (c *CLI) OutputToFile(filename string) (string, error) {
content, err := c.Output()
content, _, err := c.Outputs()
if err != nil {
return "", err
}
Expand Down