-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* set list filter func * fix output snapshot * remove incorrect warning * regen, fix chart labels * add marshaljson to snapshots * allow nil sets * snapshot sync only writes local resources * Add test builder for input snapshot. (#109) * Add test builder for input snapshot. * Input snapshot test builder (#110) * Add test builder for input snapshot. * colocate builder with snapshot * distinguish client from type import for k8s native resources * Merge branch 'upgrades2' into input-snapshot-test-builder * delete test builder template * explicitly add type import * gen code * sync -> syncLocalCluster * ref to objkey util * sync status multicluster * Merge branch 'master' into upgrades2 * Upgrades2 tweaks (#113) * Enable mockgen directive for snapshots * separate input snapshot test builder into separate template * output snapshot builder * rename to InputSnapshotManualBuilder * fix input snapshot manual builder file path * fix manual snapshot builder imports * dont silence error * variadic args * debug logs in output builder * add interface for builder * allow adding nil obj * multicluster writes are partitioned from local cluster writes * use interval and rate limit the number of events pushed to input reconciler queue * Merge branch 'master' into upgrades2 * support predicates on input reconciler * prevent insertion of nil objects into set * add output error handlers implementation * explicitly define clusters in snapshot * ch
- Loading branch information
Showing
34 changed files
with
1,606 additions
and
240 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
changelog: | ||
- type: NEW_FEATURE | ||
description: Input Reconciler - Add the ability to rate-limit reconciliations. | ||
issueLink: https://github.com/solo-io/skv2/issues/120 | ||
- type: NEW_FEATURE | ||
description: Input Reconciler - Add the ability to supply `predicate.Predicate`s to the reconciler's watch function. | ||
issueLink: https://github.com/solo-io/skv2/issues/121 | ||
- type: NEW_FEATURE | ||
description: Input Snapshot - Add the ability to sync input resource statuses across multiple clusters. | ||
issueLink: https://github.com/solo-io/skv2/issues/122 | ||
- type: NEW_FEATURE | ||
description: Input & Output Snapshot - Add a MarshalJSON function for debugging. | ||
issueLink: https://github.com/solo-io/skv2/issues/123 | ||
- type: NEW_FEATURE | ||
description: Input Snapshot - Add a builder for manually constructing input snapshots (to be used for testing). | ||
issueLink: https://github.com/solo-io/skv2/issues/124 | ||
- type: FIX | ||
description: Output Snapshot - Explicitly define desired clusters for multicluster snapshots. | ||
issueLink: https://github.com/solo-io/skv2/issues/125 | ||
- type: BREAKING_CHANGE | ||
description: Output Snapshot - Create separate Apply methods for Local Cluster and Multiple Clusters. | ||
issueLink: https://github.com/solo-io/skv2/issues/126 | ||
- type: NEW_FEATURE | ||
description: Output Snapshot - Add a builder for more conveniently constructing output snapshots. | ||
issueLink: https://github.com/solo-io/skv2/issues/127 | ||
- type: FIX | ||
description: Sets - now sets accept an `ezkube.ResourceId` for most methods. | ||
issueLink: https://github.com/solo-io/skv2/issues/128 | ||
- type: NEW_FEATURE | ||
description: Sets - now sets List function accepts a filter function. | ||
issueLink: https://github.com/solo-io/skv2/issues/129 | ||
- type: NEW_FEATURE | ||
description: Sets - now nil sets will not panic when calling methods (other than Insert). | ||
issueLink: https://github.com/solo-io/skv2/issues/130 | ||
- type: NEW_FEATURE | ||
description: Ezkube - Add util method `MakeClientObjectKey` for creating `client.ObjectKey`s. | ||
issueLink: https://github.com/solo-io/skv2/issues/131 |
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,33 @@ | ||
package render | ||
|
||
import ( | ||
"fmt" | ||
"path/filepath" | ||
"regexp" | ||
"strings" | ||
) | ||
|
||
func PrependMockgenDirective(files []OutFile) { | ||
// prepend each .go file with a go:generate directive to run mockgen on the file | ||
for i, file := range files { | ||
if !strings.HasSuffix(file.Path, ".go") { | ||
continue | ||
} | ||
// only add the directive if the file contains interfaces | ||
if !containsInterface(file.Content) { | ||
continue | ||
} | ||
|
||
baseFile := filepath.Base(file.Path) | ||
mockgenComment := fmt.Sprintf("//go:generate mockgen -source ./%v -destination mocks/%v", baseFile, baseFile) | ||
|
||
file.Content = fmt.Sprintf("%v\n\n%v", mockgenComment, file.Content) | ||
files[i] = file | ||
} | ||
} | ||
|
||
var interfaceRegex = regexp.MustCompile("type .* interface") | ||
|
||
func containsInterface(content string) bool { | ||
return interfaceRegex.MatchString(content) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.