-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor internal package organization (#839)
Problem: After the merge of the provisioner-mode code into the main branch, our codebase now consists of three distinct components or groups: provisioner-mode, static-mode, and framework. However, our current internal package structure does not align with these components. Solution: Align the internal package structure with our three main components by introducing the following internal packages: - framework: code shared between provisioner and static modes - mode/provisioner: all code related to provisioner-mode - mode/static: all code related to static mode In addition, some packages were refactored/split so the framework package would not have any dependencies on the mode/static package.
- Loading branch information
1 parent
d650268
commit e065469
Showing
168 changed files
with
915 additions
and
828 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package conditions | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"sigs.k8s.io/gateway-api/apis/v1beta1" | ||
) | ||
|
||
const ( | ||
// GatewayClassReasonGatewayClassConflict indicates there are multiple GatewayClass resources | ||
// that reference this controller, and we ignored the resource in question and picked the | ||
// GatewayClass that is referenced in the command-line argument. | ||
// This reason is used with GatewayClassConditionAccepted (false). | ||
GatewayClassReasonGatewayClassConflict v1beta1.GatewayClassConditionReason = "GatewayClassConflict" | ||
|
||
// GatewayClassMessageGatewayClassConflict is a message that describes GatewayClassReasonGatewayClassConflict. | ||
GatewayClassMessageGatewayClassConflict = "The resource is ignored due to a conflicting GatewayClass resource" | ||
) | ||
|
||
// Condition defines a condition to be reported in the status of resources. | ||
type Condition struct { | ||
Type string | ||
Status metav1.ConditionStatus | ||
Reason string | ||
Message string | ||
} | ||
|
||
// NewDefaultGatewayClassConditions returns the default Conditions that must be present in the status of a GatewayClass. | ||
func NewDefaultGatewayClassConditions() []Condition { | ||
return []Condition{ | ||
{ | ||
Type: string(v1beta1.GatewayClassConditionStatusAccepted), | ||
Status: metav1.ConditionTrue, | ||
Reason: string(v1beta1.GatewayClassReasonAccepted), | ||
Message: "GatewayClass is accepted", | ||
}, | ||
} | ||
} | ||
|
||
// NewGatewayClassConflict returns a Condition that indicates that the GatewayClass is not accepted | ||
// due to a conflict with another GatewayClass. | ||
func NewGatewayClassConflict() Condition { | ||
return Condition{ | ||
Type: string(v1beta1.GatewayClassConditionStatusAccepted), | ||
Status: metav1.ConditionFalse, | ||
Reason: string(GatewayClassReasonGatewayClassConflict), | ||
Message: GatewayClassMessageGatewayClassConflict, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...controller/controllerfakes/fake_getter.go → ...controller/controllerfakes/fake_getter.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/* | ||
Package framework contains all the packages that are shared by the provisioner and static modes of the project. | ||
*/ | ||
package framework |
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
.../events/eventsfakes/fake_event_handler.go → .../events/eventsfakes/fake_event_handler.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...sfakes/fake_first_event_batch_preparer.go → ...sfakes/fake_first_event_batch_preparer.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
internal/events/eventsfakes/fake_reader.go → ...amework/events/eventsfakes/fake_reader.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package events | ||
|
||
import ( | ||
"context" | ||
) | ||
|
||
//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 . EventHandler | ||
|
||
// EventHandler handles events. | ||
type EventHandler interface { | ||
// HandleEventBatch handles a batch of events. | ||
// EventBatch can include duplicated events. | ||
HandleEventBatch(ctx context.Context, batch EventBatch) | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.