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 | // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless req... | 116 |
eks-anywhere | aws | Go | package v1alpha1_test
import (
"testing"
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
)
func TestTinkerbellDatacenterValidateCreate(t *testing.T) {
dataCenterConfig := tinkerbellDatacenterConfig()
g := NewWithT(t)
g.Expect(dataCenter... | 84 |
eks-anywhere | aws | Go | package v1alpha1
import (
"fmt"
"os"
"strings"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/yaml"
)
const TinkerbellMachineConfigKind = "TinkerbellMachineConfig"
// +kubebuilder:object:generate=false
type TinkerbellMachineConfigGenerateOpt func(config *TinkerbellMachineConfigGenerate)
// Used fo... | 138 |
eks-anywhere | aws | Go | package v1alpha1
import (
"encoding/json"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// TinkerbellMachineConfigSpec defines the desired state of TinkerbellMachineConfig.
type TinkerbellMachineConfigS... | 164 |
eks-anywhere | aws | Go | package v1alpha1
import (
"testing"
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func TestTinkerbellMachineConfigValidateSucceed(t *testing.T) {
machineConfig := CreateTinkerbellMachineConfig()
g := NewWithT(t)
g.Expect(machineConfig.Validate()).To(Succeed())
}
func TestTinkerbe... | 110 |
eks-anywhere | aws | Go | // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless req... | 148 |
eks-anywhere | aws | Go | package v1alpha1_test
import (
"testing"
. "github.com/onsi/gomega"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
)
func TestTinkerbellMachineConfigValidateCreateSuccess(t *testing.T) {
machineConfig := v1alpha1.CreateTinkerbellMachineConfig()
g := NewWithT(t)
g.Expect(machineConfig.ValidateCreate()).To(Suc... | 180 |
eks-anywhere | aws | Go | package v1alpha1
import (
"fmt"
"os"
"strings"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/yaml"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1/thirdparty/tinkerbell"
"github.com/aws/eks-anywhere/release/api/v1alpha1"
)
const TinkerbellTemplateConfigKind = "TinkerbellTemplateConfig"
// +kubebu... | 90 |
eks-anywhere | aws | Go | package v1alpha1
import (
"fmt"
"strings"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1/thirdparty/tinkerbell"
"github.com/aws/eks-anywhere/release/api/v1alpha1"
)
const (
bottlerocketBootconfig = `kernel {}`
cloudInit = `datasource:
Ec2:
metadata_urls: [%s]
strict_id: false
manage_etc_hosts: localh... | 276 |
eks-anywhere | aws | Go | package v1alpha1
import (
"fmt"
"testing"
"github.com/google/go-cmp/cmp"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1/thirdparty/tinkerbell"
"github.com/aws/eks-anywhere/release/api/v1alpha1"
)
func TestWithDefaultActionsFromBundle(t *testing.T) {
vBundle := givenVersionBundle()
tinkerbellLocalIp := "127.0.... | 584 |
eks-anywhere | aws | Go | package v1alpha1
import (
"testing"
"github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1/thirdparty/tinkerbell"
)
func TestGetTinkerbellTemplateConfig(t *testing.T) {
tests := []struct {
testName string
fileName string
wantConfigs map[... | 175 |
eks-anywhere | aws | Go | package v1alpha1
import (
"fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/yaml"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1/thirdparty/tinkerbell"
)
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// Important: Run "make generate" ... | 92 |
eks-anywhere | aws | Go | package v1alpha1
import (
"fmt"
"k8s.io/apimachinery/pkg/util/version"
)
// SupportedMinorVersionIncrement represents the minor version skew for kubernetes version upgrades.
const SupportedMinorVersionIncrement = 1
// ValidateVersionSkew validates Kubernetes version skew between valid non-nil versions.
func Valid... | 29 |
eks-anywhere | aws | Go | package v1alpha1_test
import (
"fmt"
"reflect"
"testing"
"k8s.io/apimachinery/pkg/util/version"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
)
func TestValidateVersionSkew(t *testing.T) {
v122, _ := version.ParseGeneric(string(v1alpha1.Kube122))
v123, _ := version.ParseGeneric(string(v1alpha1.Kube123))
v1... | 58 |
eks-anywhere | aws | Go | package v1alpha1
// +kubebuilder:validation:Enum=fullClone;linkedClone
// CloneMode describes the clone mode to be used when cloning vSphere VMs.
type CloneMode string
const (
// FullClone indicates a VM will have no relationship to the source of the
// clone operation once the operation is complete. This is the s... | 20 |
eks-anywhere | aws | Go | package v1alpha1
import (
"fmt"
"path/filepath"
"strings"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/aws/eks-anywhere/pkg/logger"
)
const VSphereDatacenterKind = "VSphereDatacenterConfig"
type folderType string
const (
networkFolderType folderType = "network"
)
// Used for generating yaml fo... | 80 |
eks-anywhere | aws | Go | package v1alpha1
import (
"reflect"
"testing"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func TestGetVSphereDatacenterConfig(t *testing.T) {
tests := []struct {
testName string
fileName string
wantVSphereDatacenter *VSphereDatacenterConfig
wantErr bool
}{
{... | 132 |
eks-anywhere | aws | Go | package v1alpha1
import (
"errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/aws/eks-anywhere/pkg/logger"
)
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// VSphereDatacenterConfigSpec defines the desired state of VSphereDatacenterC... | 150 |
eks-anywhere | aws | Go | // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless req... | 158 |
eks-anywhere | aws | Go | package v1alpha1_test
import (
"testing"
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
)
func TestVSphereDatacenterValidateUpdateServerImmutable(t *testing.T) {
vOld := vsphereDatacenterConfig()
vOld.Spec.Server = "https://realOldServer... | 162 |
eks-anywhere | aws | Go | package v1alpha1
import (
"fmt"
"os"
"strings"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/yaml"
"github.com/aws/eks-anywhere/pkg/logger"
)
const (
VSphereMachineConfigKind = "VSphereMachineConfig"
DefaultVSphereDiskGiB = 25
DefaultVSphereNumCPUs = 2
DefaultVSphereMemoryMiB = 8192
D... | 135 |
eks-anywhere | aws | Go | package v1alpha1
import (
"reflect"
"testing"
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func TestGetVSphereMachineConfigs(t *testing.T) {
tests := []struct {
testName string
fileName string
wantVSphereMachineConfigs map[string]*VSphereMach... | 581 |
eks-anywhere | aws | Go | package v1alpha1
import (
"fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/aws/eks-anywhere/pkg/constants"
"github.com/aws/eks-anywhere/pkg/logger"
)
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// VSphereMachineConfigSpec defines ... | 203 |
eks-anywhere | aws | Go | package v1alpha1
import (
"fmt"
"reflect"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/validation/field"
ctrl "sigs.k8s.io/controller-runtime"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/webhook"
)
// log ... | 199 |
eks-anywhere | aws | Go | package v1alpha1_test
import (
"testing"
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
)
func TestManagementCPVSphereMachineValidateUpdateTemplateImmutable(t *testing.T) {
vOld := vsphereMachineConfig()
vOld.SetControlPlane()
vOld.Spec... | 760 |
eks-anywhere | aws | Go | //go:build !ignore_autogenerated
// +build !ignore_autogenerated
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
/... | 3,067 |
eks-anywhere | aws | Go | // Package represents https://pkg.go.dev/github.com/tinkerbell/tink@v0.6.0/workflow#pkg-types with json tags.
// +kubebuilder:object:generate=true
package tinkerbell
// Workflow represents a workflow to be executed.
type Workflow struct {
Version string `json:"version"`
Name string `json:"name"`
ID ... | 35 |
eks-anywhere | aws | Go | //go:build !ignore_autogenerated
// +build !ignore_autogenerated
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
/... | 121 |
eks-anywhere | aws | Go | package aws
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
)
// Client provides the single API client to make operations call to aws services.
type Client struct {
ec2 EC2Client
imds IMDSClient
snowballDevice SnowballDeviceClient
}
// Cl... | 99 |
eks-anywhere | aws | Go | package aws_test
import (
"context"
"testing"
. "github.com/onsi/gomega"
"github.com/aws/eks-anywhere/pkg/aws"
)
type awsTest struct {
*WithT
ctx context.Context
}
func newAwsTest(t *testing.T) *awsTest {
return &awsTest{
WithT: NewWithT(t),
ctx: context.Background(),
}
}
func TestLoadConfig(t *test... | 41 |
eks-anywhere | aws | Go | package aws
import (
"bufio"
"encoding/base64"
"errors"
"fmt"
"io"
"net"
"os"
"regexp"
"github.com/aws/eks-anywhere/pkg/validations"
)
const (
EksaAwsCredentialsFileKey = "EKSA_AWS_CREDENTIALS_FILE"
EksaAwsCABundlesFileKey = "EKSA_AWS_CA_BUNDLES_FILE"
)
func AwsCredentialsFile() (filePath string, err e... | 91 |
eks-anywhere | aws | Go | package aws_test
import (
"os"
"strings"
"testing"
. "github.com/onsi/gomega"
"github.com/aws/eks-anywhere/pkg/aws"
)
const (
credentialsFile = "testdata/valid_credentials"
certificatesFile = "testdata/valid_certificates"
)
func TestAwsCredentialsFile(t *testing.T) {
tt := newAwsTest(t)
t.Setenv(aws.Eksa... | 117 |
eks-anywhere | aws | Go | package aws
import (
"context"
"errors"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/ec2"
"github.com/aws/smithy-go"
)
// EC2Client is an ec2 client that wraps around the aws sdk ec2 client.
type EC2Client interface {
DescribeImages(ctx context.Context, params *ec2.DescribeIm... | 99 |
eks-anywhere | aws | Go | package aws_test
import (
"context"
"errors"
"testing"
"github.com/aws/aws-sdk-go-v2/service/ec2"
"github.com/aws/aws-sdk-go-v2/service/ec2/types"
"github.com/golang/mock/gomock"
. "github.com/onsi/gomega"
"github.com/aws/eks-anywhere/pkg/aws"
"github.com/aws/eks-anywhere/pkg/aws/mocks"
"github.com/aws/eks... | 161 |
eks-anywhere | aws | Go | package aws
import (
"context"
"errors"
"fmt"
"io"
"reflect"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/feature/ec2/imds"
)
// IMDSClient is an imds client that wraps around the aws sdk imds client.
type IMDSClient interface {
GetMetadata(ctx context.Context, params *imds.GetMetadataInp... | 58 |
eks-anywhere | aws | Go | package aws_test
import (
"context"
"errors"
"io"
"strings"
"testing"
awsv2 "github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/feature/ec2/imds"
"github.com/golang/mock/gomock"
. "github.com/onsi/gomega"
"github.com/aws/eks-anywhere/pkg/aws"
"github.com/aws/eks-anywhere/pkg/aws/mocks"
)
typ... | 80 |
eks-anywhere | aws | Go | package aws
import (
"bufio"
"context"
"fmt"
"os"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
)
const (
snowEC2Port = 8243
snowballDevicePort = 9092
)
func BuildClients(ctx context.Context) (Clients, error) {
credsFile, err := AwsCredentialsFile()
if err != nil {
retu... | 104 |
eks-anywhere | aws | Go | package aws
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/eks-anywhere/internal/aws-sdk-go-v2/service/snowballdevice"
"github.com/aws/eks-anywhere/internal/aws-sdk-go-v2/service/snowballdevice/types"
)
type SnowballDeviceClient interface {
DescribeDevice(ctx context.Context, para... | 37 |
eks-anywhere | aws | Go | package aws_test
import (
"context"
"errors"
"testing"
"github.com/golang/mock/gomock"
. "github.com/onsi/gomega"
"github.com/aws/eks-anywhere/internal/aws-sdk-go-v2/service/snowballdevice"
"github.com/aws/eks-anywhere/internal/aws-sdk-go-v2/service/snowballdevice/types"
"github.com/aws/eks-anywhere/pkg/aws"... | 89 |
eks-anywhere | aws | Go | package aws_test
import (
"context"
"testing"
. "github.com/onsi/gomega"
"github.com/aws/eks-anywhere/pkg/aws"
)
func TestLoadConfigWithSnow(t *testing.T) {
tests := []struct {
name string
certsFilePath string
wantErr string
}{
{
name: "validate certs",
certsFilePath: "te... | 102 |
eks-anywhere | aws | Go | // Code generated by MockGen. DO NOT EDIT.
// Source: pkg/aws/ec2.go
// Package mocks is a generated GoMock package.
package mocks
import (
context "context"
reflect "reflect"
ec2 "github.com/aws/aws-sdk-go-v2/service/ec2"
gomock "github.com/golang/mock/gomock"
)
// MockEC2Client is a mock of EC2Client interfac... | 117 |
eks-anywhere | aws | Go | // Code generated by MockGen. DO NOT EDIT.
// Source: pkg/aws/imds.go
// Package mocks is a generated GoMock package.
package mocks
import (
context "context"
reflect "reflect"
imds "github.com/aws/aws-sdk-go-v2/feature/ec2/imds"
gomock "github.com/golang/mock/gomock"
)
// MockIMDSClient is a mock of IMDSClient... | 57 |
eks-anywhere | aws | Go | // Code generated by MockGen. DO NOT EDIT.
// Source: pkg/aws/snowballdevice.go
// Package mocks is a generated GoMock package.
package mocks
import (
context "context"
reflect "reflect"
snowballdevice "github.com/aws/eks-anywhere/internal/aws-sdk-go-v2/service/snowballdevice"
gomock "github.com/golang/mock/gomo... | 77 |
eks-anywhere | aws | Go | package awsiamauth
import (
"context"
"encoding/base64"
"fmt"
"time"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/aws/eks-anywhere/pkg/constants"
"github.com/aws/eks-anywhere/pkg/retrier"
"github.com/aws/eks-anywhere/pkg/types"
)
// Client is a Kubernetes client.
type Client in... | 102 |
eks-anywhere | aws | Go | package awsiamauth_test
import (
"context"
"errors"
"testing"
"github.com/golang/mock/gomock"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
"github.com/aws/eks-anywhere/pkg/awsiamauth"
"github.com/aws/eks-anywhere/pkg/awsiamauth/mocks"
"github.com/aws/eks-anywhere/pkg/retrier"
"github.com/aws/eks-... | 121 |
eks-anywhere | aws | Go | package awsiamauth
import (
"context"
"errors"
"github.com/aws/eks-anywhere/pkg/cluster"
"github.com/aws/eks-anywhere/pkg/workflow"
"github.com/aws/eks-anywhere/pkg/workflow/management"
"github.com/aws/eks-anywhere/pkg/workflow/workflowcontext"
)
// HookRegistrar is responsible for binding AWS IAM Auth hooks t... | 64 |
eks-anywhere | aws | Go | package awsiamauth
import (
"context"
"fmt"
"github.com/google/uuid"
"github.com/aws/eks-anywhere/pkg/cluster"
"github.com/aws/eks-anywhere/pkg/crypto"
"github.com/aws/eks-anywhere/pkg/filewriter"
"github.com/aws/eks-anywhere/pkg/logger"
"github.com/aws/eks-anywhere/pkg/types"
)
// KubernetesClient provides... | 156 |
eks-anywhere | aws | Go | package awsiamauth_test
import (
"context"
"errors"
"strings"
"testing"
"github.com/golang/mock/gomock"
"github.com/google/uuid"
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/awsiamau... | 366 |
eks-anywhere | aws | Go | // Code generated by MockGen. DO NOT EDIT.
// Source: pkg/awsiamauth/installer.go
// Package awsiamauth_test is a generated GoMock package.
package awsiamauth_test
import (
context "context"
reflect "reflect"
types "github.com/aws/eks-anywhere/pkg/types"
gomock "github.com/golang/mock/gomock"
)
// MockKubernete... | 81 |
eks-anywhere | aws | Go | package awsiamauth
import "fmt"
const (
awsIamAuthCaSecretSuffix = "aws-iam-authenticator-ca"
awsIamAuthKubeconfigSuffix = "aws-iam-kubeconfig"
// AwsIamAuthConfigMapName is the name of AWS IAM Authenticator configuration.
AwsIamAuthConfigMapName = "aws-iam-authenticator"
// AwsAuthConfigMapName is the name ... | 25 |
eks-anywhere | aws | Go | package awsiamauth_test
import (
"testing"
. "github.com/onsi/gomega"
"github.com/aws/eks-anywhere/pkg/awsiamauth"
)
func TestKubeconfigSecretName(t *testing.T) {
g := NewWithT(t)
g.Expect(awsiamauth.KubeconfigSecretName("my-cluster")).To(Equal("my-cluster-aws-iam-kubeconfig"))
}
| 15 |
eks-anywhere | aws | Go | package awsiamauth
import (
_ "embed"
"encoding/base64"
"fmt"
"strings"
"github.com/google/uuid"
"gopkg.in/yaml.v3"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/cluster"
"github.com/aws/eks-anywhere/pkg/constants"
"github.com/aws/eks-anywhere/pkg/crypto"
"github.com/aws/... | 157 |
eks-anywhere | aws | Go | // Code generated by MockGen. DO NOT EDIT.
// Source: pkg/awsiamauth/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"
runtime "k8s.io/apimachinery/pkg/runtime"... | 81 |
eks-anywhere | aws | Go | package reconciler
import (
"context"
"encoding/base64"
"fmt"
"github.com/go-logr/logr"
"github.com/google/uuid"
"github.com/pkg/errors"
corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/klog/v2"
"si... | 237 |
eks-anywhere | aws | Go | package reconciler_test
import (
"context"
"errors"
"testing"
"time"
eksdv1 "github.com/aws/eks-distro-build-tooling/release/api/v1alpha1"
"github.com/go-logr/logr"
"github.com/golang/mock/gomock"
"github.com/google/uuid"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pk... | 334 |
eks-anywhere | aws | Go | // Code generated by MockGen. DO NOT EDIT.
// Source: pkg/awsiamauth/reconciler/reconciler.go
// Package mocks is a generated GoMock package.
package mocks
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
client "sigs.k8s.io/controller-runtime/pkg/client"
)
// MockRemoteClient... | 52 |
eks-anywhere | aws | Go | package bootstrapper
import (
"context"
"errors"
"fmt"
"github.com/aws/eks-anywhere/pkg/cluster"
"github.com/aws/eks-anywhere/pkg/constants"
"github.com/aws/eks-anywhere/pkg/logger"
"github.com/aws/eks-anywhere/pkg/types"
)
type Bootstrapper struct {
clusterClient ClusterClient
}
type ClusterClient interfac... | 133 |
eks-anywhere | aws | Go | package bootstrapper_test
import (
"context"
"errors"
"reflect"
"testing"
"github.com/golang/mock/gomock"
"github.com/aws/eks-anywhere/internal/test"
"github.com/aws/eks-anywhere/pkg/bootstrapper"
"github.com/aws/eks-anywhere/pkg/bootstrapper/mocks"
"github.com/aws/eks-anywhere/pkg/cluster"
"github.com/aws... | 312 |
eks-anywhere | aws | Go | package bootstrapper
import (
"context"
"time"
"github.com/aws/eks-anywhere/pkg/cluster"
"github.com/aws/eks-anywhere/pkg/retrier"
"github.com/aws/eks-anywhere/pkg/types"
)
// KindClient is a Kind client.
type KindClient interface {
CreateBootstrapCluster(ctx context.Context, clusterSpec *cluster.Spec, opts ..... | 150 |
eks-anywhere | aws | Go | package bootstrapper_test
import (
"context"
"errors"
"testing"
"github.com/golang/mock/gomock"
. "github.com/onsi/gomega"
"github.com/aws/eks-anywhere/internal/test"
"github.com/aws/eks-anywhere/pkg/bootstrapper"
"github.com/aws/eks-anywhere/pkg/bootstrapper/mocks"
"github.com/aws/eks-anywhere/pkg/cluster"... | 156 |
eks-anywhere | aws | Go | // Code generated by MockGen. DO NOT EDIT.
// Source: github.com/aws/eks-anywhere/pkg/bootstrapper (interfaces: ClusterClient)
// Package mocks is a generated GoMock package.
package mocks
import (
context "context"
reflect "reflect"
bootstrapper "github.com/aws/eks-anywhere/pkg/bootstrapper"
cluster "github.com... | 202 |
eks-anywhere | aws | Go | // Code generated by MockGen. DO NOT EDIT.
// Source: github.com/aws/eks-anywhere/pkg/bootstrapper (interfaces: KindClient,KubernetesClient)
// Package mocks is a generated GoMock package.
package mocks
import (
context "context"
reflect "reflect"
bootstrapper "github.com/aws/eks-anywhere/pkg/bootstrapper"
clust... | 225 |
eks-anywhere | aws | Go | /*
Package cli implements usecases logic that are designed to be run exclusively from the cli
and need desambiguation. This is, the same or similar concept exists in an eks-a nontroller.
*/
package cli
| 6 |
eks-anywhere | aws | Go | package kubernetes
import (
"context"
"sigs.k8s.io/controller-runtime/pkg/client"
)
// Object is a Kubernetes object.
type Object client.Object
// ObjectList is a Kubernetes object list.
type ObjectList client.ObjectList
// Client is Kubernetes API client.
type Client interface {
Reader
Writer
}
// Reader kno... | 74 |
eks-anywhere | aws | Go | package kubernetes_test
import (
"testing"
. "github.com/onsi/gomega"
"github.com/aws/eks-anywhere/pkg/clients/kubernetes"
)
func TestDeleteAllOfOptionsApplyToDeleteAllOf(t *testing.T) {
tests := []struct {
name string
option, in, want *kubernetes.DeleteAllOfOptions
}{
{
name: "empty",
... | 96 |
eks-anywhere | aws | Go | package kubernetes
import (
"context"
)
// KubeconfigClient is an authenticated kubernetes API client
// it authenticates using the credentials of a kubeconfig file.
type KubeconfigClient struct {
client *UnAuthClient
kubeconfig string
}
func NewKubeconfigClient(client *UnAuthClient, kubeconfig string) *Kubec... | 52 |
eks-anywhere | aws | Go | package kubernetes_test
import (
"context"
"testing"
"github.com/golang/mock/gomock"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/clients/kubernetes"
"github.com... | 152 |
eks-anywhere | aws | Go | package kubernetes
import (
"context"
"k8s.io/apimachinery/pkg/runtime"
)
// Kubectl is a client implemented with the kubectl binary.
type Kubectl interface {
Get(ctx context.Context, resourceType, kubeconfig string, obj runtime.Object, opts ...KubectlGetOption) error
Create(ctx context.Context, kubeconfig strin... | 90 |
eks-anywhere | aws | Go | package kubernetes_test
import (
"testing"
. "github.com/onsi/gomega"
"github.com/aws/eks-anywhere/pkg/clients/kubernetes"
"github.com/aws/eks-anywhere/pkg/utils/ptr"
)
func TestKubectlGetOptionsApplyToGet(t *testing.T) {
tests := []struct {
name string
option, in, want *kubernetes.KubectlGetOp... | 182 |
eks-anywhere | aws | Go | package kubernetes
import (
"fmt"
"os"
"k8s.io/apimachinery/pkg/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
"sigs.k8s.io/controller-runtime/pkg/client"
)
// ClientFactory builds clients from a kubeconfig file by
// wrapping around New... | 79 |
eks-anywhere | aws | Go | package kubernetes_test
import (
"context"
"errors"
"testing"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/rest"
"github.com/aws/eks-anywhere/internal/test"
"github.com/aws/eks-anywhere/pkg/clients/k... | 71 |
eks-anywhere | aws | Go | package kubernetes
var NewRuntimeClient = newRuntimeClient
type RestConfigurator = restConfigurator
| 6 |
eks-anywhere | aws | Go | package kubernetes
import (
eksdv1alpha1 "github.com/aws/eks-distro-build-tooling/release/api/v1alpha1"
etcdv1 "github.com/aws/etcdadm-controller/api/v1beta1"
tinkerbellv1 "github.com/tinkerbell/cluster-api-provider-tinkerbell/api/v1beta1"
"k8s.io/apimachinery/pkg/runtime"
clientgoscheme "k8s.io/client-go/kuberne... | 51 |
eks-anywhere | aws | Go | package kubernetes
import (
"context"
"fmt"
"strings"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/client/apiutil"
)
// UnAuthClient is a generic kubernetes API client that takes a kubeconfig
// file on every ... | 139 |
eks-anywhere | aws | Go | package kubernetes_test
import (
"context"
"testing"
"github.com/golang/mock/gomock"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
clusterapiv1 "sigs.k8s.io/cluster-api/api/v1beta1"
controlplanev1 "sigs.k8s.io/cluster-ap... | 332 |
eks-anywhere | aws | Go | // Code generated by MockGen. DO NOT EDIT.
// Source: pkg/clients/kubernetes/client.go
// Package mocks is a generated GoMock package.
package mocks
import (
context "context"
reflect "reflect"
kubernetes "github.com/aws/eks-anywhere/pkg/clients/kubernetes"
gomock "github.com/golang/mock/gomock"
)
// MockClient... | 296 |
eks-anywhere | aws | Go | // Code generated by MockGen. DO NOT EDIT.
// Source: pkg/clients/kubernetes/kubeconfig.go
// Package mocks is a generated GoMock package.
package mocks
| 6 |
eks-anywhere | aws | Go | // Code generated by MockGen. DO NOT EDIT.
// Source: pkg/clients/kubernetes/kubectl.go
// Package mocks is a generated GoMock package.
package mocks
import (
context "context"
reflect "reflect"
kubernetes "github.com/aws/eks-anywhere/pkg/clients/kubernetes"
gomock "github.com/golang/mock/gomock"
runtime "k8s.i... | 188 |
eks-anywhere | aws | Go | package cluster
import (
"fmt"
"k8s.io/apimachinery/pkg/runtime"
anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1"
)
// APIObject represents a kubernetes API object.
type APIObject interface {
runtime.Object
GetName() string
}
type ObjectLookup map[string]APIObject
// GetFromRef searches in a ObjectL... | 40 |
eks-anywhere | aws | Go | package cluster
import (
"context"
anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1"
)
func awsIamEntry() *ConfigManagerEntry {
return &ConfigManagerEntry{
APIObjectMapping: map[string]APIObjectGenerator{
anywherev1.AWSIamConfigKind: func() APIObject {
return &anywherev1.AWSIamConfig{}
},
},... | 79 |
eks-anywhere | aws | Go | package cluster_test
import (
"context"
"testing"
"github.com/golang/mock/gomock"
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/cluster"
"github.com/aws/eks... | 59 |
eks-anywhere | aws | Go | package cluster
// NewDefaultConfigClientBuilder returns a ConfigClientBuilder with the
// default processors to build a Config.
func NewDefaultConfigClientBuilder() *ConfigClientBuilder {
return NewConfigClientBuilder().Register(
getCloudStackMachineConfigs,
getCloudStackDatacenter,
getTinkerbellMachineConfigs... | 25 |
eks-anywhere | aws | Go | package cluster
import (
"github.com/pkg/errors"
"github.com/aws/eks-anywhere/pkg/constants"
"github.com/aws/eks-anywhere/pkg/manifests"
"github.com/aws/eks-anywhere/pkg/manifests/bundles"
"github.com/aws/eks-anywhere/pkg/version"
releasev1 "github.com/aws/eks-anywhere/release/api/v1alpha1"
)
// FileSpecBuilde... | 120 |
eks-anywhere | aws | Go | package cluster_test
import (
"testing"
. "github.com/onsi/gomega"
"github.com/aws/eks-anywhere/pkg/cluster"
"github.com/aws/eks-anywhere/pkg/files"
"github.com/aws/eks-anywhere/pkg/version"
)
func TestFileSpecBuilderBuildError(t *testing.T) {
tests := []struct {
testName string
releaseURL ... | 86 |
eks-anywhere | aws | Go | package cluster
import (
"context"
"github.com/pkg/errors"
anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/clients/kubernetes"
)
// Client is a kubernetes API client.
type Client interface {
Get(ctx context.Context, name, namespace string, obj kubernetes.Object) error... | 53 |
eks-anywhere | aws | Go | package cluster_test
import (
"context"
"errors"
"testing"
"github.com/golang/mock/gomock"
. "github.com/onsi/gomega"
anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/cluster"
"github.com/aws/eks-anywhere/pkg/cluster/mocks"
)
func TestConfigClientBuilderBuildSuccess... | 68 |
eks-anywhere | aws | Go | package cluster
import (
"context"
anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1"
)
func cloudstackEntry() *ConfigManagerEntry {
return &ConfigManagerEntry{
APIObjectMapping: map[string]APIObjectGenerator{
anywherev1.CloudStackDatacenterKind: func() APIObject {
return &anywherev1.CloudStackDat... | 140 |
eks-anywhere | aws | Go | package cluster_test
import (
"context"
"testing"
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/aws/eks-anywhere/internal/test"
anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/cluster... | 150 |
eks-anywhere | aws | Go | package cluster
func clusterEntry() *ConfigManagerEntry {
return &ConfigManagerEntry{
Defaulters: []Defaulter{
func(c *Config) error {
c.Cluster.SetDefaults()
return nil
},
},
Validations: []Validation{
func(c *Config) error {
return c.Cluster.Validate()
},
},
}
}
| 18 |
eks-anywhere | aws | Go | package cluster
import (
"reflect"
v1 "k8s.io/api/core/v1"
anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/clients/kubernetes"
)
type Config struct {
Cluster *anywherev1.Cluster
CloudStackDatacenter *anywherev1.CloudStackDatacenterConfig
VSphe... | 214 |
eks-anywhere | aws | Go | package cluster
import (
"errors"
"fmt"
"regexp"
"strings"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
utilerrors "k8s.io/apimachinery/pkg/util/errors"
"sigs.k8s.io/yaml"
anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/logger"
)
// ConfigManager allows to parse ... | 186 |
eks-anywhere | aws | Go | package cluster_test
import (
"errors"
"testing"
. "github.com/onsi/gomega"
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/cluster"
"github.com/aws/eks-anywhere/pkg/utils/ptr"... | 244 |
eks-anywhere | aws | Go | package cluster_test
import (
"reflect"
"testing"
. "github.com/onsi/gomega"
anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/cluster"
)
func TestConfigChildObjects(t *testing.T) {
g := NewWithT(t)
config := &cluster.Config{
Cluster: &anywherev1.Cluste... | 103 |
eks-anywhere | aws | Go | package cluster
func SetConfigDefaults(c *Config) error {
return manager().SetDefaults(c)
}
| 6 |
eks-anywhere | aws | Go | package cluster_test
import (
"testing"
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/cluster"
)
func TestSetDefaultFluxConfigPath(t *testing.T) {
tests := []struct {
name string
... | 92 |
eks-anywhere | aws | Go | package cluster
var defaultManager *ConfigManager
func init() {
var err error
defaultManager, err = NewDefaultConfigManager()
if err != nil {
panic(err)
}
}
func manager() *ConfigManager {
return defaultManager
}
func NewDefaultConfigManager() (*ConfigManager, error) {
m := NewConfigManager()
err := m.Regi... | 38 |
eks-anywhere | aws | Go | package cluster
import (
"context"
anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1"
)
func dockerEntry() *ConfigManagerEntry {
return &ConfigManagerEntry{
APIObjectMapping: map[string]APIObjectGenerator{
anywherev1.DockerDatacenterKind: func() APIObject {
return &anywherev1.DockerDatacenterConfi... | 60 |
eks-anywhere | aws | Go | package cluster_test
import (
"context"
"testing"
"github.com/golang/mock/gomock"
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/cluster"
"github.com/aws/eks... | 73 |
eks-anywhere | aws | Go | package cluster
import (
"context"
"fmt"
eksdv1alpha1 "github.com/aws/eks-distro-build-tooling/release/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/constants"
"github.com/aws/eks-anywhere/pkg/logger"
v1alpha1release "github.com/aws/eks-anywhere/release/api/v1al... | 234 |
eks-anywhere | aws | Go | package cluster_test
import (
"context"
"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"
"k8s.io/apimachinery/pkg/runtime"
anywherev1 "github.com/aws/eks-anywhere/... | 548 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.