Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/oc/oc.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ func CreateChainsImageRegistrySecret(dockerConfig string) {
cmd.MustSucceed("oc", "create", "secret", "generic", "chains-image-registry-credentials", "--from-literal=.dockerconfigjson="+dockerConfig, "--from-literal=config.json="+dockerConfig, "--type=kubernetes.io/dockerconfigjson")
}

func CreateJibMavenImageRegistrySecret(dockerConfig string) {
cmd.MustSucceed("oc", "create", "secret", "generic", "jib-maven-image-registry-credentials", "--from-literal=.dockerconfigjson="+dockerConfig, "--from-literal=config.json="+dockerConfig, "--type=kubernetes.io/dockerconfigjson")
}

func CopySecret(secretName string, sourceNamespace string, destNamespace string) {
secretJson := cmd.MustSucceed("oc", "get", "secret", secretName, "-n", sourceNamespace, "-o", "json").Stdout()
cmdOutput := cmd.MustSucceed("bash", "-c", fmt.Sprintf(`echo '%s' | jq 'del(.metadata["namespace", "creationTimestamp", "resourceVersion", "selfLink", "uid", "annotations"]) | .data |= with_entries(if .key == "github-auth-key" then .key = "token" else . end)'`, secretJson)).Stdout()
Expand Down
4 changes: 4 additions & 0 deletions specs/ecosystem/ecosystem-multiarch.spec
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Type: Functional
Importance: Critical

Steps:
* Verify that jib-maven image registry variable is exported
* Create secret with image registry credentials for jib-maven
* Create
|S.NO|resource_dir |
|----|------------------------------------------------------|
Expand All @@ -31,6 +33,8 @@ Type: Functional
Importance: Critical

Steps:
* Verify that jib-maven image registry variable is exported
* Create secret with image registry credentials for jib-maven
* Create
|S.NO|resource_dir |
|----|------------------------------------------------------|
Expand Down
24 changes: 24 additions & 0 deletions steps/ecosystem/ecosystem.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package ecosystem

import (
"os"

"github.com/getgauge-contrib/gauge-go/gauge"
"github.com/getgauge-contrib/gauge-go/testsuit"
"github.com/openshift-pipelines/release-tests/pkg/oc"
)

var _ = gauge.Step("Verify that jib-maven image registry variable is exported", func() {
if os.Getenv("JIB_MAVEN_REPOSITORY") == "" {
testsuit.T.Errorf("'JIB_MAVEN_REPOSITORY' environment variable is not exported")
}
})

var _ = gauge.Step("Create secret with image registry credentials for jib-maven", func() {
if os.Getenv("JIB_MAVEN_DOCKER_CONFIG_JSON") == "" {
testsuit.T.Errorf("'JIB_MAVEN_DOCKER_CONFIG_JSON' credentials environment variable is not exported")
} else {
dockerConfig := os.Getenv("JIB_MAVEN_DOCKER_CONFIG_JSON")
oc.CreateJibMavenImageRegistrySecret(dockerConfig)
}
})
2 changes: 1 addition & 1 deletion testdata/ecosystem/pipelines/jib-maven-pz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ spec:
- name: INSECUREREGISTRY
value: "false"
- name: MAVEN_IMAGE
value: maven:3.8.3-adoptopenjdk-11
value: maven:3.8.3-adoptopenjdk-11