Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add spec.ordinals.start. #448

Merged
merged 44 commits into from
Dec 14, 2024
Merged
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
3d50513
feat: Add staringOrdinal
vimystic Nov 11, 2024
212e049
fix lint error
vimystic Nov 11, 2024
6c4f498
update build pods test to reflect startingordinals usage
vimystic Nov 12, 2024
8c55a1f
add retries for trivy to overcome the throttling
vimystic Nov 14, 2024
9dfdca0
Merge branch 'main' into vimystic/feat/445-add-starting-ordinals
vimystic Nov 18, 2024
62db355
Update: reorg so that we use a similar structure to stateful set inst…
vimystic Nov 19, 2024
b9ccbfa
optimize & use starting ordinal for pvcs too
vimystic Nov 20, 2024
804e076
Update to use starting ordinal in appropriate files
vimystic Nov 20, 2024
75dcd8a
Optimize tests
vimystic Nov 20, 2024
bfe1a51
fix test
vimystic Nov 20, 2024
e088656
fix test
vimystic Nov 20, 2024
0a52ff4
Use Ordinal within spec (duh))
vimystic Nov 20, 2024
91bded5
Remove redundant parameters
vimystic Nov 20, 2024
6bb42dd
Note: this is incorrect since PVC allocations start from 0, only the …
vimystic Nov 20, 2024
a8cc9e0
Attempt to find root cause of mapping issue crash
vimystic Nov 20, 2024
be87c7d
Adding spec.ordinal.start usage back to configmap_builder.go
vimystic Nov 20, 2024
e62a9a9
Adding spec.ordinal.start usage back to node_keybuilder.go
vimystic Nov 20, 2024
5905c9b
Adding spec.ordinal.start usage back to peer_collector.go
vimystic Nov 20, 2024
3b27cf1
Add spec.ordinal.start usage back to service_builder.go
vimystic Nov 20, 2024
65c1d33
service_builder.go
vimystic Nov 20, 2024
51747d4
Update pvc to use name from ordinals , but resource from 0
vimystic Nov 20, 2024
df5a242
revert previous commit
vimystic Nov 20, 2024
8be6661
Update pvc_contro.go to use ordinal start
vimystic Nov 20, 2024
dc23a15
name/label update
vimystic Nov 20, 2024
060d6cf
Attempting range check
vimystic Nov 20, 2024
4a11667
Revert previous
vimystic Nov 20, 2024
3c8739e
Update configmap , key peer and service builders to use correct ordin…
vimystic Nov 20, 2024
fcbcf8a
Merge branch 'main' into vimystic/feat/445-add-starting-ordinals
vimystic Nov 21, 2024
b124b07
Allow instanceoverrides for pvcs (example: changing storage) to wor…
vimystic Nov 27, 2024
ae29f8a
Use 'Ordinals' instead of 'Ordinals' as per review
vimystic Dec 3, 2024
212fd65
Update autogenerated yaml file with 'ordinals'
vimystic Dec 3, 2024
8a24b65
match the description for start with that of the stateful set
vimystic Dec 4, 2024
b1163e0
add happy path test with a non 0 starting ordinal
vimystic Dec 4, 2024
f27d4a3
add node keybuilder test
vimystic Dec 4, 2024
94afe93
test ofr peer collector
vimystic Dec 4, 2024
57019ed
pvc and service builder tests
vimystic Dec 4, 2024
e0afa9b
Ensure correct tags for goloang json
vimystic Dec 4, 2024
4595139
make for loops consistent across all builders
vimystic Dec 4, 2024
79e5c85
fix service builder loop. seperate index from ordinal name since both…
vimystic Dec 4, 2024
c8ba8ce
potential lint error fix (new lines between functions)
vimystic Dec 4, 2024
0bc73a8
remove unnecessary new line
vimystic Dec 4, 2024
ffdaafa
Merge branch 'main' into vimystic/feat/445-add-starting-ordinals
vimystic Dec 4, 2024
2749a79
Update the Ordinals description to match language similar to be simil…
vimystic Dec 5, 2024
1c27636
update with no starting ordinal defined. i.e: Default value 0
vimystic Dec 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Attempt to find root cause of mapping issue crash
  • Loading branch information
vimystic committed Nov 20, 2024
commit a8cc9e0b3711aa64df12bc425e25f06fc95de730
2 changes: 1 addition & 1 deletion internal/fullnode/configmap_builder.go
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ func BuildConfigMaps(crd *cosmosv1.CosmosFullNode, peers Peers) ([]diff.Resource
defer bufPool.Put(buf)
defer buf.Reset()

for i := crd.Spec.Ordinal.Start; i < crd.Spec.Ordinal.Start+crd.Spec.Replicas; i++ {
for i := int32(0); i < crd.Spec.Replicas; i++ {
data := make(map[string]string)
instance := instanceName(crd, i)
if err := addConfigToml(buf, data, crd, instance, peers); err != nil {
2 changes: 1 addition & 1 deletion internal/fullnode/node_key_builder.go
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ const nodeKeyFile = "node_key.json"
// Returns an error if a new node key cannot be serialized. (Should never happen.)
func BuildNodeKeySecrets(existing []*corev1.Secret, crd *cosmosv1.CosmosFullNode) ([]diff.Resource[*corev1.Secret], error) {
secrets := make([]diff.Resource[*corev1.Secret], crd.Spec.Replicas)
for i := crd.Spec.Ordinal.Start; i < crd.Spec.Ordinal.Start+crd.Spec.Replicas; i++ {
for i := int32(0); i < crd.Spec.Replicas; i++ {
var s corev1.Secret
s.Name = nodeKeySecretName(crd, i)
s.Namespace = crd.Namespace
2 changes: 1 addition & 1 deletion internal/fullnode/peer_collector.go
Original file line number Diff line number Diff line change
@@ -110,7 +110,7 @@ func (c PeerCollector) Collect(ctx context.Context, crd *cosmosv1.CosmosFullNode
if crd.Spec.Service.ClusterDomain != nil {
clusterDomain = *crd.Spec.Service.ClusterDomain
}
for i := crd.Spec.Ordinal.Start; i < crd.Spec.Ordinal.Start+crd.Spec.Replicas; i++ {
for i := int32(0); i < crd.Spec.Replicas; i++ {
secretName := nodeKeySecretName(crd, i)
var secret corev1.Secret
// Hoping the caching layer kubebuilder prevents API errors or rate limits. Simplifies logic to use a Get here
2 changes: 1 addition & 1 deletion internal/fullnode/service_builder.go
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ func BuildServices(crd *cosmosv1.CosmosFullNode) []diff.Resource[*corev1.Service
maxExternal := lo.Clamp(max, 0, crd.Spec.Replicas)
p2ps := make([]diff.Resource[*corev1.Service], crd.Spec.Replicas)

for i := crd.Spec.Ordinal.Start; i < crd.Spec.Ordinal.Start+crd.Spec.Replicas; i++ {
for i := int32(0); i < crd.Spec.Replicas; i++ {
ordinal := i
var svc corev1.Service
svc.Name = p2pServiceName(crd, ordinal)
Loading