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 tinkerbell_test
import (
"errors"
"net"
"testing"
"time"
"github.com/golang/mock/gomock"
"github.com/onsi/gomega"
"github.com/tinkerbell/cluster-api-provider-tinkerbell/api/v1beta1"
"github.com/tinkerbell/tink/pkg/apis/core/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "k8s.io/apimachin... | 698 |
eks-anywhere | aws | Go | package tinkerbell
import (
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/cluster"
)
// ClusterSpec represents a cluster configuration for Tinkerbell provisioning.
type ClusterSpec struct {
*cluster.Spec
// DatacenterConfig configured in the cluster configuration YAML.
Datacent... | 117 |
eks-anywhere | aws | Go | package tinkerbell_test
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/cluster"
"github.com/aws/eks-anywhere/pkg/providers/tinkerbell"
"github.com/aws/eks-anywhere/pkg/utils/ptr"
)
type ValidClusterSpecBuilder struct {
ControlP... | 219 |
eks-anywhere | aws | Go | package tinkerbell_test
import (
"errors"
"testing"
"github.com/onsi/gomega"
"github.com/aws/eks-anywhere/pkg/providers/tinkerbell"
)
func TestClusterSpecValidator_AssertionsWithoutError(t *testing.T) {
g := gomega.NewWithT(t)
assertions := []*MockAssertion{{}, {}, {}}
validator := tinkerbell.NewClusterSpec... | 54 |
eks-anywhere | aws | Go | package tinkerbell
import (
"context"
"github.com/go-logr/logr"
"github.com/pkg/errors"
tinkerbellv1 "github.com/tinkerbell/cluster-api-provider-tinkerbell/api/v1beta1"
corev1 "k8s.io/api/core/v1"
"github.com/aws/eks-anywhere/pkg/clients/kubernetes"
"github.com/aws/eks-anywhere/pkg/cluster"
"github.com/aws/e... | 130 |
eks-anywhere | aws | Go | package tinkerbell
import (
"context"
"testing"
. "github.com/onsi/gomega"
tinkerbellv1 "github.com/tinkerbell/cluster-api-provider-tinkerbell/api/v1beta1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
bootstrapv1 "sigs.k8s.io/cluster... | 668 |
eks-anywhere | aws | Go | package tinkerbell
import (
"context"
"fmt"
"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/constants"
"github.com/aws/eks-anywhere/pkg/logger"
"github.com/aws/eks-anywhere/pkg/providers/co... | 239 |
eks-anywhere | aws | Go | package tinkerbell
import (
"context"
"github.com/aws/eks-anywhere/pkg/cluster"
"github.com/aws/eks-anywhere/pkg/types"
)
func (p *Provider) SetupAndValidateDeleteCluster(ctx context.Context, cluster *types.Cluster, _ *cluster.Spec) error {
// noop
return nil
}
func (p *Provider) DeleteResources(ctx context.Co... | 31 |
eks-anywhere | aws | Go | package tinkerbell
import (
"context"
"github.com/pkg/errors"
tinkerbellv1 "github.com/tinkerbell/cluster-api-provider-tinkerbell/api/v1beta1"
"k8s.io/apimachinery/pkg/api/equality"
"github.com/aws/eks-anywhere/pkg/clients/kubernetes"
)
// GetMachineTemplate gets a TinkerbellMachineTemplate object using the pr... | 28 |
eks-anywhere | aws | Go | package tinkerbell
import (
"fmt"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/providers/common"
)
const defaultUsername = "ec2-user"
func ensureMachineConfigsHaveAtLeast1User(machines map[string]*v1alpha1.TinkerbellMachineConfig) {
for _, machine := range machines {
if len(... | 73 |
eks-anywhere | aws | Go | package tinkerbell
import (
"bufio"
"bytes"
"context"
_ "embed"
"fmt"
"io"
"strings"
"time"
etcdv1 "github.com/aws/etcdadm-controller/api/v1beta1"
"github.com/pkg/errors"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
yamlutil "k8s.io/apimachinery/pkg/util/yaml"
"github.com/aws/eks-anywhere/pkg/api... | 680 |
eks-anywhere | aws | Go | package tinkerbell
import (
"testing"
. "github.com/onsi/gomega"
"github.com/aws/eks-anywhere/internal/test"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
)
func TestGenerateTemplateBuilder(t *testing.T) {
g := NewWithT(t)
clusterSpec := test.NewFullClusterSpec(t, testClusterConfigFilename)
expectedControl... | 59 |
eks-anywhere | aws | Go | package tinkerbell
import (
"context"
"errors"
"fmt"
"time"
etcdv1 "github.com/aws/etcdadm-controller/api/v1beta1"
tinkv1alpha1 "github.com/tinkerbell/tink/pkg/apis/core/v1alpha1"
corev1 "k8s.io/api/core/v1"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
controlplanev1 "sigs.k8s.io/cluster-api/controlplane/... | 311 |
eks-anywhere | aws | Go | package tinkerbell
import (
"context"
"errors"
"fmt"
"os"
"path"
"testing"
"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
tinkv1alpha1 "github.com/tinkerbell/tink/pkg/apis/core/v1alpha1"
v1 "k8s.io/api/core/v1"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
controlplanev1 "sigs.k8s.... | 1,861 |
eks-anywhere | aws | Go | package tinkerbell
import (
"context"
"errors"
"fmt"
"reflect"
rufiov1 "github.com/tinkerbell/rufio/api/v1alpha1"
tinkv1alpha1 "github.com/tinkerbell/tink/pkg/apis/core/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/clu... | 507 |
eks-anywhere | aws | Go | package tinkerbell
import (
"context"
"errors"
"fmt"
"strings"
"testing"
"github.com/golang/mock/gomock"
rufiov1 "github.com/tinkerbell/rufio/api/v1alpha1"
tinkv1 "github.com/tinkerbell/tink/pkg/apis/core/v1alpha1"
tinkv1alpha1 "github.com/tinkerbell/tink/pkg/apis/core/v1alpha1"
corev1 "k8s.io/api/core/v1"
... | 720 |
eks-anywhere | aws | Go | package tinkerbell
import (
"fmt"
"strings"
tinkv1alpha1 "github.com/tinkerbell/tink/pkg/apis/core/v1alpha1"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/networkutils"
"github.com/aws/eks-anywhere/pkg/providers/tinkerbell/hardware"
)
func validateOsFamily(spec *ClusterSpec) ... | 214 |
eks-anywhere | aws | Go | package tinkerbell
import (
"context"
"github.com/go-logr/logr"
"github.com/pkg/errors"
tinkerbellv1 "github.com/tinkerbell/cluster-api-provider-tinkerbell/api/v1beta1"
"github.com/aws/eks-anywhere/pkg/clients/kubernetes"
"github.com/aws/eks-anywhere/pkg/cluster"
"github.com/aws/eks-anywhere/pkg/clusterapi"
... | 75 |
eks-anywhere | aws | Go | package tinkerbell_test
import (
"context"
"testing"
"time"
. "github.com/onsi/gomega"
tinkerbellv1 "github.com/tinkerbell/cluster-api-provider-tinkerbell/api/v1beta1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
clusterv1 "sigs.k8s.io/cluste... | 367 |
eks-anywhere | aws | Go | package hardware
import (
"bufio"
"errors"
"fmt"
"io"
"os"
rufiov1alpha1 "github.com/tinkerbell/rufio/api/v1alpha1"
tinkv1alpha1 "github.com/tinkerbell/tink/pkg/apis/core/v1alpha1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
yamlutil "k8s.io/apimachinery/pkg/util/yaml"
"... | 174 |
eks-anywhere | aws | Go | package hardware
import (
"github.com/tinkerbell/rufio/api/v1alpha1"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/aws/eks-anywhere/pkg/constants"
)
// IndexBMCs indexes BMC instances on index by extracfting the key using fn.
func (c *Catalogue) IndexBMCs(index string, fn KeyE... | 108 |
eks-anywhere | aws | Go | package hardware_test
import (
"testing"
"github.com/onsi/gomega"
"github.com/tinkerbell/rufio/api/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/aws/eks-anywhere/pkg/providers/tinkerbell/hardware"
)
func TestCatalogue_BMC_Insert(t *testing.T) {
g := gomega.NewWithT(t)
catalogue := hard... | 82 |
eks-anywhere | aws | Go | package hardware
import (
"fmt"
"math"
tinkv1alpha1 "github.com/tinkerbell/tink/pkg/apis/core/v1alpha1"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
eksav1alpha1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/constants"
)
// serializeHardwareSelector ... | 234 |
eks-anywhere | aws | Go | package hardware_test
import (
"testing"
"github.com/onsi/gomega"
"github.com/tinkerbell/tink/pkg/apis/core/v1alpha1"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/aws/eks-anywhere/pkg/providers/tinkerbell/hardware"
)
func TestCatalogue_Hardware_Insert(t *testing.T) {
g :=... | 283 |
eks-anywhere | aws | Go | package hardware
import (
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3"
"github.com/aws/eks-anywhere/pkg/constants"
)
// IndexSecret indexes Secret instances on index by extracfting the key using fn.
func (c *Catalogue) IndexSecret(ind... | 103 |
eks-anywhere | aws | Go | package hardware_test
import (
"testing"
"github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/aws/eks-anywhere/pkg/providers/tinkerbell/hardware"
)
func TestCatalogue_Secret_Insert(t *testing.T) {
g := gomega.NewWithT(t)
catalogue := hardware.NewCata... | 82 |
eks-anywhere | aws | Go | package hardware_test
import (
"bufio"
"bytes"
"testing"
"github.com/onsi/gomega"
"github.com/aws/eks-anywhere/pkg/providers/tinkerbell/hardware"
)
const hardwareManifestsYAML = `
apiVersion: tinkerbell.org/v1alpha1
kind: Hardware
metadata:
labels:
clusterctl.cluster.x-k8s.io/move: "true"
name: worker1... | 83 |
eks-anywhere | aws | Go | package hardware
import (
"bufio"
"bytes"
stdcsv "encoding/csv"
"fmt"
"io"
"os"
"strings"
csv "github.com/gocarina/gocsv"
unstructuredutil "github.com/aws/eks-anywhere/pkg/utils/unstructured"
)
// CSVReader reads a CSV file and provides Machine instances. It satisfies the MachineReader interface. The ID fi... | 113 |
eks-anywhere | aws | Go | package hardware_test
import (
"bytes"
stdcsv "encoding/csv"
"errors"
"fmt"
"strings"
"testing"
"testing/iotest"
csv "github.com/gocarina/gocsv"
"github.com/onsi/gomega"
"github.com/aws/eks-anywhere/pkg/providers/tinkerbell/hardware"
)
func TestCSVReaderReads(t *testing.T) {
g := gomega.NewWithT(t)
buf... | 251 |
eks-anywhere | aws | Go | package hardware
import "fmt"
func formatBMCRef(m Machine) string {
return fmt.Sprintf("bmc-%s", m.Hostname)
}
func formatBMCSecretRef(m Machine) string {
return fmt.Sprintf("%s-auth", formatBMCRef(m))
}
| 12 |
eks-anywhere | aws | Go | package hardware
import (
"fmt"
"reflect"
)
// FieldIndexer indexes collection of objects for a single type against one of its fields.
// FieldIndexer is not thread safe.
type FieldIndexer struct {
expectedType reflect.Type
indexes map[string]*fieldIndex
}
// NewFieldIndexer creates a new FieldIndexer insta... | 121 |
eks-anywhere | aws | Go | package hardware_test
import (
"testing"
"github.com/onsi/gomega"
"github.com/aws/eks-anywhere/pkg/providers/tinkerbell/hardware"
)
func TestFieldIndexer_InsertAndLookup(t *testing.T) {
g := gomega.NewWithT(t)
type Object struct{ Name string }
const Index = ".Name"
indexer := hardware.NewFieldIndexer(&Objec... | 153 |
eks-anywhere | aws | Go | package hardware
import (
"context"
"fmt"
rufiov1alpha1 "github.com/tinkerbell/rufio/api/v1alpha1"
tinkv1alpha1 "github.com/tinkerbell/tink/pkg/apis/core/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/aws/eks-anywhere/pkg/constants"
)
// OwnerN... | 97 |
eks-anywhere | aws | Go | package hardware_test
import (
"context"
"testing"
. "github.com/onsi/gomega"
rufiov1alpha1 "github.com/tinkerbell/rufio/api/v1alpha1"
tinkv1alpha1 "github.com/tinkerbell/tink/pkg/apis/core/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtim... | 116 |
eks-anywhere | aws | Go | package hardware
import (
"fmt"
"sort"
"strings"
)
// Machine is a machine configuration with optional BMC interface configuration.
type Machine struct {
Hostname string `csv:"hostname"`
IPAddress string `csv:"ip_address"`
Netmask string `csv:"netmask"`
Gateway string `csv:"gat... | 119 |
eks-anywhere | aws | Go | package hardware
// multiWriter implements MachineWriter. It writes Machine instances to multiple writers similar to the tee
// unix tool writes to multiple output streams.
type multiWriter []MachineWriter
// Write m to all MachineWriters attached to t with t.Attach(...). If a MachineWriter returns an error
// Write ... | 26 |
eks-anywhere | aws | Go | package hardware_test
import (
"errors"
"testing"
"github.com/golang/mock/gomock"
"github.com/onsi/gomega"
"github.com/aws/eks-anywhere/pkg/providers/tinkerbell/hardware"
"github.com/aws/eks-anywhere/pkg/providers/tinkerbell/hardware/mocks"
)
func TestTeeWriterWritesToAllWriters(t *testing.T) {
ctrl := gomoc... | 94 |
eks-anywhere | aws | Go | package hardware
import "strings"
// NormalizerFunc applies a normalization transformation to the Machine.
type NormalizerFunc func(Machine) Machine
// Normalizer is a decorator for a MachineReader that applies a set of normalization funcs
// to machines.
type Normalizer struct {
reader MachineReader
normaliz... | 63 |
eks-anywhere | aws | Go | package hardware_test
import (
"errors"
"testing"
"github.com/golang/mock/gomock"
"github.com/onsi/gomega"
"github.com/aws/eks-anywhere/pkg/providers/tinkerbell/hardware"
"github.com/aws/eks-anywhere/pkg/providers/tinkerbell/hardware/mocks"
)
func TestNormalizer(t *testing.T) {
g := gomega.NewWithT(t)
ctrl ... | 66 |
eks-anywhere | aws | Go | package hardware
import (
"fmt"
"io"
)
// MachineReader reads single Machine configuration at a time. When there are no more Machine entries
// to be read, Read() returns io.EOF.
type MachineReader interface {
Read() (Machine, error)
}
// MachineWriter writes Machine entries.
type MachineWriter interface {
Write... | 61 |
eks-anywhere | aws | Go | package hardware_test
import (
"errors"
"io"
"testing"
"github.com/golang/mock/gomock"
"github.com/onsi/gomega"
"github.com/aws/eks-anywhere/pkg/providers/tinkerbell/hardware"
"github.com/aws/eks-anywhere/pkg/providers/tinkerbell/hardware/mocks"
)
func TestTranslateReadsAndWrites(t *testing.T) {
ctrl := gom... | 201 |
eks-anywhere | aws | Go | package hardware
import v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// TypeMeta constants for defining Kubernetes TypeMeta data in Kubernetes objects.
const (
// TODO(pokearu) update API version once upstream is changed.
rufioAPIVersion = "bmc.tinkerbell.org/v1alpha1"
tinkerbellAPIVersion = "tinkerbell.org/... | 37 |
eks-anywhere | aws | Go | package hardware
import (
"errors"
"fmt"
"net"
"regexp"
"strconv"
"strings"
apimachineryvalidation "k8s.io/apimachinery/pkg/util/validation"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/networkutils"
)
// MachineAssertion defines a condition that Machine must meet.
type M... | 265 |
eks-anywhere | aws | Go | package hardware_test
import (
"errors"
"testing"
"github.com/onsi/gomega"
"github.com/aws/eks-anywhere/pkg/providers/tinkerbell/hardware"
)
func TestDefaultMachineValidatorValidationsRun(t *testing.T) {
g := gomega.NewWithT(t)
// check is set by assertion when its called and allows us to validate
// regist... | 245 |
eks-anywhere | aws | Go | package hardware
import (
"fmt"
"io"
"os"
"path/filepath"
"sigs.k8s.io/yaml"
)
// TinkerbellManifestYAML is a MachineWriter that writes Tinkerbell manifests to a destination.
type TinkerbellManifestYAML struct {
writer io.Writer
}
// NewTinkerbellManifestYAML creates a TinkerbellManifestYAML instance that wri... | 97 |
eks-anywhere | aws | Go | package hardware_test
import (
"bufio"
"bytes"
"errors"
"testing"
"github.com/onsi/gomega"
rufiov1alpha1 "github.com/tinkerbell/rufio/api/v1alpha1"
tinkv1alpha1 "github.com/tinkerbell/tink/pkg/apis/core/v1alpha1"
corev1 "k8s.io/api/core/v1"
apimachineryyaml "k8s.io/apimachinery/pkg/util/yaml"
"sigs.k8s.io/y... | 84 |
eks-anywhere | aws | Go | // Code generated by MockGen. DO NOT EDIT.
// Source: pkg/providers/tinkerbell/hardware/translate.go
// Package mocks is a generated GoMock package.
package mocks
import (
reflect "reflect"
hardware "github.com/aws/eks-anywhere/pkg/providers/tinkerbell/hardware"
gomock "github.com/golang/mock/gomock"
)
// MockMa... | 125 |
eks-anywhere | aws | Go | // Code generated by MockGen. DO NOT EDIT.
// Source: github.com/aws/eks-anywhere/pkg/providers/tinkerbell (interfaces: ProviderKubectlClient,SSHAuthKeyGenerator)
// Package mocks is a generated GoMock package.
package mocks
import (
context "context"
reflect "reflect"
v1alpha1 "github.com/aws/eks-anywhere/pkg/ap... | 431 |
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"
"fmt"
"reflect"
"github.com/go-logr/logr"
"github.com/pkg/errors"
tinkerbellv1 "github.com/tinkerbell/cluster-api-provider-tinkerbell/api/v1beta1"
rufiov1alpha1 "github.com/tinkerbell/rufio/api/v1alpha1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery... | 461 |
eks-anywhere | aws | Go | package reconciler_test
import (
"context"
"errors"
"testing"
"github.com/golang/mock/gomock"
. "github.com/onsi/gomega"
tinkerbellv1 "github.com/tinkerbell/cluster-api-provider-tinkerbell/api/v1beta1"
rufiov1alpha1 "github.com/tinkerbell/rufio/api/v1alpha1"
tinkv1alpha1 "github.com/tinkerbell/tink/pkg/apis/c... | 1,376 |
eks-anywhere | aws | Go | // Code generated by MockGen. DO NOT EDIT.
// Source: pkg/providers/tinkerbell/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/controll... | 131 |
eks-anywhere | aws | Go | /*
Copyright 2022 Tinkerbell.
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 required by applicable law or agreed to in writing, software
dis... | 189 |
eks-anywhere | aws | Go | package stack
import (
"context"
"errors"
"fmt"
"path/filepath"
"strings"
"sigs.k8s.io/yaml"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/config"
"github.com/aws/eks-anywhere/pkg/executables"
"github.com/aws/eks-anywhere/pkg/filewriter"
"github.com/aws/eks-anywhere/pkg/l... | 461 |
eks-anywhere | aws | Go | package stack_test
import (
"context"
"errors"
"fmt"
"log"
"os"
"path/filepath"
"reflect"
"testing"
"github.com/golang/mock/gomock"
"github.com/google/go-cmp/cmp"
"github.com/stretchr/testify/assert"
"sigs.k8s.io/yaml"
"github.com/aws/eks-anywhere/internal/test"
"github.com/aws/eks-anywhere/pkg/api/v1a... | 456 |
eks-anywhere | aws | Go | // Code generated by MockGen. DO NOT EDIT.
// Source: pkg/providers/tinkerbell/stack/stack.go
// Package mocks is a generated GoMock package.
package mocks
import (
context "context"
reflect "reflect"
executables "github.com/aws/eks-anywhere/pkg/executables"
stack "github.com/aws/eks-anywhere/pkg/providers/tinke... | 267 |
eks-anywhere | aws | Go | package validator
import (
"github.com/pkg/errors"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/networkutils"
)
// IPValidator defines the struct for control plane IP validations.
type IPValidator struct {
netClient networkutils.NetClient
}
// IPValidatorOpt is the type for op... | 46 |
eks-anywhere | aws | Go | package validator_test
import (
"errors"
"testing"
"github.com/golang/mock/gomock"
. "github.com/onsi/gomega"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/networkutils/mocks"
"github.com/aws/eks-anywhere/pkg/providers/validator"
)
func TestValidateControlPlaneIPUniqueness(t... | 34 |
eks-anywhere | aws | Go | package vsphere
import (
"context"
"time"
"github.com/go-logr/logr"
"github.com/pkg/errors"
corev1 "k8s.io/api/core/v1"
vspherev1 "sigs.k8s.io/cluster-api-provider-vsphere/api/v1beta1"
addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1"
"github.com/aws/eks-anywhere/pkg/clients/kubernetes"
"github.com/... | 171 |
eks-anywhere | aws | Go | package vsphere_test
import (
"context"
"testing"
"time"
etcdadmbootstrapv1 "github.com/aws/etcdadm-bootstrap-provider/api/v1beta1"
etcdv1 "github.com/aws/etcdadm-controller/api/v1beta1"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/cluster-... | 796 |
eks-anywhere | aws | Go | package vsphere
import (
"context"
"fmt"
"path/filepath"
"strings"
anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/logger"
"github.com/aws/eks-anywhere/pkg/providers/vsphere/internal/templates"
releasev1 "github.com/aws/eks-anywhere/release/api/v1alpha1"
)
const min... | 192 |
eks-anywhere | aws | Go | package vsphere
import (
"fmt"
"os"
"strconv"
anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/config"
)
func SetupEnvVars(datacenterConfig *anywherev1.VSphereDatacenterConfig) error {
if vSphereUsername, ok := os.LookupEnv(config.EksavSphereUsernameKey); ok && len(vSp... | 52 |
eks-anywhere | aws | Go | package vsphere_test
import (
"testing"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/providers/vsphere"
)
func TestSetupEnvVarsErrorDatacenter(t *testing.T) {
config := &v1alpha1.VSphereDatacenterConfig{
Spec: v1alpha1.VSphereDatacenterConfigSpec{
Server: "test",
In... | 22 |
eks-anywhere | aws | Go | package vsphere
import (
"context"
"github.com/pkg/errors"
"k8s.io/apimachinery/pkg/api/equality"
vspherev1 "sigs.k8s.io/cluster-api-provider-vsphere/api/v1beta1"
"github.com/aws/eks-anywhere/pkg/clients/kubernetes"
)
func getMachineTemplate(ctx context.Context, client kubernetes.Client, name, namespace string... | 25 |
eks-anywhere | aws | Go | package vsphere
import (
anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/cluster"
)
type Spec struct {
*cluster.Spec
}
// NewSpec constructs a new vSphere cluster Spec.
func NewSpec(clusterSpec *cluster.Spec) *Spec {
return &Spec{
Spec: clusterSpec,
}
}
func (s *Spe... | 54 |
eks-anywhere | aws | Go | package vsphere
import (
"fmt"
"strings"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/cluster"
)
func requiredTemplateTags(clusterSpec *cluster.Spec, machineConfig *v1alpha1.VSphereMachineConfig) []string {
tagsByCategory := requiredTemplateTagsByCategory(clusterSpec, machineC... | 28 |
eks-anywhere | aws | Go | package vsphere
import (
"fmt"
anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/cluster"
"github.com/aws/eks-anywhere/pkg/clusterapi"
"github.com/aws/eks-anywhere/pkg/config"
"github.com/aws/eks-anywhere/pkg/constants"
"github.com/aws/eks-anywhere/pkg/crypto"
"github.... | 444 |
eks-anywhere | aws | Go | package vsphere_test
import (
"testing"
"time"
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/aws/eks-anywhere/internal/test"
v1alpha1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/cluster"
"github.com/aws/eks-anywhere/pkg/providers/vsph... | 136 |
eks-anywhere | aws | Go | package vsphere
import (
"context"
_ "embed"
"encoding/json"
"errors"
"fmt"
"net"
"path/filepath"
"gopkg.in/yaml.v2"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/cluster"
"github.com/aws/eks-anywhere/pkg/config"
... | 593 |
eks-anywhere | aws | Go | package vsphere
import (
"context"
"encoding/json"
"errors"
"fmt"
"testing"
"github.com/golang/mock/gomock"
. "github.com/onsi/gomega"
"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/executab... | 413 |
eks-anywhere | aws | Go | package vsphere
import (
"bytes"
"context"
_ "embed"
"fmt"
"os"
"reflect"
"text/template"
"time"
"github.com/Masterminds/sprig"
etcdv1 "github.com/aws/etcdadm-controller/api/v1beta1"
corev1 "k8s.io/api/core/v1"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
controlplanev1 "sigs.k8s.io/cluster-api/contro... | 1,132 |
eks-anywhere | aws | Go | package vsphere
import (
"bytes"
"context"
_ "embed"
"encoding/json"
"errors"
"fmt"
"math"
"os"
"path"
"strings"
"testing"
"text/template"
"time"
"github.com/Masterminds/sprig"
etcdv1 "github.com/aws/etcdadm-controller/api/v1beta1"
"github.com/golang/mock/gomock"
. "github.com/onsi/gomega"
"github.c... | 3,678 |
eks-anywhere | aws | Go | package vsphere
import (
"context"
"time"
"github.com/go-logr/logr"
"github.com/pkg/errors"
vspherev1 "sigs.k8s.io/cluster-api-provider-vsphere/api/v1beta1"
"github.com/aws/eks-anywhere/pkg/clients/kubernetes"
"github.com/aws/eks-anywhere/pkg/cluster"
"github.com/aws/eks-anywhere/pkg/clusterapi"
capiyaml "g... | 73 |
eks-anywhere | aws | Go | package vsphere_test
import (
"context"
"testing"
"time"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
vspherev1 "sigs.k8s.io/cluster-api-provider-vsphere/api/v1beta1"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
bootstrapv1 "sigs.k8s.io/cluster-api/b... | 438 |
eks-anywhere | aws | Go | package tags
import (
"context"
"fmt"
"github.com/aws/eks-anywhere/pkg/executables"
"github.com/aws/eks-anywhere/pkg/logger"
"github.com/aws/eks-anywhere/pkg/types"
)
type Factory struct {
client GovcClient
}
type GovcClient interface {
ListTags(ctx context.Context) ([]executables.Tag, error)
CreateTag(ctx ... | 72 |
eks-anywhere | aws | Go | package tags_test
import (
"context"
"errors"
"testing"
"github.com/golang/mock/gomock"
"github.com/aws/eks-anywhere/pkg/executables"
"github.com/aws/eks-anywhere/pkg/providers/vsphere/internal/tags"
"github.com/aws/eks-anywhere/pkg/providers/vsphere/internal/tags/mocks"
)
type test struct {
t *tes... | 136 |
eks-anywhere | aws | Go | // Code generated by MockGen. DO NOT EDIT.
// Source: pkg/providers/vsphere/internal/tags/factory.go
// Package mocks is a generated GoMock package.
package mocks
import (
context "context"
reflect "reflect"
executables "github.com/aws/eks-anywhere/pkg/executables"
gomock "github.com/golang/mock/gomock"
)
// Mo... | 109 |
eks-anywhere | aws | Go | package templates
import (
"context"
"fmt"
"path/filepath"
"strings"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/executables"
"github.com/aws/eks-anywhere/pkg/logger"
"github.com/aws/eks-anywhere/pkg/providers/vsphere/internal/tags"
)
const (
libraryContentCorrupted = ... | 152 |
eks-anywhere | aws | Go | package templates_test
import (
"context"
"errors"
"testing"
"github.com/golang/mock/gomock"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/providers/vsphere/internal/templates"
"github.com/aws/eks-anywhere/pkg/providers/vsphere/i... | 270 |
eks-anywhere | aws | Go | // Code generated by MockGen. DO NOT EDIT.
// Source: pkg/providers/vsphere/internal/templates/factory.go
// Package mocks is a generated GoMock package.
package mocks
import (
context "context"
reflect "reflect"
executables "github.com/aws/eks-anywhere/pkg/executables"
gomock "github.com/golang/mock/gomock"
)
... | 325 |
eks-anywhere | aws | Go | // Code generated by MockGen. DO NOT EDIT.
// Source: github.com/aws/eks-anywhere/pkg/providers/vsphere (interfaces: ProviderGovcClient,ProviderKubectlClient,IPValidator,VSphereClientBuilder)
// Package mocks is a generated GoMock package.
package mocks
import (
context "context"
reflect "reflect"
v1alpha1 "githu... | 901 |
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"
"fmt"
"os"
"github.com/go-logr/logr"
"github.com/pkg/errors"
apiv1 "k8s.io/api/core/v1"
"k8s.io/klog/v2"
"sigs.k8s.io/controller-runtime/pkg/client"
anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1"
c "github.com/aws/eks-anywhere/pkg/cluster"
"github.com/aws/e... | 249 |
eks-anywhere | aws | Go | package reconciler_test
import (
"context"
"fmt"
"os"
"testing"
"time"
"github.com/golang/mock/gomock"
. "github.com/onsi/gomega"
"github.com/pkg/errors"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
vspherev1 "sigs.k8s.io/cluster-api-provider-vsphere/api/v1beta1"
clusterv1 "si... | 607 |
eks-anywhere | aws | Go | // Code generated by MockGen. DO NOT EDIT.
// Source: pkg/providers/vsphere/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"... | 131 |
eks-anywhere | aws | Go | package setupuser
import (
"context"
"encoding/json"
"fmt"
"os"
"strconv"
"github.com/aws/eks-anywhere/pkg/config"
"github.com/aws/eks-anywhere/pkg/logger"
)
const (
vSphereRootPath = "/"
)
// GovcClient specifies govc functions required to configure a vsphere user.
type GovcClient interface {
CreateUser(c... | 209 |
eks-anywhere | aws | Go | package setupuser_test
import (
"context"
"fmt"
"os"
"testing"
"github.com/golang/mock/gomock"
. "github.com/onsi/gomega"
"github.com/aws/eks-anywhere/pkg/providers/vsphere/setupuser"
"github.com/aws/eks-anywhere/pkg/providers/vsphere/setupuser/mocks"
)
type testConfig struct {
GroupExists bool
Globa... | 444 |
eks-anywhere | aws | Go | package setupuser
import (
"context"
"fmt"
"os"
"strings"
"gopkg.in/yaml.v2"
)
const (
DefaultUsername = "eksa"
DefaultGroup = "EKSAUsers"
DefaultGlobalRole = "EKSAGlobalRole"
DefaultUserRole = "EKSAUserRole"
DefaultAdminRole = "EKSACloudAdminRole"
)
type Connection struct {
Server string `ya... | 150 |
eks-anywhere | aws | Go | package setupuser_test
import (
"context"
"fmt"
"testing"
"github.com/golang/mock/gomock"
. "github.com/onsi/gomega"
"github.com/aws/eks-anywhere/pkg/providers/vsphere/setupuser"
"github.com/aws/eks-anywhere/pkg/providers/vsphere/setupuser/mocks"
)
func TestGenerateConfigReadFile(t *testing.T) {
ctx := cont... | 237 |
eks-anywhere | aws | Go | // Code generated by MockGen. DO NOT EDIT.
// Source: github.com/aws/eks-anywhere/pkg/providers/vsphere/setupuser (interfaces: GovcClient)
// Package mocks is a generated GoMock package.
package mocks
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
)
// MockGovcClient is a moc... | 151 |
eks-anywhere | aws | Go | package registry
import releasev1 "github.com/aws/eks-anywhere/release/api/v1alpha1"
// Artifact to head release dependency.
type Artifact struct {
Registry string
Repository string
Tag string
Digest string
}
// NewArtifact creates a new artifact object.
func NewArtifact(registry, repository, tag, d... | 49 |
eks-anywhere | aws | Go | package registry_test
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/aws/eks-anywhere/pkg/registry"
)
func TestArtifact_VersionTag(t *testing.T) {
artifact := registry.NewArtifact("localhost:8443", "owner/repo", "latest", "")
assert.Equal(t, ":latest", artifact.Version())
assert.Equal(t, ... | 22 |
eks-anywhere | aws | Go | package registry
// Cache storage client for an OCI registry.
type Cache struct {
registries map[string]StorageClient
}
// NewCache creates an OCI registry client.
func NewCache() *Cache {
return &Cache{
registries: make(map[string]StorageClient),
}
}
// Get cached registry client or make it.
func (cache *Cache... | 33 |
eks-anywhere | aws | Go | package registry_test
import (
"crypto/x509"
"testing"
"github.com/stretchr/testify/assert"
"github.com/aws/eks-anywhere/pkg/registry"
)
func TestCache_Get(t *testing.T) {
cache := registry.NewCache()
credentialStore := registry.NewCredentialStore()
certificates := &x509.CertPool{}
registryContext := regis... | 36 |
eks-anywhere | aws | Go | package registry
import (
"crypto/x509"
"fmt"
"os"
"path/filepath"
)
// GetCertificates get X509 certificates.
func GetCertificates(certFile string) (certificates *x509.CertPool, err error) {
if len(certFile) < 1 {
return nil, nil
}
fileContents, err := os.ReadFile(filepath.Clean(certFile))
if err != nil {
... | 24 |
eks-anywhere | aws | Go | package registry_test
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/aws/eks-anywhere/pkg/registry"
)
func TestGetCertificatesSuccess(t *testing.T) {
result, err := registry.GetCertificates("testdata/harbor.eksa.demo.crt")
assert.NotNil(t, result)
assert.NoError(t, err)
}
func TestGetCer... | 28 |
eks-anywhere | aws | Go | package registry
import (
"context"
"crypto/tls"
"fmt"
"net/http"
"path"
"sync"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"oras.land/oras-go/v2"
"oras.land/oras-go/v2/content"
orasregistry "oras.land/oras-go/v2/registry"
"oras.land/oras-go/v2/registry/remote"
"oras.land/oras-go/v2/registr... | 118 |
eks-anywhere | aws | Go | package registry_test
import (
"context"
"crypto/x509"
"testing"
"github.com/stretchr/testify/assert"
"github.com/aws/eks-anywhere/pkg/registry"
)
var (
ctx = context.Background()
image = registry.Artifact{
Registry: "public.ecr.aws",
Repository: "eks-anywhere/eks-anywhere-packages",
Digest: "s... | 60 |
eks-anywhere | aws | Go | package registry
import (
"context"
"fmt"
)
// Copy an image from a source to a destination.
func Copy(ctx context.Context, srcClient StorageClient, dstClient StorageClient, image Artifact) (err error) {
srcStorage, err := srcClient.GetStorage(ctx, image)
if err != nil {
return fmt.Errorf("repository source: %v... | 33 |
eks-anywhere | aws | Go | package registry_test
import (
"fmt"
"testing"
"github.com/golang/mock/gomock"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/stretchr/testify/assert"
"github.com/aws/eks-anywhere/pkg/registry"
"github.com/aws/eks-anywhere/pkg/registry/mocks"
)
var srcArtifact = registry.Artifact{
Re... | 104 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.