Skip to content

Commit

Permalink
Rmove unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
kobayashi authored and tekton-robot committed Mar 1, 2021
1 parent 84a72d4 commit 4eb489a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 46 deletions.
17 changes: 0 additions & 17 deletions pkg/contexts/contexts.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,6 @@ package contexts

import "context"

// hdcnKey is used as the key for associating information
// with a context.Context.
type hdcnKey struct{}

// withDefaultConfigurationName notes on the context for nested validation
// that there is a default configuration name, which affects how an empty
// configurationName is validated.
func withDefaultConfigurationName(ctx context.Context) context.Context {
return context.WithValue(ctx, hdcnKey{}, struct{}{})
}

// hasDefaultConfigurationName checks to see whether the given context has
// been marked as having a default configurationName.
func hasDefaultConfigurationName(ctx context.Context) bool {
return ctx.Value(hdcnKey{}) != nil
}

// lemonadeKey is used as the key for associating information
// with a context.Context. This variable doesn't really matter, so it's
// a total random name (for history purpose, used lemonade as it was written
Expand Down
10 changes: 0 additions & 10 deletions pkg/contexts/contexts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,6 @@ func TestContexts(t *testing.T) {
check func(context.Context) bool
want bool
}{{
name: "has default config name",
ctx: withDefaultConfigurationName(ctx),
check: hasDefaultConfigurationName,
want: true,
}, {
name: "doesn't have default config name",
ctx: ctx,
check: hasDefaultConfigurationName,
want: false,
}, {
name: "are upgrading via defaulting",
ctx: WithUpgradeViaDefaulting(ctx),
check: IsUpgradeViaDefaulting,
Expand Down
19 changes: 0 additions & 19 deletions pkg/reconciler/events/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,22 +105,3 @@ func EmitError(c record.EventRecorder, err error, object runtime.Object) {
c.Event(object, corev1.EventTypeWarning, EventReasonError, err.Error())
}
}

// emitEvent emits an event for object if afterCondition is different from beforeCondition
//
// Status "ConditionUnknown":
// beforeCondition == nil, emit EventReasonStarted
// beforeCondition != nil, emit afterCondition.Reason
//
// Status "ConditionTrue": emit EventReasonSucceded
// Status "ConditionFalse": emit EventReasonFailed
// Deprecated: use Emit
func emitEvent(ctx context.Context, beforeCondition *apis.Condition, afterCondition *apis.Condition, object runtime.Object) {
Emit(ctx, beforeCondition, afterCondition, object)
}

// emitErrorEvent emits a failure associated to an error
// Deprecated: use EmitError instead
func emitErrorEvent(c record.EventRecorder, err error, object runtime.Object) {
EmitError(c, err, object)
}

0 comments on commit 4eb489a

Please sign in to comment.