This file contains hidden or 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
| ############################################################ | |
| # ____ _____ ____ _ _____ __ | |
| # | _ \| ____| _ \| | / _ \ \ / / | |
| # | | | | _| | |_) | | | | | \ V / | |
| # | |_| | |___| __/| |__| |_| || | | |
| # |____/|_____|_| |_____\___/ |_| | |
| # | |
| ############################################################ | |
| # Deploy without cloning the repo. |
This file contains hidden or 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
| #!/bin/bash | |
| # Fetch PolygonScan zkEVM batch data. | |
| # $ ./fetch_polygonscan.sh mainnet 2130013 | |
| # { | |
| # "batchNumber": "2130013", | |
| # "status": "Finalized", | |
| # "verifyTimestamp": "2 hrs ago (Oct-07-2024 01:49:01 PM +UTC)", | |
| # "verifyBlockNumber": "20914452", | |
| # "verifyBatchTxHash": "0x34558961cd0f54d5d028e586d932a7799369f3c5074235f9d123dea85644c026", |
This file contains hidden or 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
| #!/bin/bash | |
| # Fetch batch data from multiple RPC endpoints. | |
| usage() { | |
| echo "Usage: $0 <network> <batch_number>" | |
| echo " network: 'mainnet' or 'cardona'" | |
| echo " batch_number: the batch number to query" | |
| echo | |
| echo "Example: $0 mainnet 2130013" | |
| echo " $0 cardona 1000000" |
This file contains hidden or 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
| Context("When deleting a pod with the same name as one of the Foo custom resourcess' friends", func() { | |
| It("Should update the status of the first Foo custom resource", func() { | |
| By("Deleting the pod") | |
| ctx := context.Background() | |
| pod := corev1.Pod{ | |
| ObjectMeta: metav1.ObjectMeta{ | |
| Name: foo1Friend, | |
| Namespace: namespace, | |
| }, | |
| } |
This file contains hidden or 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
| Context("When updating the name of a Foo custom resource's friend", func() { | |
| It("Should update the status of the Foo custom resource", func() { | |
| By("Getting the second Foo custom resource") | |
| ctx := context.Background() | |
| var foo2 tutorialv1.Foo | |
| foo2Request := types.NamespacedName{ | |
| Name: foo2Name, | |
| Namespace: namespace, | |
| } | |
| Expect(k8sClient.Get(ctx, foo2Request, &foo2)).To(Succeed()) |
This file contains hidden or 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
| Context("When creating a pod with the same name as one of the Foo custom resources' friends", func() { | |
| It("Should update the status of the first Foo custom resource", func() { | |
| By("Creating the pod") | |
| ctx := context.Background() | |
| pod := corev1.Pod{ | |
| ObjectMeta: metav1.ObjectMeta{ | |
| Name: foo1Friend, | |
| Namespace: namespace, | |
| }, | |
| Spec: corev1.PodSpec{ |
This file contains hidden or 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
| package controllers | |
| import ( | |
| "context" | |
| . "github.com/onsi/ginkgo" | |
| . "github.com/onsi/gomega" | |
| corev1 "k8s.io/api/core/v1" | |
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
This file contains hidden or 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
| package controller | |
| import ( | |
| "context" | |
| "fmt" | |
| "path/filepath" | |
| "runtime" | |
| "testing" | |
| ctrl "sigs.k8s.io/controller-runtime" |
This file contains hidden or 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
| package color | |
| import ( | |
| "strings" | |
| "testing" | |
| ) | |
| func TestConvertStrToColor(t *testing.T) { | |
| type test struct { | |
| name string |
This file contains hidden or 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
| package color | |
| import ( | |
| "crypto/md5" | |
| "encoding/hex" | |
| "strconv" | |
| ) | |
| // Convert a string to one of the 12 colors of the color wheel. | |
| func ConvertStrToColor(s string) string { |
NewerOlder