Skip to content

Commit

Permalink
Remove last lingering unnecessarily exported functions
Browse files Browse the repository at this point in the history
fixes #3262

There are a few things left, either by design or uncertainty:
* `pkg/apis/pipeline/v1beta1/conversion_error.go`'s `ConvertErrorf` - I'm not entirely clear on whether this should be around or not. `CannotConvertError` is still used in tests in `pkg/apis/pipeline/v1alpha1`, and the whole thing is just messy enough that I'm not sure what to do.
* `pkg/apis/pipeline/v1beta1/version_validation.go`'s `ValidateEnabledAPIFields` - it's referenced in `docs/developers/README.md` and I can't tell if that's something that could be intended to eb used in something depending on Tekton, not just in Tekton itself.
* `pkg/pipelinerunmetrics/injection.go` and `pkg/taskrunmetrics/injection.go`'s `WithInformer` - these are both used as function references in their respective `.../fake/fake.go`s.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
  • Loading branch information
abayer committed Oct 11, 2021
1 parent 00f7cc6 commit 58b7fef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pkg/apis/config/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ func (cfg *Metrics) Equals(other *Metrics) bool {
other.DurationPipelinerunType == cfg.DurationPipelinerunType
}

// NewMetricsFromMap returns a Config given a map corresponding to a ConfigMap
func NewMetricsFromMap(cfgMap map[string]string) (*Metrics, error) {
// newMetricsFromMap returns a Config given a map corresponding to a ConfigMap
func newMetricsFromMap(cfgMap map[string]string) (*Metrics, error) {
tc := Metrics{
TaskrunLevel: DefaultTaskrunLevel,
PipelinerunLevel: DefaultPipelinerunLevel,
Expand All @@ -144,5 +144,5 @@ func NewMetricsFromMap(cfgMap map[string]string) (*Metrics, error) {

// NewArtifactBucketFromConfigMap returns a Config for the given configmap
func NewMetricsFromConfigMap(config *corev1.ConfigMap) (*Metrics, error) {
return NewMetricsFromMap(config.Data)
return newMetricsFromMap(config.Data)
}
4 changes: 2 additions & 2 deletions pkg/apis/config/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func FromContextOrDefaults(ctx context.Context) *Config {
featureFlags, _ := NewFeatureFlagsFromMap(map[string]string{})
artifactBucket, _ := NewArtifactBucketFromMap(map[string]string{})
artifactPVC, _ := NewArtifactPVCFromMap(map[string]string{})
metrics, _ := NewMetricsFromMap(map[string]string{})
metrics, _ := newMetricsFromMap(map[string]string{})
return &Config{
Defaults: defaults,
FeatureFlags: featureFlags,
Expand Down Expand Up @@ -121,7 +121,7 @@ func (s *Store) Load() *Config {

metrics := s.UntypedLoad(GetMetricsConfigName())
if metrics == nil {
metrics, _ = NewMetricsFromMap(map[string]string{})
metrics, _ = newMetricsFromMap(map[string]string{})
}
return &Config{
Defaults: defaults.(*Defaults).DeepCopy(),
Expand Down

0 comments on commit 58b7fef

Please sign in to comment.