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 e2e
import (
"os"
"regexp"
e2etests "github.com/aws/eks-anywhere/test/framework"
)
const (
packagesRegex = `^.*CuratedPackages.*$`
certManagerRegex = "^.*CuratedPackagesCertManager.*$"
)
func (e *E2ESession) setupPackagesEnv(testRegex string) error {
re := regexp.MustCompile(packagesRegex)
if !re.... | 44 |
eks-anywhere | aws | Go | package e2e
import (
"fmt"
"os"
"reflect"
"regexp"
"strings"
e2etests "github.com/aws/eks-anywhere/test/framework"
)
var proxyVarsByProvider = map[string]e2etests.ProxyRequiredEnvVars{
"CloudStack": e2etests.CloudstackProxyRequiredEnvVars,
"VSphere": e2etests.VsphereProxyRequiredEnvVars,
"Tinkerbell": e2... | 43 |
eks-anywhere | aws | Go | package e2e
import (
"encoding/base64"
"fmt"
"net"
"os"
"regexp"
"github.com/go-logr/logr"
"github.com/aws/eks-anywhere/internal/pkg/ssm"
e2etests "github.com/aws/eks-anywhere/test/framework"
)
func (e *E2ESession) setupRegistryMirrorEnv(testRegex string) error {
re := regexp.MustCompile(`^.*RegistryMirror... | 95 |
eks-anywhere | aws | Go | package e2e
import (
"fmt"
"os"
"regexp"
"strconv"
"strings"
"sync"
"time"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/go-logr/logr"
"github.com/aws/eks-anywhere/internal/pkg/api"
"github.com/aws/eks-anywhere/internal/pkg/s3"
"github.com/aws/eks-anywhere/internal/pkg/ssm"
"github.com/aws/eks-any... | 485 |
eks-anywhere | aws | Go | package e2e
import (
"errors"
"fmt"
"os"
"strconv"
"strings"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/go-logr/logr"
"github.com/aws/eks-anywhere/internal/pkg/api"
"github.com/aws/eks-anywhere/internal/pkg/s3"
"github.com/aws/eks-anywhere/internal/pkg/ssm"
"github.com/aws/eks-anywhere/pkg/networ... | 297 |
eks-anywhere | aws | Go | package e2e
import (
"fmt"
"os"
"regexp"
"strings"
"sync"
"github.com/aws/eks-anywhere/internal/pkg/s3"
)
const (
snowCredentialsS3Path = "T_SNOW_CREDENTIALS_S3_PATH"
snowCertificatesS3Path = "T_SNOW_CERTIFICATES_S3_PATH"
snowDevices = "T_SNOW_DEVICES"
snowCPCidr = "T_SNOW_CONTROL_P... | 91 |
eks-anywhere | aws | Go | package e2e
import (
"context"
"fmt"
"os"
"strconv"
"time"
aws_ssm "github.com/aws/aws-sdk-go/service/ssm"
"github.com/go-logr/logr"
"gopkg.in/yaml.v2"
"github.com/aws/eks-anywhere/internal/pkg/ec2"
"github.com/aws/eks-anywhere/internal/pkg/ssm"
"github.com/aws/eks-anywhere/internal/pkg/vsphere"
"github.... | 245 |
eks-anywhere | aws | Go | package e2e
import (
"fmt"
"os"
"regexp"
"github.com/go-logr/logr"
"github.com/aws/eks-anywhere/internal/pkg/api"
"github.com/aws/eks-anywhere/internal/pkg/ssm"
e2etests "github.com/aws/eks-anywhere/test/framework"
)
const (
tinkerbellInventoryCsvFilePathEnvVar = "T_TINKERBELL_INVENTORY_CSV"
tinkerbe... | 121 |
eks-anywhere | aws | Go | package e2e
import (
"fmt"
"os"
"regexp"
"strings"
e2etests "github.com/aws/eks-anywhere/test/framework"
)
const (
vsphereCidrVar = "T_VSPHERE_CIDR"
vspherePrivateNetworkCidrVar = "T_VSPHERE_PRIVATE_NETWORK_CIDR"
vsphereRegex = `^.*VSphere.*$`
)
func (e *E2ESession) setupVSpher... | 54 |
eks-anywhere | aws | Go | package e2e
import (
"testing"
. "github.com/onsi/gomega"
)
func TestE2ESessionsetupVSphereEnv(t *testing.T) {
g := NewWithT(t)
session := E2ESession{
testEnvVars: map[string]string{},
}
t.Setenv("T_VSPHERE_DATACENTER", "my-datacenter")
t.Setenv("T_VSPHERE_TEMPLATE_UBUNTU_KUBERNETES_1_20_EKS_19", "template... | 27 |
eks-anywhere | aws | Go | package envtest
import (
"context"
"errors"
"testing"
"time"
"github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/klog/v2"
"sigs.k8s.... | 275 |
eks-anywhere | aws | Go | package envtest_test
import (
"context"
"fmt"
"testing"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client/fake"
"github.com/aws/eks-anywhere/internal/test/envtest"
)
type notFailT struct {
*testing.T
failed ... | 99 |
eks-anywhere | aws | Go | package envtest
import (
"bufio"
"fmt"
"go/build"
"os"
"path/filepath"
"regexp"
"github.com/pkg/errors"
)
type moduleWithCRD struct {
pkg string
crdPaths []string
requireRegex *regexp.Regexp
replaceRegex *regexp.Regexp
}
func mustBuildModuleWithCRDs(p string, opts ...moduleOpt) moduleWithCRD... | 162 |
eks-anywhere | aws | Go | package envtest
import (
"testing"
. "github.com/onsi/gomega"
)
func TestModuleWithCRDRegexes(t *testing.T) {
requireDirective := ` sigs.k8s.io/cluster-api v1.0.2`
replaceDirective := ` sigs.k8s.io/cluster-api => github.com/mrajashree/cluster-api v1.0.3-0.20220301005127-382d70d4a76f`
g := NewWithT(t)
m, err :=... | 31 |
eks-anywhere | aws | Go | package envtest
import (
"context"
"fmt"
"path"
"path/filepath"
goruntime "runtime"
"strings"
"testing"
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/v... | 250 |
eks-anywhere | aws | Go | // Code generated by MockGen. DO NOT EDIT.
// Source: internal/test/reader.go
// Package mocks is a generated GoMock package.
package mocks
import (
reflect "reflect"
gomock "github.com/golang/mock/gomock"
)
// MockReader is a mock of Reader interface.
type MockReader struct {
ctrl *gomock.Controller
record... | 50 |
eks-anywhere | aws | Go | package main
import (
"context"
"flag"
"os"
eksdv1alpha1 "github.com/aws/eks-distro-build-tooling/release/api/v1alpha1"
etcdv1 "github.com/aws/etcdadm-controller/api/v1beta1"
"github.com/go-logr/logr"
nutanixv1 "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1"
"github.com/spf13/pflag"... | 326 |
eks-anywhere | aws | Go | package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const AWSDatacenterKind = "AWSDatacenterConfig"
// Used for generating yaml for generate clusterconfig command.
func NewAWSDatacenterConfigGenerate(clusterName string) *AWSDatacenterConfigGenerate {
return &AWSDatacenterConfigGenerate{
Typ... | 43 |
eks-anywhere | aws | Go | package v1alpha1_test
import (
"reflect"
"testing"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
)
func TestGetAWSDatacenterConfig(t *testing.T) {
type args struct {
fileName string
}
tests := []struct {
name string
args args
want *v1alpha1.AWSD... | 72 |
eks-anywhere | aws | Go | package v1alpha1
import (
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.
// AWSDatacenterConfigSpec defines the desired state of AWSDatacenterConfig.
type AWSDatacenterConfigSpec struct {
// Important: Ru... | 94 |
eks-anywhere | aws | Go | package v1alpha1
import (
"fmt"
"github.com/aws/eks-anywhere/pkg/logger"
)
const (
AWSIamConfigKind = "AWSIamConfig"
eksConfigMap = "EKSConfigMap"
mountedFile = "MountedFile"
DefaultAWSIamConfigPartition = "aws"
)
func GetAndValidateAWSIamConfig(fileName string, refName string, clusterConfig *Cluste... | 134 |
eks-anywhere | aws | Go | package v1alpha1
import (
"reflect"
"testing"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func TestGetAndValidateAWSIamConfig(t *testing.T) {
c := &Cluster{
ObjectMeta: metav1.ObjectMeta{
Name: "eksa-unit-test-cluster",
},
}
tests := []struct {
testName string
fileName string
r... | 138 |
eks-anywhere | aws | Go | package v1alpha1
import 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.
// AWSIamConfig defines configuration options for AWS IAM Authenticator server
// AWSIamConfigSpec defines the desired state of AWSIamCon... | 125 |
eks-anywhere | aws | Go | package v1alpha1
import "testing"
func TestEqual(t *testing.T) {
tests := []struct {
testName string
aiOld *AWSIamConfig
aiNew *AWSIamConfig
wantEqual bool
}{
{
testName: "region changed",
aiOld: &AWSIamConfig{
Spec: AWSIamConfigSpec{
AWSRegion: "oldRegion",
},
},
aiNew: ... | 73 |
eks-anywhere | aws | Go | package v1alpha1
import (
"fmt"
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 is for logg... | 87 |
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 TestValidateUpdateAWSIamConfigFail(t *testing.T) {
aiOld := awsIamConfig()
aiOld.Spec.BackendMode = []string{"mode1", "mode2"}
aiNew := aiOld... | 89 |
eks-anywhere | aws | Go | package v1alpha1
import (
"fmt"
"net/url"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const CloudStackDatacenterKind = "CloudStackDatacenterConfig"
// Used for generating yaml for generate clusterconfig command.
func NewCloudStackDatacenterConfigGenerate(clusterName string) *CloudStackDatacenterConfigGenerat... | 71 |
eks-anywhere | aws | Go | package v1alpha1
import (
"reflect"
"testing"
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func TestGetCloudStackDatacenterConfig(t *testing.T) {
tests := []struct {
testName string
fileName string
wantCloudStackDatacenter *CloudStackDatacenter... | 409 |
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... | 330 |
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... | 155 |
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 TestCloudStackDatacenterDatacenterConfigSetDefaults(t *testing.T) {
g := NewWithT(t)
originalDatacenter := cloudstackDatacenterConfig()
orig... | 178 |
eks-anywhere | aws | Go | package v1alpha1
import (
"fmt"
"os"
"strings"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/yaml"
)
// DefaultCloudStackUser is the default CloudStackMachingConfig username.
const DefaultCloudStackUser = "capc"
// CloudStackMachineConfigKind is the kind value for a CloudStackMachineConfig.
const ... | 124 |
eks-anywhere | aws | Go | package v1alpha1
import (
"reflect"
"testing"
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
var cloudStackMachineConfigSpec1 = &CloudStackMachineConfigSpec{
Template: CloudStackResourceIdentifier{
Name: "template1",
},
ComputeOffering: CloudStackResourceIdentifier{
Name: "offe... | 717 |
eks-anywhere | aws | Go | package v1alpha1_test
import (
"testing"
. "github.com/onsi/gomega"
"sigs.k8s.io/yaml"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
)
func TestCloudStackMachineConfigDiskOfferingEqual(t *testing.T) {
diskOffering1 := &v1alpha1.CloudStackResourceDiskOffering{
CloudStackResourceIdentifier: v1alpha1.CloudStac... | 519 |
eks-anywhere | aws | Go | package v1alpha1
import (
"fmt"
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 is for logg... | 142 |
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 TestCloudStackMachineConfigValidateCreateValidDiskOffering(t *testing.T) {
c := cloudstackMachineConfig()
c.Spec.DiskOffering = &v1alpha1.Clou... | 552 |
eks-anywhere | aws | Go | package v1alpha1
import (
"context"
"errors"
"fmt"
"net"
"net/url"
"os"
"regexp"
"strconv"
"strings"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/validation"
utilerrors "k8s.io/apimachinery/pkg/util/errors"
"k8s.io/apimachinery/pkg/util/validation/field"
"sigs.k8s.... | 883 |
eks-anywhere | aws | Go | package v1alpha1
import (
"fmt"
"os"
"github.com/aws/eks-anywhere/pkg/constants"
"github.com/aws/eks-anywhere/pkg/logger"
"github.com/aws/eks-anywhere/pkg/utils/ptr"
)
var clusterDefaults = []func(*Cluster) error{
setRegistryMirrorConfigDefaults,
setWorkerNodeGroupDefaults,
setCNIConfigDefault,
}
func setCl... | 82 |
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/utils/ptr"
)
func TestSetClusterDefaults(t *testing.T) {
tests := []struct {
name string
in, wantCluster *Cluster
wantErr string
}{
{
name... | 262 |
eks-anywhere | aws | Go | package v1alpha1
import (
"errors"
"fmt"
"reflect"
"strings"
"testing"
. "github.com/onsi/gomega"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/aws/eks-anywhere/pkg/utils/ptr"
)
func TestValidateClusterName(t *testing.T) {
tests := []struct {
clusterName, name string
... | 3,502 |
eks-anywhere | aws | Go | package v1alpha1
import (
"fmt"
"net"
"strconv"
"strings"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
"github.com/aws/eks-anywhere/pkg/logger"
"github.com/aws/eks-anywhere/pkg/semver"
)
const (
// PausedAnnotation is an annotati... | 1,281 |
eks-anywhere | aws | Go | package v1alpha1_test
import (
"reflect"
"testing"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
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/semver"
"github.com/aws/eks-anyw... | 2,814 |
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... | 385 |
eks-anywhere | aws | Go | package v1alpha1_test
import (
"testing"
. "github.com/onsi/gomega"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
_ "k8s.io/apimachinery/pkg/runtime"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/constants"
"github.com/aws/eks-anywhere/pkg/features"
... | 2,020 |
eks-anywhere | aws | Go | package v1alpha1
// Conditions, condition reasons, and messages for the Cluster object.
const (
// ReadyCondition reports a summary of other conditions, indicating an overall operational
// state of the cluster: all control plane and worker nodes are the right version,
// all nodes are ready, not including old node... | 62 |
eks-anywhere | aws | Go | package v1alpha1
import (
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
)
type (
// ConditionType is an alias for clusterv1.ConditionType.
ConditionType = clusterv1.ConditionType
// Condition is an alias for clusterv1.Condition.
Condition = clusterv1.Condition
)
| 13 |
eks-anywhere | aws | Go | package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const DockerDatacenterKind = "DockerDatacenterConfig"
// Used for generating yaml for generate clusterconfig command.
func NewDockerDatacenterConfigGenerate(clusterName string) *DockerDatacenterConfigGenerate {
return &DockerDatacenterConfig... | 43 |
eks-anywhere | aws | Go | package v1alpha1_test
import (
"reflect"
"testing"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
)
func TestGetDockerDatacenterConfig(t *testing.T) {
type args struct {
fileName string
}
tests := []struct {
name string
args args
want *v1alpha1.D... | 68 |
eks-anywhere | aws | Go | package v1alpha1
import (
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.
// DockerDatacenterConfigSpec defines the desired state of DockerDatacenterConfig.
type DockerDatacenterConfigSpec struct { // Impor... | 100 |
eks-anywhere | aws | Go | package v1alpha1
import (
"errors"
"fmt"
"net/url"
"github.com/aws/eks-anywhere/pkg/logger"
)
const (
FluxConfigKind = "FluxConfig"
RsaAlgorithm = "rsa"
EcdsaAlgorithm = "ecdsa"
Ed25519Algorithm = "ed25519"
)
func validateFluxConfig(config *FluxConfig) error {
if config.Spec.Git != nil && config.Sp... | 109 |
eks-anywhere | aws | Go | package v1alpha1
import (
"errors"
"fmt"
"reflect"
"testing"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const (
EksaGitPrivateKeyTokenEnv = "EKSA_GIT_PRIVATE_KEY"
EksaGitKnownHostsFileEnv = "EKSA_GIT_KNOWN_HOSTS"
)
func TestValidateFluxConfig(t *testing.T) {
tests := []struct {
testName string
... | 211 |
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... | 169 |
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... | 99 |
eks-anywhere | aws | Go | package v1alpha1_test
import (
"testing"
. "github.com/onsi/gomega"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
)
func TestClusterValidateUpdateFluxRepoImmutable(t *testing.T) {
fOld := fluxConfig()
fOld.Spec.Gith... | 106 |
eks-anywhere | aws | Go | package v1alpha1
import (
"errors"
"fmt"
"regexp"
)
const (
GitOpsConfigKind = "GitOpsConfig"
FluxDefaultNamespace = "flux-system"
FluxDefaultBranch = "main"
)
func validateGitOpsConfig(config *GitOpsConfig) error {
if config == nil {
return errors.New("gitOpsRef is specified but GitOpsConfig is not ... | 73 |
eks-anywhere | aws | Go | package v1alpha1
import (
"reflect"
"testing"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func TestValidateGitOpsConfig(t *testing.T) {
tests := []struct {
testName string
gitOpsConfig *GitOpsConfig
wantErr bool
}{
{
testName: "valid gitopsconfig",
gitOpsConfig: &GitOpsConfig{
Typ... | 134 |
eks-anywhere | aws | Go | package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// GitOps defines the configurations of GitOps Toolkit and Git repository it links to.
type GitOpsConfigSpec struct {
Flux Flux `json:"flux,omitempty"`
}
// Flux defines the Git repository options for Flux v2.
type Flux struct {
// github i... | 145 |
eks-anywhere | aws | Go | package v1alpha1
import (
"fmt"
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 is for logg... | 75 |
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 TestClusterValidateUpdateGitOpsRepoImmutable(t *testing.T) {
gOld := gitOpsConfig()
gOld.Spec.Flux.Github.Repository = "oldRepo"
c := gOld.De... | 50 |
eks-anywhere | aws | Go | // Package v1alpha1 contains API Schema definitions for the anywhere v1alpha1 API group
// +kubebuilder:object:generate=true
// +groupName=anywhere.eks.amazonaws.com
package v1alpha1
import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)
var (
// GroupVersion is group versi... | 21 |
eks-anywhere | aws | Go | package v1alpha1
import (
"crypto/x509"
"encoding/pem"
"fmt"
"net"
"net/url"
"strings"
"github.com/pkg/errors"
"sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1"
)
func validateHostOSConfig(config *HostOSConfiguration, osFamily OSFamily) error {
if config == nil {
return nil
}
if err := validateNT... | 183 |
eks-anywhere | aws | Go | package v1alpha1
import (
"testing"
. "github.com/onsi/gomega"
"sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1"
)
func TestValidateHostOSConfig(t *testing.T) {
tests := []struct {
name string
hostOSConfig *HostOSConfiguration
osFamily OSFamily
wantErr string
}{
{
name: ... | 423 |
eks-anywhere | aws | Go | package v1alpha1
import "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1"
// HostOSConfiguration defines the configuration settings on the host OS.
type HostOSConfiguration struct {
// +optional
NTPConfiguration *NTPConfiguration `json:"ntpConfiguration,omitempty"`
// +optional
BottlerocketConfiguration *B... | 45 |
eks-anywhere | aws | Go | package v1alpha1
import "fmt"
type OSFamily string
const (
Ubuntu OSFamily = "ubuntu"
Bottlerocket OSFamily = "bottlerocket"
RedHat OSFamily = "redhat"
)
// UserConfiguration defines the configuration of the user to be added to the VM.
type UserConfiguration struct {
Name string `json... | 45 |
eks-anywhere | aws | Go | package v1alpha1
// Marshallable represents all "generate" CRDs structs
// +kubebuilder:object:generate=false
type Marshallable interface{}
| 6 |
eks-anywhere | aws | Go | package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/aws/eks-anywhere/pkg/constants"
)
const NutanixDatacenterKind = "NutanixDatacenterConfig"
// NewNutanixDatacenterConfigGenerate is used for generating yaml for generate clusterconfig command.
func NewNutanixDatacenterConfigGenerat... | 53 |
eks-anywhere | aws | Go | package v1alpha1_test
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/yaml"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/constants"
)
func TestGetNutanixDatacenterConfig... | 205 |
eks-anywhere | aws | Go | // Important: Run "make generate" to regenerate code after modifying this file
// json tags are required; new fields must have json tags for the fields to be serialized
package v1alpha1
import (
"crypto/x509"
"encoding/pem"
"errors"
"fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/aws/eks-anywh... | 178 |
eks-anywhere | aws | Go | package v1alpha1
import (
"fmt"
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"
)
// nutanixdatacent... | 116 |
eks-anywhere | aws | Go | package v1alpha1_test
import (
"os"
"testing"
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/aws/eks-anywhere/internal/test/envtest"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/constants"
)
func TestNutanixDatacenterConfigWebhooksValid... | 124 |
eks-anywhere | aws | Go | package v1alpha1
import (
"fmt"
"os"
"strings"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/yaml"
)
// NutanixIdentifierType is an enumeration of different resource identifier types.
type NutanixIdentifierType string
func (c NutanixIdentifierType) String() ... | 279 |
eks-anywhere | aws | Go | package v1alpha1
import (
"fmt"
"reflect"
"testing"
"github.com/aws/smithy-go/ptr"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/yaml"
)
func TestGetNutanixMachineConfigsInvalidConf... | 294 |
eks-anywhere | aws | Go | // Important: Run "make generate" to regenerate code after modifying this file
// json tags are required; new fields must have json tags for the fields to be serialized
package v1alpha1
import (
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
capiv1... | 230 |
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"
)
var nut... | 145 |
eks-anywhere | aws | Go | package v1alpha1_test
import (
"testing"
. "github.com/onsi/gomega"
"k8s.io/apimachinery/pkg/api/resource"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/features"
"github.com/aws/eks-anywhere/pkg/utils/ptr"
)
func nutanixMachineConfi... | 335 |
eks-anywhere | aws | Go | package v1alpha1
// Need to override metav1.ObjectMeta as a hack due to the following issue of creationTimestamp being printed:
// https://github.com/kubernetes/kubernetes/issues/86811
// Add more fields based on https://github.com/kubernetes/apimachinery/blob/master/pkg/apis/meta/v1/types.go#L114-L288
// and https://... | 13 |
eks-anywhere | aws | Go | package v1alpha1
import (
"fmt"
"net/url"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/util/validation/field"
)
const OIDCConfigKind = "OIDCConfig"
func GetAndValidateOIDCConfig(fileName string, refName string, clusterConfig *Cluster) (*OIDCConfig, error) {
config, err := getOIDCConf... | 99 |
eks-anywhere | aws | Go | package v1alpha1
import (
"reflect"
"testing"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func TestGetAndValidateOIDCConfig(t *testing.T) {
tests := []struct {
testName string
fileName string
refName string
wantOIDCConfig *OIDCConfig
wantErr bool
}{
{
testName: ... | 109 |
eks-anywhere | aws | Go | package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/validation/field"
)
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// OIDCConfig defines an OpenID Connect (OIDCConfigSpec) identity provider configura... | 168 |
eks-anywhere | aws | Go | package v1alpha1
import (
"fmt"
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 is for logg... | 87 |
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 TestValidateCreateOIDCConfigSuccess(t *testing.T) {
c := oidcConfig()
c.Spec.ClientId = "test"
c.Spec.IssuerUrl = "https://test.com"
o := Ne... | 296 |
eks-anywhere | aws | Go | package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const SnowDatacenterKind = "SnowDatacenterConfig"
// Used for generating yaml for generate clusterconfig command.
func NewSnowDatacenterConfigGenerate(clusterName string) *SnowDatacenterConfigGenerate {
return &SnowDatacenterConfigGenerate{
... | 43 |
eks-anywhere | aws | Go | package v1alpha1
import (
"testing"
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func TestGetSnowDatacenterConfig(t *testing.T) {
tests := []struct {
name string
fileName string
want *SnowDatacenterConfig
wantErr string
}{
{
name: "file doesn't exist",
... | 121 |
eks-anywhere | aws | Go | package v1alpha1
import (
"fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const (
SnowIdentityKind = "Secret"
SnowCredentialsKey = "credentials"
SnowCertificatesKey = "ca-bundle"
)
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// SnowDa... | 119 |
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... | 58 |
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 TestSnowDatacenterConfigValidateCreateValid(t *testing.T) {
g := NewWithT(t)
snowDC := snowDatacenterConfig()
snowDC.Spec.IdentityRef.Name =... | 86 |
eks-anywhere | aws | Go | package v1alpha1
import (
"bytes"
"fmt"
"net"
)
const (
// SnowIPPoolKind is the object kind name for SnowIPPool.
SnowIPPoolKind = "SnowIPPool"
)
// SnowIPPoolsSliceEqual compares and returns whether two snow IPPool objects are equal.
func SnowIPPoolsSliceEqual(a, b []IPPool) bool {
if len(a) != len(b) {
ret... | 94 |
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 TestSnowIPPoolConvertConfigToConfigGenerateStruct(t *testing.T) {
g := NewWithT(t)
s := &v1alpha1.SnowIPPool{
TypeMeta: metav1.TypeMeta{
... | 266 |
eks-anywhere | aws | Go | package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// SnowIPPoolSpec defines the desired state of SnowIPPool.
type SnowIPPoolSpec struct {
// IPPools defines a list of ip pool for the DNI.
Pools []IPPool `json:"pools,omitempty"`
}
// IPPool defines an ip pool with ip range, subnet and gatew... | 89 |
eks-anywhere | aws | Go | package v1alpha1
import (
"fmt"
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 is for logg... | 69 |
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 TestSnowIPPoolValidateCreate(t *testing.T) {
g := NewWithT(t)
new := snowIPPool()
g.Expect(new.ValidateCreate()).To(Succeed())
}
func TestSn... | 130 |
eks-anywhere | aws | Go | package v1alpha1
import (
"errors"
"fmt"
"regexp"
"strings"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/aws/eks-anywhere/pkg/logger"
snowv1 "github.com/aws/eks-anywhere/pkg/providers/snow/api/v1beta1"
)
const (
SnowMachineConfigKind = "SnowMachineConfig"
DefaultSnowSSHKeyNam... | 184 |
eks-anywhere | aws | Go | package v1alpha1
import (
"testing"
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1"
snowv1 "github.com/aws/eks-anywhere/pkg/providers/snow/api/v1beta1"
)
func TestSnowMachineConfigSetDefaults(t *testing.T) {
tests := []struct {
... | 655 |
eks-anywhere | aws | Go | package v1alpha1
import (
"github.com/pkg/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
snowv1 "github.com/aws/eks-anywhere/pkg/providers/snow/api/v1beta1"
)
const (
SFPPlus PhysicalNetworkConnectorType = "SFP_PLUS"
QSFP PhysicalNetworkConnectorType = "QSFP"
RJ45 PhysicalNetworkConnectorType = "R... | 217 |
eks-anywhere | aws | Go | package v1alpha1_test
import (
"testing"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
)
func TestSnowMachineConfigIPPoolRefs(t *testing.T) {
m := &v1alpha1.SnowMachineConfig{
Spec: v1alpha1.SnowMachineConfigSpec{
Network: v1alpha1.SnowNetwork{
DirectNetworkInterfaces: []v1alpha1.SnowDirectNetworkInterf... | 54 |
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... | 77 |
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"
snowv1 "github.com/aws/eks-anywhere/pkg/providers/snow/api/v1beta1"
)
func TestSnowMachineConfigSetDefaults(t *testing.T) {
g := NewWithT(t)
sOld :... | 172 |
eks-anywhere | aws | Go | package v1alpha1
import (
"errors"
"fmt"
"net/url"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/aws/eks-anywhere/pkg/networkutils"
)
const TinkerbellDatacenterKind = "TinkerbellDatacenterConfig"
// Used for generating yaml for generate clusterconfig command.
func NewTinkerbellDatacenterConfigGene... | 85 |
eks-anywhere | aws | Go | package v1alpha1
import (
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.
// Important: Run "make generate" to regenerate code after modifying this file
// TinkerbellDatacenterConfigSpec defines the desired... | 117 |
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 TestTinkerbellDatacenterConfigValidateFail(t *testing.T) {
tests := []struct {
name string
tinkDC *v1alpha1.TinkerbellDatacenterConfig
... | 99 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.