Skip to content

Commit

Permalink
chore: regenerated
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Jul 11, 2023
1 parent 8fddcae commit 24edfc4
Show file tree
Hide file tree
Showing 107 changed files with 12,133 additions and 59 deletions.
3 changes: 3 additions & 0 deletions pkg/config/job/utilityconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,7 @@ type UtilityConfig struct {
// CloneDepth is the depth of the clone that will be used.
// A depth of zero will do a full clone.
CloneDepth int `json:"clone_depth,omitempty"`
// IsResolvedWithUsesSyntax indicates how the pipeline was resolved. Used internally in lighthouse for determining
// if the pipeline syntax is deprecated.
IsResolvedWithUsesSyntax bool `json:"-"`
}
27 changes: 17 additions & 10 deletions pkg/triggerconfig/inrepo/default_parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"context"
"strings"

"github.com/tektoncd/pipeline/pkg/apis/config"

"github.com/pkg/errors"

"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
Expand Down Expand Up @@ -102,7 +104,6 @@ func DefaultPipelineParameters(prs *v1beta1.PipelineRun) (*v1beta1.PipelineRun,
if prs.Annotations != nil && prs.Annotations[DefaultParameters] == "false" {
return prs, nil
}

ps := prs.Spec.PipelineSpec
if ps == nil {
return prs, nil
Expand All @@ -125,15 +126,6 @@ func DefaultPipelineParameters(prs *v1beta1.PipelineRun) (*v1beta1.PipelineRun,
}
}

for i := range ps.Params {
param := &ps.Params[i]
if param.Type == "" {
param.Type = "string"
}

ps.Params[i] = *param
}

for i := range ps.Finally {
task := &ps.Finally[i]
task.Params = addDefaultParameters(task.Params, defaultParameters)
Expand All @@ -151,6 +143,8 @@ func DefaultPipelineParameters(prs *v1beta1.PipelineRun) (*v1beta1.PipelineRun,

// lets validate to make sure its valid
ctx := context.TODO()
// lets enable alpha fields
ctx = enableAlphaAPIFields(ctx)

// lets avoid missing workspaces causing issues
if len(prs.Spec.Workspaces) > 0 {
Expand All @@ -175,6 +169,19 @@ func DefaultPipelineParameters(prs *v1beta1.PipelineRun) (*v1beta1.PipelineRun,
return prs, nil
}

func enableAlphaAPIFields(ctx context.Context) context.Context {
featureFlags, _ := config.NewFeatureFlagsFromMap(map[string]string{
"enable-api-fields": "alpha",
})
cfg := &config.Config{
Defaults: &config.Defaults{
DefaultTimeoutMinutes: 60,
},
FeatureFlags: featureFlags,
}
return config.ToContext(ctx, cfg)
}

func addDefaultParameterSpecs(params []v1beta1.ParamSpec, defaults []v1beta1.ParamSpec) []v1beta1.ParamSpec {
for _, dp := range defaults {
found := false
Expand Down
Loading

0 comments on commit 24edfc4

Please sign in to comment.