-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
introducing env to git pipeline resource
Along with type and params, we can specify env. now for git resources. Env. takes a list of envionment variable names and their values and sets those variables in a container where git CLI is being executed e.g.: ``` inputs: resources: - name: skaffold resourceSpec: type: git params: - name: revision value: master - name: url value: https://github.com/GoogleContainerTools/skaffold env: - name: HTTPS_PROXY value: "myproxy.com" ```
- Loading branch information
1 parent
a5794f2
commit a7e2624
Showing
9 changed files
with
293 additions
and
10 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
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 |
---|---|---|
|
@@ -329,6 +329,45 @@ func TestGitResource_GetDownloadTaskModifier(t *testing.T) { | |
WorkingDir: "/workspace", | ||
Env: []corev1.EnvVar{{Name: "TEKTON_RESOURCE_NAME", Value: "git-resource"}}, | ||
}, | ||
}, { | ||
desc: "With Env", | ||
gitResource: &git.Resource{ | ||
Name: "git-resource", | ||
Type: resourcev1alpha1.PipelineResourceTypeGit, | ||
URL: "[email protected]:test/test.git", | ||
Revision: "master", | ||
GitImage: "override-with-git:latest", | ||
Submodules: false, | ||
Depth: 1, | ||
SSLVerify: false, | ||
Env: []corev1.EnvVar{{ | ||
Name: "FOO", | ||
Value: "foo", | ||
ValueFrom: nil, | ||
}, { | ||
Name: "BAR", | ||
Value: "bar", | ||
ValueFrom: nil, | ||
}}, | ||
}, | ||
want: corev1.Container{ | ||
Name: "git-source-git-resource-6nl7g", | ||
Image: "override-with-git:latest", | ||
Command: []string{"/ko-app/git-init"}, | ||
Args: []string{ | ||
"-url", | ||
"[email protected]:test/test.git", | ||
"-revision", | ||
"master", | ||
"-path", | ||
"/test/test", | ||
"-submodules=false", | ||
"-sslVerify=false", | ||
}, | ||
WorkingDir: "/workspace", | ||
Env: []corev1.EnvVar{{Name: "FOO", Value: "foo"}, {Name: "BAR", Value: "bar"}, | ||
{Name: "TEKTON_RESOURCE_NAME", Value: "git-resource"}}, | ||
}, | ||
}} { | ||
t.Run(tc.desc, func(t *testing.T) { | ||
ts := pipelinev1alpha1.TaskSpec{} | ||
|
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
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
Oops, something went wrong.