|  | 
| 4 | 4 | 	"fmt" | 
| 5 | 5 | 	"io/fs" | 
| 6 | 6 | 	"os" | 
|  | 7 | +	"os/exec" | 
| 7 | 8 | 	"path/filepath" | 
| 8 | 9 | 	"strings" | 
| 9 | 10 | 	"testing" | 
| @@ -49,13 +50,45 @@ func TestPackageRepositoryReleaseInteractively(t *testing.T) { | 
| 49 | 50 | 			promptOutput.Write(env.Image) | 
| 50 | 51 | 		}() | 
| 51 | 52 | 
 | 
| 52 |  | -		kctrl.RunWithOpts([]string{"pkg", "repo", "release", "--tty=true", "--chdir", workingDir, "--version", "1.0.0"}, | 
|  | 53 | +		version := "1.0.0" | 
|  | 54 | +		kctrl.RunWithOpts([]string{"pkg", "repo", "release", "--tty=true", "--chdir", workingDir, "--version", version}, | 
| 53 | 55 | 			RunOpts{NoNamespace: true, StdinReader: promptOutput.StringReader(), | 
| 54 | 56 | 				StdoutWriter: promptOutput.BufferedOutputWriter(), Interactive: true}) | 
| 55 | 57 | 
 | 
| 56 | 58 | 		keysToBeIgnored := []string{"creationTimestamp:", "image"} | 
| 57 | 59 | 		verifyPackageRepoBuild(t, keysToBeIgnored) | 
| 58 | 60 | 		verifyPackageRepository(t, keysToBeIgnored) | 
|  | 61 | + | 
|  | 62 | +		args := []string{"tag", "list", "-i", os.Getenv("KCTRL_E2E_IMAGE")} | 
|  | 63 | +		cmd := exec.Command("imgpkg", args...) | 
|  | 64 | +		output, err := cmd.Output() | 
|  | 65 | +		require.Contains(t, string(output), version) | 
|  | 66 | +		require.NoError(t, err, "There was an error in listing the tags") | 
|  | 67 | +	}) | 
|  | 68 | + | 
|  | 69 | +	logger.Section("Creating a package repository interactively with tags using pkg repo release", func() { | 
|  | 70 | +		go func() { | 
|  | 71 | +			promptOutput.WaitFor("Enter the package repository name") | 
|  | 72 | +			promptOutput.Write(pkgrName) | 
|  | 73 | +			promptOutput.WaitFor("Enter the registry url") | 
|  | 74 | +			promptOutput.Write(env.Image) | 
|  | 75 | +		}() | 
|  | 76 | + | 
|  | 77 | +		version := "1.0.0" | 
|  | 78 | +		tag := "build-tag-0001" | 
|  | 79 | +		kctrl.RunWithOpts([]string{"pkg", "repo", "release", "--tty=true", "--chdir", workingDir, "--version", version, "--tag", tag}, | 
|  | 80 | +			RunOpts{NoNamespace: true, StdinReader: promptOutput.StringReader(), | 
|  | 81 | +				StdoutWriter: promptOutput.BufferedOutputWriter(), Interactive: true}) | 
|  | 82 | + | 
|  | 83 | +		keysToBeIgnored := []string{"creationTimestamp:", "image"} | 
|  | 84 | +		verifyPackageRepoBuild(t, keysToBeIgnored) | 
|  | 85 | +		verifyPackageRepository(t, keysToBeIgnored) | 
|  | 86 | + | 
|  | 87 | +		args := []string{"tag", "list", "-i", os.Getenv("KCTRL_E2E_IMAGE")} | 
|  | 88 | +		cmd := exec.Command("imgpkg", args...) | 
|  | 89 | +		output, err := cmd.Output() | 
|  | 90 | +		require.Contains(t, string(output), tag) | 
|  | 91 | +		require.NoError(t, err, "There was an error in listing the tags") | 
| 59 | 92 | 	}) | 
| 60 | 93 | 
 | 
| 61 | 94 | 	logger.Section(fmt.Sprintf("Installing package repository"), func() { | 
|  | 
0 commit comments