repo_name
stringlengths
1
52
repo_creator
stringclasses
6 values
programming_language
stringclasses
4 values
code
stringlengths
0
9.68M
num_lines
int64
1
234k
eks-anywhere
aws
Go
package flux_test import ( "context" "errors" "os" "path" "testing" "github.com/golang/mock/gomock" . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/aws/eks-anywhere/internal/test" "github.com/aws/eks-anywhere/pkg/api/v1alpha1" "github.com/aws/eks-anywhere/pkg/cluster" ...
1,082
eks-anywhere
aws
Go
package flux import ( "context" "github.com/aws/eks-anywhere/pkg/git" gitFactory "github.com/aws/eks-anywhere/pkg/git/factory" "github.com/aws/eks-anywhere/pkg/retrier" ) type gitClient struct { git git.Client gitProvider git.ProviderClient *retrier.Retrier } func newGitClient(gitTools *gitFactory.Gi...
113
eks-anywhere
aws
Go
package flux import ( "context" "errors" "testing" "github.com/golang/mock/gomock" . "github.com/onsi/gomega" "github.com/aws/eks-anywhere/pkg/git" gitFactory "github.com/aws/eks-anywhere/pkg/git/factory" "github.com/aws/eks-anywhere/pkg/git/mocks" "github.com/aws/eks-anywhere/pkg/retrier" ) type gitClient...
242
eks-anywhere
aws
Go
package flux import ( "context" "fmt" "github.com/aws/eks-anywhere/pkg/cluster" "github.com/aws/eks-anywhere/pkg/logger" "github.com/aws/eks-anywhere/pkg/types" ) const upgradeFluxconfigCommitMessage = "Upgrade commit of flux configuration; generated by EKS-A CLI" func (f *Flux) Upgrade(ctx context.Context, ma...
120
eks-anywhere
aws
Go
package flux_test import ( "context" "errors" "fmt" "os" "testing" . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/aws/eks-anywhere/internal/test" "github.com/aws/eks-anywhere/pkg/api/v1alpha1" "github.com/aws/eks-anywhere/pkg/cluster" "github.com/aws/eks-anywhere/pkg/...
258
eks-anywhere
aws
Go
// Code generated by MockGen. DO NOT EDIT. // Source: github.com/aws/eks-anywhere/pkg/gitops/flux (interfaces: FluxClient,KubeClient,GitOpsFluxClient,GitClient,Templater) // Package mocks is a generated GoMock package. package mocks import ( context "context" reflect "reflect" v1alpha1 "github.com/aws/eks-anywher...
561
eks-anywhere
aws
Go
package govmomi import ( "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/vim25" ) type vMOMIAuthorizationManagerBuilder struct{} func (*vMOMIAuthorizationManagerBuilder) Build(c *vim25.Client) *object.AuthorizationManager { return object.NewAuthorizationManager(c) }
13
eks-anywhere
aws
Go
package govmomi import ( "context" "github.com/vmware/govmomi" "github.com/vmware/govmomi/find" "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/vim25/types" ) const ( VSphereTypeFolder = "Folder" VSphereTypeNetwork = "Network" VSphereTypeResourcePool = "ResourcePool" VSphereTy...
134
eks-anywhere
aws
Go
package govmomi import ( "context" "net/url" "github.com/vmware/govmomi" "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/vim25" "github.com/vmware/govmomi/vim25/soap" ) type VSphereClient interface { Username() string GetPrivsOnEntity(ctx context.Context, path string, objType string, username s...
70
eks-anywhere
aws
Go
package govmomi_test import ( "context" "fmt" "reflect" "testing" "github.com/golang/mock/gomock" . "github.com/onsi/gomega" govmomi_internal "github.com/vmware/govmomi" "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/vim25" "github.com/vmware/govmomi/vim25/types" "github.com/aws/eks-anywher...
220
eks-anywhere
aws
Go
package govmomi import ( "github.com/vmware/govmomi/find" "github.com/vmware/govmomi/vim25" ) type vMOMIFinderBuilder struct{} func NewVMOMIFinderBuilder() *vMOMIFinderBuilder { return &vMOMIFinderBuilder{} } func (*vMOMIFinderBuilder) Build(client *vim25.Client, all ...bool) VMOMIFinder { return find.NewFinder...
17
eks-anywhere
aws
Go
package govmomi import ( "context" "net/url" "github.com/vmware/govmomi" ) type vMOMISessionBuilder struct{} func NewvMOMISessionBuilder() *vMOMIClientBuilder { return &vMOMIClientBuilder{} } func (*vMOMISessionBuilder) Build(ctx context.Context, u *url.URL, insecure bool) (*govmomi.Client, error) { return go...
19
eks-anywhere
aws
Go
// Code generated by MockGen. DO NOT EDIT. // Source: github.com/aws/eks-anywhere/pkg/govmomi (interfaces: VSphereClient,VMOMIAuthorizationManager,VMOMIFinder,VMOMISessionBuilder,VMOMIFinderBuilder,VMOMIAuthorizationManagerBuilder) // Package mocks is a generated GoMock package. package mocks import ( context "conte...
354
eks-anywhere
aws
Go
package helm import ( "context" "fmt" "sort" "github.com/aws/eks-anywhere/pkg/logger" "github.com/aws/eks-anywhere/pkg/types" "github.com/aws/eks-anywhere/pkg/utils/oci" ) type Client interface { RegistryLogin(ctx context.Context, registry, username, password string) error PushChart(ctx context.Context, char...
49
eks-anywhere
aws
Go
package helm_test import ( "context" "errors" "testing" "github.com/golang/mock/gomock" . "github.com/onsi/gomega" "github.com/aws/eks-anywhere/pkg/helm" "github.com/aws/eks-anywhere/pkg/helm/mocks" ) func TestChartRegistryDownloaderDownload(t *testing.T) { g := NewWithT(t) charts := []string{"ecr.com/char...
42
eks-anywhere
aws
Go
package helm import ( "path/filepath" "strings" ) func ChartFileName(chart string) string { return strings.Replace(filepath.Base(chart), ":", "-", 1) + ".tgz" }
11
eks-anywhere
aws
Go
package helm_test import ( "testing" . "github.com/onsi/gomega" "github.com/aws/eks-anywhere/pkg/helm" ) func TestChartFileName(t *testing.T) { tests := []struct { name string chart string want string }{ { name: "full path", chart: "ecr.com/folder/folder2/chart-name:1.0.0", want: "chart-na...
30
eks-anywhere
aws
Go
package helm import ( "context" "fmt" "path/filepath" "github.com/aws/eks-anywhere/pkg/utils/oci" "github.com/aws/eks-anywhere/pkg/utils/urls" ) type ChartRegistryImporter struct { client Client registry string username, password string srcFolder string } func NewChartRegistr...
46
eks-anywhere
aws
Go
package helm_test import ( "context" "errors" "testing" "github.com/golang/mock/gomock" . "github.com/onsi/gomega" "github.com/aws/eks-anywhere/pkg/helm" "github.com/aws/eks-anywhere/pkg/helm/mocks" ) func TestChartRegistryImporterImport(t *testing.T) { g := NewWithT(t) ctx := context.Background() user :=...
68
eks-anywhere
aws
Go
// Code generated by MockGen. DO NOT EDIT. // Source: pkg/helm/download.go // Package mocks is a generated GoMock package. package mocks import ( context "context" reflect "reflect" gomock "github.com/golang/mock/gomock" ) // MockClient is a mock of Client interface. type MockClient struct { ctrl *gomock.Co...
78
eks-anywhere
aws
Go
package kubeconfig import "fmt" // FormatWorkloadClusterKubeconfigFilename returns a filename for the Kubeconfig of workload // clusters. The filename does not include a basepath. func FormatWorkloadClusterKubeconfigFilename(clusterName string) string { return fmt.Sprintf("%s-eks-a-cluster.kubeconfig", clusterName) ...
10
eks-anywhere
aws
Go
package kubeconfig import ( "fmt" "io/fs" "os" "path/filepath" "strings" "k8s.io/client-go/tools/clientcmd" "github.com/aws/eks-anywhere/pkg/validations" ) // FromClusterFormat defines the format of the kubeconfig of the. const FromClusterFormat = "%s-eks-a-cluster.kubeconfig" // EnvName is the standard Kub...
128
eks-anywhere
aws
Go
package kubeconfig_test import ( "bytes" "io/fs" "path/filepath" "testing" "github.com/stretchr/testify/assert" "github.com/aws/eks-anywhere/internal/test" "github.com/aws/eks-anywhere/pkg/kubeconfig" ) var kindTypo = []byte(`apiVersion: v1\nkind: Conf`) var goodKubeconfig = []byte(` apiVersion: v1 clusters...
188
eks-anywhere
aws
Go
/* Package logger implements a simple way to init a global logger and access it through a logr.Logger interface. Message: All messages should start with a capital letter. Log level: The loggers only support verbosity levels (V-levels) instead of semantic levels. Level zero, the default, is important for the end use...
43
eks-anywhere
aws
Go
package logger import ( "fmt" "os" "time" "github.com/go-logr/zapr" "go.uber.org/zap" "go.uber.org/zap/zapcore" ) // Init initializes the package logger. Repeat calls will overwrite the package logger which may // result in unexpected behavior. func Init(opts Options) error { encoderCfg := zap.NewDevelopmentE...
82
eks-anywhere
aws
Go
package logger_test import ( "bytes" "io" "os" "path/filepath" "testing" "github.com/aws/eks-anywhere/pkg/logger" ) func TestInit(t *testing.T) { tdir := t.TempDir() defer os.RemoveAll(tdir) logFile := filepath.Join(tdir, "test.log") err := logger.Init(logger.Options{ OutputFilePath: logFile, }) if e...
46
eks-anywhere
aws
Go
package logger import "sync" // This source file uses package state to configure output file paths for the bundle to retrieve. // The relationship between the 2 components is undesirable and will be refactored to pass the // path to bundle generation code explicitly. // // Please avoid using the GetOutputFilePath() f...
31
eks-anywhere
aws
Go
package manifests import ( "context" "fmt" eksdv1 "github.com/aws/eks-distro-build-tooling/release/api/v1alpha1" "github.com/aws/eks-anywhere/pkg/manifests/bundles" "github.com/aws/eks-anywhere/pkg/manifests/releases" releasev1 "github.com/aws/eks-anywhere/release/api/v1alpha1" ) type FileReader interface { ...
99
eks-anywhere
aws
Go
package manifests_test import ( "testing" "github.com/golang/mock/gomock" . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/aws/eks-anywhere/internal/test/mocks" "github.com/aws/eks-anywhere/pkg/manifests" "github.com/aws/eks-anywhere/pkg/manifests/releases" releasev1 "gith...
215
eks-anywhere
aws
Go
package bundles import releasev1 "github.com/aws/eks-anywhere/release/api/v1alpha1" func Charts(bundles *releasev1.Bundles) []releasev1.Image { var charts []releasev1.Image for _, v := range bundles.Spec.VersionsBundles { versionsBundleCharts := v.Charts() for _, c := range versionsBundleCharts { charts = ap...
16
eks-anywhere
aws
Go
package bundles_test import ( "testing" . "github.com/onsi/gomega" "github.com/aws/eks-anywhere/pkg/manifests/bundles" releasev1 "github.com/aws/eks-anywhere/release/api/v1alpha1" ) func TestCharts(t *testing.T) { g := NewWithT(t) b := &releasev1.Bundles{ Spec: releasev1.BundlesSpec{ VersionsBundles: []r...
25
eks-anywhere
aws
Go
package bundles import ( "fmt" "github.com/aws/eks-anywhere/pkg/manifests/eksd" releasev1 "github.com/aws/eks-anywhere/release/api/v1alpha1" ) func ReadImages(reader Reader, bundles *releasev1.Bundles) ([]releasev1.Image, error) { var images []releasev1.Image for _, v := range bundles.Spec.VersionsBundles { i...
34
eks-anywhere
aws
Go
package bundles_test import ( "errors" "testing" "github.com/golang/mock/gomock" . "github.com/onsi/gomega" "github.com/aws/eks-anywhere/internal/test/mocks" "github.com/aws/eks-anywhere/pkg/manifests/bundles" releasev1 "github.com/aws/eks-anywhere/release/api/v1alpha1" ) var eksdManifest = `apiVersion: dist...
117
eks-anywhere
aws
Go
package bundles import ( "path/filepath" "github.com/pkg/errors" releasev1 "github.com/aws/eks-anywhere/release/api/v1alpha1" ) // Manifest holds the data of a manifest referenced in the Bundles. type Manifest struct { Filename string Content []byte } // ReadManifest reads the content of a [releasev1.Manifes...
29
eks-anywhere
aws
Go
package bundles import ( "fmt" eksdv1 "github.com/aws/eks-distro-build-tooling/release/api/v1alpha1" "sigs.k8s.io/yaml" "github.com/aws/eks-anywhere/pkg/logger" "github.com/aws/eks-anywhere/pkg/manifests/eksd" releasev1 "github.com/aws/eks-anywhere/release/api/v1alpha1" ) type Reader interface { ReadFile(url...
36
eks-anywhere
aws
Go
package bundles_test import ( "errors" "testing" "github.com/golang/mock/gomock" . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/aws/eks-anywhere/internal/test/mocks" "github.com/aws/eks-anywhere/pkg/manifests/bundles" releasev1 "github.com/aws/eks-anywhere/release/api/v1...
70
eks-anywhere
aws
Go
package bundles import ( releasev1 "github.com/aws/eks-anywhere/release/api/v1alpha1" ) func VersionsBundleForKubernetesVersion(bundles *releasev1.Bundles, kubeVersion string) *releasev1.VersionsBundle { for _, versionsBundle := range bundles.Spec.VersionsBundles { if versionsBundle.KubeVersion == kubeVersion { ...
15
eks-anywhere
aws
Go
package bundles_test import ( "testing" . "github.com/onsi/gomega" "github.com/aws/eks-anywhere/pkg/manifests/bundles" releasev1 "github.com/aws/eks-anywhere/release/api/v1alpha1" ) func TestVersionsBundleForKubernetesVersion(t *testing.T) { versionsBundle121 := releasev1.VersionsBundle{KubeVersion: "1.21"} v...
46
eks-anywhere
aws
Go
package eksd import ( eksdv1 "github.com/aws/eks-distro-build-tooling/release/api/v1alpha1" ) func Images(release *eksdv1.Release) []eksdv1.Asset { images := []eksdv1.Asset{} for _, component := range release.Status.Components { for _, asset := range component.Assets { if asset.Image != nil { images = app...
18
eks-anywhere
aws
Go
package eksd_test import ( "testing" eksdv1 "github.com/aws/eks-distro-build-tooling/release/api/v1alpha1" . "github.com/onsi/gomega" "github.com/aws/eks-anywhere/pkg/manifests/eksd" ) func TestImages(t *testing.T) { g := NewWithT(t) image1 := eksdv1.Asset{Name: "image1", Image: &eksdv1.AssetImage{}} image2...
38
eks-anywhere
aws
Go
package eksd import ( "fmt" eksdv1 "github.com/aws/eks-distro-build-tooling/release/api/v1alpha1" "sigs.k8s.io/yaml" ) type Reader interface { ReadFile(url string) ([]byte, error) } func ReadManifest(reader Reader, url string) (*eksdv1.Release, error) { content, err := reader.ReadFile(url) if err != nil { r...
27
eks-anywhere
aws
Go
package eksd_test import ( "errors" "testing" eksdv1 "github.com/aws/eks-distro-build-tooling/release/api/v1alpha1" "github.com/golang/mock/gomock" . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/aws/eks-anywhere/internal/test/mocks" "github.com/aws/eks-anywhere/pkg/manif...
70
eks-anywhere
aws
Go
package releases import ( "fmt" "github.com/pkg/errors" "sigs.k8s.io/yaml" "github.com/aws/eks-anywhere/pkg/manifests/bundles" "github.com/aws/eks-anywhere/pkg/semver" releasev1 "github.com/aws/eks-anywhere/release/api/v1alpha1" ) // manifestURL holds the url to the eksa releases manifest // this is injected ...
71
eks-anywhere
aws
Go
package releases_test import ( "errors" "testing" "github.com/golang/mock/gomock" . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/aws/eks-anywhere/internal/test/mocks" "github.com/aws/eks-anywhere/pkg/manifests/releases" releasev1 "github.com/aws/eks-anywhere/release/api/...
166
eks-anywhere
aws
Go
package cilium import ( "github.com/aws/eks-anywhere/pkg/constants" ) const namespace = constants.KubeSystemNamespace // InstallUpgradeTemplater is the composition of InstallTemplater and UpgradeTemplater. type InstallUpgradeTemplater interface { InstallTemplater UpgradeTemplater } // Cilium allows to install an...
28
eks-anywhere
aws
Go
package cilium_test import ( "context" "testing" "github.com/golang/mock/gomock" . "github.com/onsi/gomega" "github.com/aws/eks-anywhere/internal/test" v1alpha12 "github.com/aws/eks-anywhere/pkg/api/v1alpha1" "github.com/aws/eks-anywhere/pkg/cluster" "github.com/aws/eks-anywhere/pkg/networking/cilium/mocks" ...
63
eks-anywhere
aws
Go
package cilium import ( "context" "time" v1 "k8s.io/api/apps/v1" "github.com/aws/eks-anywhere/pkg/retrier" "github.com/aws/eks-anywhere/pkg/types" ) const ( // DaemonSetName is the default name for the Cilium DS installed in EKS-A clusters. DaemonSetName = "cilium" // PreflightDaemonSetName is the default n...
194
eks-anywhere
aws
Go
package cilium_test import ( "context" "errors" "testing" "github.com/golang/mock/gomock" . "github.com/onsi/gomega" v1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/aws/eks-anywhere/pkg/networking/cilium" "github.com/aws/eks-anywhere/pkg/networking/cilium/mocks" "github.co...
213
eks-anywhere
aws
Go
package cilium import "github.com/aws/eks-anywhere/pkg/cluster" // Config defines a Cilium installation for an EKS-A cluster. type Config struct { // AllowedNamespaces defines k8s namespaces from/which traffic is allowed // when PolicyEnforcementMode is Always. For other values of PolicyEnforcementMode // it is ig...
18
eks-anywhere
aws
Go
package cilium import ( "context" "strings" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" "github.com/aws/eks-anywhere/pkg/constants" ) const ( ciliumConfigMapName = "ciliu...
108
eks-anywhere
aws
Go
package cilium_test import ( "testing" . "github.com/onsi/gomega" appsv1 "k8s.io/api/apps/v1" v1 "k8s.io/api/core/v1" "github.com/aws/eks-anywhere/pkg/networking/cilium" ) func TestInstallationInstalled(t *testing.T) { tests := []struct { name string installation cilium.Installation want ...
82
eks-anywhere
aws
Go
package cilium import ( "context" "fmt" "github.com/aws/eks-anywhere/pkg/cluster" "github.com/aws/eks-anywhere/pkg/types" ) // InstallerForSpec allows to configure Cilium for a particular EKS-A cluster // It's a stateful version of installer, with a fixed Cilium config. type InstallerForSpec struct { installer ...
66
eks-anywhere
aws
Go
package cilium_test import ( "errors" "testing" "github.com/golang/mock/gomock" . "github.com/onsi/gomega" "github.com/aws/eks-anywhere/pkg/networking/cilium" ) func TestInstallerInstallErrorGeneratingManifest(t *testing.T) { tt := newCiliumTest(t) installer := cilium.NewInstaller(tt.client, tt.installTempla...
76
eks-anywhere
aws
Go
package cilium import ( "fmt" v1 "k8s.io/api/apps/v1" ) func CheckDaemonSetReady(daemonSet *v1.DaemonSet) error { if err := checkDaemonSetObservedGeneration(daemonSet); err != nil { return err } if daemonSet.Status.DesiredNumberScheduled != daemonSet.Status.NumberReady { return fmt.Errorf("daemonSet %s is ...
64
eks-anywhere
aws
Go
package cilium import ( "errors" "testing" . "github.com/onsi/gomega" v1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func TestCheckDaemonSetReady(t *testing.T) { tests := []struct { name string daemonSet *v1.DaemonSet wantErr error }{ { name: "old status", daemonS...
242
eks-anywhere
aws
Go
package cilium import ( "context" _ "embed" "fmt" "net" "strings" "time" anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1" "github.com/aws/eks-anywhere/pkg/cluster" "github.com/aws/eks-anywhere/pkg/config" "github.com/aws/eks-anywhere/pkg/retrier" "github.com/aws/eks-anywhere/pkg/semver" "github.c...
256
eks-anywhere
aws
Go
package cilium_test import ( "context" "encoding/json" "errors" "fmt" "os" "reflect" "testing" "github.com/golang/mock/gomock" . "github.com/onsi/gomega" "github.com/aws/eks-anywhere/internal/test" "github.com/aws/eks-anywhere/pkg/api/v1alpha1" "github.com/aws/eks-anywhere/pkg/cluster" "github.com/aws/e...
462
eks-anywhere
aws
Go
package cilium import ( "context" "fmt" "github.com/aws/eks-anywhere/pkg/api/v1alpha1" "github.com/aws/eks-anywhere/pkg/cluster" "github.com/aws/eks-anywhere/pkg/logger" "github.com/aws/eks-anywhere/pkg/semver" "github.com/aws/eks-anywhere/pkg/types" ) // KubernetesClient is a client to interact with the Kube...
195
eks-anywhere
aws
Go
package cilium_test import ( "context" "testing" "github.com/golang/mock/gomock" . "github.com/onsi/gomega" "github.com/aws/eks-anywhere/internal/test" "github.com/aws/eks-anywhere/pkg/api/v1alpha1" "github.com/aws/eks-anywhere/pkg/cluster" "github.com/aws/eks-anywhere/pkg/networking/cilium" "github.com/aws...
209
eks-anywhere
aws
Go
package cilium import ( "fmt" "strings" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" "github.com/aws/eks-anywhere/pkg/cluster" ) const ( // PolicyEnforcementConfigMapKey is the key used in the "cilium-config" ConfigMap to // store the value for the PolicyEnforcementMode. PolicyEnforcementConfigMa...
251
eks-anywhere
aws
Go
package cilium_test import ( "testing" . "github.com/onsi/gomega" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/aws/eks-anywhere/internal/test" anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1" "github.com/aws/eks-anywhere/pkg/cluste...
872
eks-anywhere
aws
Go
// Code generated by MockGen. DO NOT EDIT. // Source: pkg/networking/cilium/client.go // Package mocks is a generated GoMock package. package mocks import ( context "context" reflect "reflect" types "github.com/aws/eks-anywhere/pkg/types" gomock "github.com/golang/mock/gomock" v1 "k8s.io/api/apps/v1" ) // Mock...
110
eks-anywhere
aws
Go
// Code generated by MockGen. DO NOT EDIT. // Source: pkg/networking/cilium/templater.go // Package mocks is a generated GoMock package. package mocks import ( context "context" reflect "reflect" gomock "github.com/golang/mock/gomock" ) // MockHelm is a mock of Helm interface. type MockHelm struct { ctrl *g...
65
eks-anywhere
aws
Go
// Code generated by MockGen. DO NOT EDIT. // Source: pkg/networking/cilium/installer.go // Package mocks is a generated GoMock package. package mocks import ( context "context" reflect "reflect" cluster "github.com/aws/eks-anywhere/pkg/cluster" cilium "github.com/aws/eks-anywhere/pkg/networking/cilium" gomock ...
58
eks-anywhere
aws
Go
// Code generated by MockGen. DO NOT EDIT. // Source: pkg/networking/cilium/upgrader.go // Package mocks is a generated GoMock package. package mocks import ( context "context" reflect "reflect" cluster "github.com/aws/eks-anywhere/pkg/cluster" cilium "github.com/aws/eks-anywhere/pkg/networking/cilium" types "g...
195
eks-anywhere
aws
Go
package reconciler import ( "context" appsv1 "k8s.io/api/apps/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" "github.com/aws/eks-anywhere/pkg/constants" "github.com/aws/eks-anywhere/pkg/networking/cilium" ) type preflightInstalla...
71
eks-anywhere
aws
Go
package reconciler_test import ( "os" "testing" "github.com/aws/eks-anywhere/internal/test/envtest" ) var env *envtest.Environment func TestMain(m *testing.M) { os.Exit(envtest.RunWithEnvironment(m, envtest.WithAssignment(&env))) }
15
eks-anywhere
aws
Go
package reconciler import ( "context" "github.com/aws/eks-anywhere/pkg/api/v1alpha1" "github.com/aws/eks-anywhere/pkg/controller/clientutil" ) // EKSACiliumInstalledAnnotation indicates a cluster has previously been observed to have // EKS-A Cilium installed irrespective of whether its still installed. const EKSA...
28
eks-anywhere
aws
Go
package reconciler import ( "context" "fmt" "time" "github.com/go-logr/logr" "github.com/pkg/errors" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" anywherev1 "github.com/aws/eks-any...
263
eks-anywhere
aws
Go
package reconciler_test import ( "context" "errors" "testing" "time" "github.com/golang/mock/gomock" . "github.com/onsi/gomega" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/equality" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/...
861
eks-anywhere
aws
Go
// Code generated by MockGen. DO NOT EDIT. // Source: pkg/networking/cilium/reconciler/reconciler.go // Package mocks is a generated GoMock package. package mocks import ( context "context" reflect "reflect" cluster "github.com/aws/eks-anywhere/pkg/cluster" cilium "github.com/aws/eks-anywhere/pkg/networking/cili...
73
eks-anywhere
aws
Go
package kindnetd import ( "context" "fmt" "github.com/aws/eks-anywhere/pkg/cluster" "github.com/aws/eks-anywhere/pkg/manifests" "github.com/aws/eks-anywhere/pkg/types" ) // InstallerForSpec allows to configure kindnetd for a particular EKS-A cluster // It's a stateful version of installer, with a fixed Cilium c...
59
eks-anywhere
aws
Go
package kindnetd_test import ( "errors" "testing" . "github.com/onsi/gomega" "github.com/aws/eks-anywhere/internal/test" "github.com/aws/eks-anywhere/pkg/networking/kindnetd" ) func TestInstallerInstallErrorGeneratingManifest(t *testing.T) { tt := newKindnetdTest(t) tt.spec.VersionsBundle.Kindnetd.Manifest.U...
65
eks-anywhere
aws
Go
package kindnetd import ( "context" "github.com/aws/eks-anywhere/pkg/cluster" "github.com/aws/eks-anywhere/pkg/manifests" "github.com/aws/eks-anywhere/pkg/types" ) // Client allows to interact with the Kubernetes API. type Client interface { ApplyKubeSpecFromBytes(ctx context.Context, cluster *types.Cluster, da...
34
eks-anywhere
aws
Go
package kindnetd_test import ( "context" "testing" "github.com/golang/mock/gomock" . "github.com/onsi/gomega" "github.com/aws/eks-anywhere/internal/test" "github.com/aws/eks-anywhere/pkg/cluster" "github.com/aws/eks-anywhere/pkg/files" "github.com/aws/eks-anywhere/pkg/manifests" "github.com/aws/eks-anywhere...
67
eks-anywhere
aws
Go
package kindnetd import ( "errors" "fmt" "strings" appsv1 "k8s.io/api/apps/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "sigs.k8s.io/yaml" "github.com/aws/eks-anywhere/pkg/cluster" "github.com/aws/eks-anywhere/pkg/manifests" "github.com/aws/eks-anywhere/pkg/mani...
59
eks-anywhere
aws
Go
package kindnetd import ( "context" "fmt" "github.com/aws/eks-anywhere/pkg/cluster" "github.com/aws/eks-anywhere/pkg/logger" "github.com/aws/eks-anywhere/pkg/manifests" "github.com/aws/eks-anywhere/pkg/types" ) // Upgrader allows to upgrade a kindnetd installation in a EKS-A cluster. type Upgrader struct { cl...
64
eks-anywhere
aws
Go
package kindnetd_test import ( "context" "testing" . "github.com/onsi/gomega" "github.com/aws/eks-anywhere/internal/test" "github.com/aws/eks-anywhere/pkg/cluster" "github.com/aws/eks-anywhere/pkg/networking/kindnetd" "github.com/aws/eks-anywhere/pkg/types" ) type upgraderTest struct { *kindnetdTest ctx ...
73
eks-anywhere
aws
Go
// Code generated by MockGen. DO NOT EDIT. // Source: pkg/networking/kindnetd/kindnetd.go // Package mocks is a generated GoMock package. package mocks import ( context "context" reflect "reflect" types "github.com/aws/eks-anywhere/pkg/types" gomock "github.com/golang/mock/gomock" ) // MockClient is a mock of C...
51
eks-anywhere
aws
Go
package reconciler import ( "context" "github.com/go-logr/logr" "github.com/pkg/errors" "sigs.k8s.io/controller-runtime/pkg/client" "github.com/aws/eks-anywhere/pkg/cluster" "github.com/aws/eks-anywhere/pkg/controller" ) type CiliumReconciler interface { Reconcile(ctx context.Context, logger logr.Logger, cli...
39
eks-anywhere
aws
Go
package reconciler_test import ( "context" "testing" "github.com/golang/mock/gomock" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/client/fake" "github.com/aws/eks-anywhere/internal/test" "github.com/aws/eks-anywhere/pkg/api/v1alpha1" "github.com/aws/eks-anywhere/pkg/cluster" "github.com/aw...
56
eks-anywhere
aws
Go
// Code generated by MockGen. DO NOT EDIT. // Source: pkg/networking/reconciler/reconciler.go // Package mocks is a generated GoMock package. package mocks import ( context "context" reflect "reflect" cluster "github.com/aws/eks-anywhere/pkg/cluster" controller "github.com/aws/eks-anywhere/pkg/controller" logr ...
55
eks-anywhere
aws
Go
package networkutils import ( "fmt" "math/rand" "net" "time" ) type IPGenerator struct { netClient NetClient rand *rand.Rand } func NewIPGenerator(netClient NetClient) IPGenerator { return IPGenerator{ netClient: netClient, rand: rand.New(rand.NewSource(time.Now().UnixNano())), } } func (ipgen...
51
eks-anywhere
aws
Go
package networkutils_test import ( "errors" "net" "testing" "time" "github.com/aws/eks-anywhere/pkg/networkutils" ) type DummyNetClient struct{} func (n *DummyNetClient) DialTimeout(network, address string, timeout time.Duration) (net.Conn, error) { // add dummy case for coverage if address == "255.255.255.2...
31
eks-anywhere
aws
Go
package networkutils import ( "errors" "fmt" "os" "strings" ) type IPPool []string func NewIPPool() IPPool { return IPPool{} } func NewIPPoolFromString(fromString string) IPPool { return IPPool(strings.Split(fromString, ",")) } func NewIPPoolFromEnv(ipPoolEnvVar string) (IPPool, error) { value, ok := os.Loo...
62
eks-anywhere
aws
Go
package networkutils import ( "net" "time" ) type NetClient interface { DialTimeout(network, address string, timeout time.Duration) (net.Conn, error) } type DefaultNetClient struct{} func (n *DefaultNetClient) DialTimeout(network, address string, timeout time.Duration) (net.Conn, error) { return net.DialTimeout...
17
eks-anywhere
aws
Go
package networkutils import ( "errors" "fmt" "net" "strconv" "syscall" "time" ) func IsPortValid(port string) bool { p, err := strconv.Atoi(port) return err == nil && p >= 1 && p <= 65535 } func ValidateIP(ip string) error { if ip == "" { return fmt.Errorf("is required") } parsedIp := net.ParseIP(ip) i...
66
eks-anywhere
aws
Go
package networkutils_test import ( "errors" "net" "reflect" "syscall" "testing" "time" "github.com/golang/mock/gomock" "github.com/onsi/gomega" "github.com/aws/eks-anywhere/pkg/networkutils" "github.com/aws/eks-anywhere/pkg/networkutils/mocks" ) var ( validPorts = []string{"443", "8080", "32000"} inva...
157
eks-anywhere
aws
Go
// Code generated by MockGen. DO NOT EDIT. // Source: pkg/networkutils/netclient.go // Package mocks is a generated GoMock package. package mocks import ( net "net" reflect "reflect" time "time" gomock "github.com/golang/mock/gomock" ) // MockNetClient is a mock of NetClient interface. type MockNetClient struct...
52
eks-anywhere
aws
Go
package providers func ConfigsMapToSlice(c map[string]MachineConfig) []MachineConfig { configs := make([]MachineConfig, 0, len(c)) for _, config := range c { configs = append(configs, config) } return configs }
11
eks-anywhere
aws
Go
package providers import ( "fmt" ) const ( EtcdNodeNameSuffix = "etcd" ControlPlaneNodeNameSuffix = "cp" ) func GetControlPlaneNodeName(clusterName string) string { return fmt.Sprintf("%s-%s", clusterName, ControlPlaneNodeNameSuffix) } func GetEtcdNodeName(clusterName string) string { return fmt.Sprint...
19
eks-anywhere
aws
Go
package providers import ( "context" "github.com/aws/eks-anywhere/pkg/api/v1alpha1" "github.com/aws/eks-anywhere/pkg/bootstrapper" "github.com/aws/eks-anywhere/pkg/cluster" "github.com/aws/eks-anywhere/pkg/types" ) type Provider interface { Name() string SetupAndValidateCreateCluster(ctx context.Context, clus...
69
eks-anywhere
aws
Go
package cloudstack import ( "fmt" "sort" "strings" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" cloudstackv1 "sigs.k8s.io/cluster-api-provider-cloudstack/api/v1beta2" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "github.com/aws/eks-anywh...
114
eks-anywhere
aws
Go
package cloudstack_test import ( "fmt" "testing" . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" cloudstackv1 "sigs.k8s.io/cluster-api-provider-cloudstack/api/v1beta2" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "github.com/aws/eks-anywhere/pkg/api/v1alpha1" "...
187
eks-anywhere
aws
Go
package cloudstack import ( "context" _ "embed" "errors" "fmt" "net/url" "os" "strconv" etcdv1beta1 "github.com/aws/etcdadm-controller/api/v1beta1" "github.com/go-logr/logr" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" clusterv1 ...
993
eks-anywhere
aws
Go
package cloudstack import ( "context" "embed" _ "embed" "encoding/base64" "errors" "fmt" "os" "path" "testing" "time" etcdv1 "github.com/aws/etcdadm-controller/api/v1beta1" "github.com/golang/mock/gomock" . "github.com/onsi/gomega" "github.com/stretchr/testify/assert" v1 "k8s.io/api/core/v1" apierrors...
2,549
eks-anywhere
aws
Go
package cloudstack import ( "context" "time" "github.com/go-logr/logr" "github.com/pkg/errors" cloudstackv1 "sigs.k8s.io/cluster-api-provider-cloudstack/api/v1beta2" "github.com/aws/eks-anywhere/pkg/clients/kubernetes" "github.com/aws/eks-anywhere/pkg/cluster" "github.com/aws/eks-anywhere/pkg/clusterapi" ya...
109
eks-anywhere
aws
Go
package cloudstack import ( "context" "testing" . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" cloudstackv1 "sigs.k8s.io/cluster-api-provider-cloudstack/api/v1beta2" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/boots...
642
eks-anywhere
aws
Go
package cloudstack import ( "context" apiv1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/client" "github.com/aws/eks-anywhere/pkg/api/v1alpha1" "github.com/aws/eks-anywhere/pkg/collection" "github.com/aws/eks-anywhere/pkg/constants" "github.com/aws/eks-anywhere/pkg/providers/cloudstack/decoder" ) ...
44
eks-anywhere
aws
Go
package cloudstack import ( "context" "testing" . "github.com/onsi/gomega" apiv1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "sigs.k8s.io/controller-runtime/pkg/client/fake" anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1" "github.com/aws/eks...
131