Skip to content

Commit

Permalink
Add validation for feature-flags configmap to webhook
Browse files Browse the repository at this point in the history
Prior to this commit, the validating admission webhook validated the logging,
defaults, and leader election configmaps, but not the feature flags configmap.
This meant that invalid edits to the feature-flags configmap would be silently
accepted, but could later cause PipelineRuns and TaskRuns to fail.
This commit validates the feature-flags configmap in the validation webhook.

Note: we currently have a cyclic dependency between the validating admission webhook
and the configmaps used by pipelines. This commit does not address this problem,
which should be handled separately (tektoncd#4542).
  • Loading branch information
lbernick authored and tekton-robot committed Jul 19, 2023
1 parent b3cd760 commit 24e64ed
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,10 @@ func newConfigValidationController(name string) func(context.Context, configmap.

// The configmaps to validate.
configmap.Constructors{
logging.ConfigMapName(): logging.NewConfigFromConfigMap,
defaultconfig.GetDefaultsConfigName(): defaultconfig.NewDefaultsFromConfigMap,
pkgleaderelection.ConfigMapName(): pkgleaderelection.NewConfigFromConfigMap,
logging.ConfigMapName(): logging.NewConfigFromConfigMap,
defaultconfig.GetDefaultsConfigName(): defaultconfig.NewDefaultsFromConfigMap,
pkgleaderelection.ConfigMapName(): pkgleaderelection.NewConfigFromConfigMap,
defaultconfig.GetFeatureFlagsConfigName(): defaultconfig.NewFeatureFlagsFromConfigMap,
},
)
}
Expand Down

0 comments on commit 24e64ed

Please sign in to comment.