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

feat: Vela OIDC Provider #375

Merged
merged 4 commits into from
May 16, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pipeline/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ type (
Volumes VolumeSlice `json:"volumes,omitempty" yaml:"volumes,omitempty"`
User string `json:"user,omitempty" yaml:"user,omitempty"`
ReportAs string `json:"report_as,omitempty" yaml:"report_as,omitempty"`
IDRequest string `json:"id_request,omitempty" yaml:"id_request,omitempty"`
}
)

Expand Down Expand Up @@ -135,7 +136,8 @@ func (c *Container) Empty() bool {
len(c.Ulimits) == 0 &&
len(c.Volumes) == 0 &&
len(c.User) == 0 &&
len(c.ReportAs) == 0 {
len(c.ReportAs) == 0 &&
len(c.IDRequest) == 0 {
return true
}

Expand Down
1 change: 1 addition & 0 deletions pipeline/container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,7 @@ func testContainers() *ContainerSlice {
Name: "clone",
Number: 2,
Pull: "always",
IDRequest: "yes",
},
{
ID: "step_github/octocat._1_echo",
Expand Down
2 changes: 2 additions & 0 deletions yaml/step.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type (
Privileged bool `yaml:"privileged,omitempty" json:"privileged,omitempty" jsonschema:"description=Run the container with extra privileges.\nReference: https://go-vela.github.io/docs/reference/yaml/steps/#the-privileged-tag"`
User string `yaml:"user,omitempty" json:"user,omitempty" jsonschema:"description=Set the user for the container.\nReference: https://go-vela.github.io/docs/reference/yaml/steps/#the-user-tag"`
ReportAs string `yaml:"report_as,omitempty" json:"report_as,omitempty" jsonschema:"description=Set the name of the step to report as.\nReference: https://go-vela.github.io/docs/reference/yaml/steps/#the-report_as-tag"`
IDRequest string `yaml:"id_request,omitempty" json:"id_request,omitempty" jsonschema:"description=Request ID Request Token for the step.\nReference: https://go-vela.github.io/docs/reference/yaml/steps/#the-id_request-tag"`
}
)

Expand Down Expand Up @@ -62,6 +63,7 @@ func (s *StepSlice) ToPipeline() *pipeline.ContainerSlice {
Volumes: *step.Volumes.ToPipeline(),
User: step.User,
ReportAs: step.ReportAs,
IDRequest: step.IDRequest,
})
}

Expand Down
2 changes: 2 additions & 0 deletions yaml/step_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func TestYaml_StepSlice_ToPipeline(t *testing.T) {
Privileged: false,
Pull: "not_present",
ReportAs: "my-step",
IDRequest: "yes",
Ruleset: Ruleset{
If: Rules{
Branch: []string{"main"},
Expand Down Expand Up @@ -88,6 +89,7 @@ func TestYaml_StepSlice_ToPipeline(t *testing.T) {
Privileged: false,
Pull: "not_present",
ReportAs: "my-step",
IDRequest: "yes",
Ruleset: pipeline.Ruleset{
If: pipeline.Rules{
Branch: []string{"main"},
Expand Down
Loading