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
ec2-macos-init
aws
Go
package ec2macosinit import ( "bufio" _ "embed" "fmt" "log" "os" "strconv" "strings" "sync" "sync/atomic" "time" ) const ( // ConfigurationManagementWarning is a header warning for sshd_config ConfigurationManagementWarning = "### This file is managed by EC2 macOS Init, changes will be applied on every bo...
479
ec2-macos-init
aws
Go
package ec2macosinit import ( "bytes" "encoding/base64" "fmt" "io" "net/http" "os" "path/filepath" "strings" ) // UserDataModule contains contains all necessary configuration fields for running a User Data module. type UserDataModule struct { // ExecuteUserData must be set to `true` for the userdata script c...
97
ec2-macos-init
aws
Go
package ec2macosinit import ( "fmt" "io" "testing" "github.com/stretchr/testify/assert" ) func TestUserdataReader_ValidTexts(t *testing.T) { const expected = "hello, world!" texts := []string{ "aGVsbG8sIHdvcmxkIQ==", // printf 'hello, world!' | base64 -w0 "hello, world!", } for i, text := range texts { ...
27
ec2-macos-init
aws
Go
package ec2macosinit import ( "crypto/rand" "encoding/base64" "fmt" "path/filepath" "strings" ) const ( // PasswordLength is the default number of characters that the auto-generated password should be PasswordLength = 25 // DsclPath is the default path for the dscl utility needed for the functions in this fil...
186
ec2-macos-init
aws
Go
package ec2macosinit import ( "testing" ) func TestUserManagementModule_Do(t *testing.T) { var emptyCtx ModuleContext type fields struct { RandomizePassword bool User string } type args struct { ctx *ModuleContext } tests := []struct { name string fields fields args ...
115
ec2-macos-init
aws
Go
package ec2macosinit import ( "bytes" "fmt" "io" "os" "os/exec" "os/user" "strconv" "strings" "syscall" "time" ) // ioReadCloserToString converts an io.ReadCloser to a string. func ioReadCloserToString(iorc io.ReadCloser) (str string, err error) { buf := new(bytes.Buffer) _, err = buf.ReadFrom(iorc) if e...
197
ec2-macos-init
aws
Go
package ec2macosinit import ( "fmt" "io" "strings" "testing" "time" "github.com/stretchr/testify/assert" ) func Test_ioReadCloserToString(t *testing.T) { expected := "test string" input := io.NopCloser(strings.NewReader(expected)) out, err := ioReadCloserToString(input) assert.NoError(t, err) assert.Equa...
64
ec2-macos-system-monitor
aws
Go
package main import ( "flag" "log" "os" "os/signal" "strconv" "sync/atomic" "syscall" "time" ec2sm "github.com/aws/ec2-macos-system-monitor/lib/ec2macossystemmonitor" ) // pollInterval is the duration in between gathering of CPU metrics const pollInterval = 60 * time.Second // DefaultSerialDevice is the de...
100
ec2-macos-system-monitor
aws
Go
package ec2macossystemmonitor import ( "fmt" "github.com/shirou/gopsutil/cpu" "strconv" ) // RunningCpuUsage gathers the value expected for CloudWatch but allows long running measurement. This is intended for // usage where repeated calls will take place. func RunningCpuUsage() (s string, err error) { percent, er...
18
ec2-macos-system-monitor
aws
Go
package ec2macossystemmonitor import ( "fmt" "log" "log/syslog" "os" ) // Logger contains booleans for where to log, a tag used in syslog and the syslog Writer itself. type Logger struct { LogToStdout bool LogToSystemLog bool Tag string SystemLog syslog.Writer } // defaultLogInterval is th...
137
ec2-macos-system-monitor
aws
Go
package ec2macossystemmonitor import ( "bytes" "compress/zlib" "encoding/base64" "encoding/json" "fmt" "hash/adler32" "net" "os" "sync/atomic" "time" ) const SocketTimeout = 5 * time.Second // BuildMessage takes a tag along with data for the tag and builds a byte slice to be sent to the relay. // // The t...
213
ec2-macos-system-monitor
aws
Go
package ec2macossystemmonitor import ( "reflect" "testing" ) // TestBuildMessage creates some basic tests to ensure the options result in the correct bytes func TestBuildMessage(t *testing.T) { // emptyTestBytes is the byte slice of a payload tag "test" and empty payload emptyTestBytes := []byte{123, 34, 99, 115,...
44
ec2-macos-system-monitor
aws
Go
package ec2macossystemmonitor import ( "bytes" "fmt" "io" "net" "go.bug.st/serial" ) // SocketPath is the default socket for relayd. const SocketPath = "/tmp/.ec2monitoring.sock" // SerialConnection is the container for passing the ReadWriteCloser for serial connections. type SerialConnection struct { port se...
91
ec2-macos-system-monitor
aws
Go
package ec2macossystemmonitor import ( "os" ) // fileExists returns true if a file exists and is not a directory. func fileExists(filename string) bool { info, err := os.Stat(filename) if os.IsNotExist(err) { return false } return !info.IsDir() }
15
ec2-macos-system-monitor
aws
Go
package ec2macossystemmonitor import ( "runtime" "testing" ) // Test_fileExists tests the fileExists helper function with basic coverage func Test_fileExists(t *testing.T) { _, testFile, _, _ := runtime.Caller(0) type args struct { filename string } tests := []struct { name string args args want bool }...
29
ec2-macos-utils
aws
Go
package main import ( "context" "fmt" "os" "github.com/aws/ec2-macos-utils/internal/cmd" "github.com/aws/ec2-macos-utils/internal/contextual" "github.com/aws/ec2-macos-utils/internal/system" ) func main() { sys, err := system.Scan() if err != nil { panic(fmt.Errorf("cannot identify system: %w", err)) } p...
29
ec2-macos-utils
aws
Go
package build const ( // GitHubLink is the static HTTPS URL for EC2 macOS Utils public GitHub repository. GitHubLink = "https://github.com/aws/ec2-macos-utils" ) var ( // CommitDate is the date of the latest commit in the repository. This variable gets set at build-time. CommitDate string // Version is the late...
15
ec2-macos-utils
aws
Go
// Package tools holds references to build time tools and is not intended to be // imported for use. package tools
4
ec2-macos-utils
aws
Go
// +build tools package tools // goimports: golang.org/x/tools/cmd/goimports import _ "golang.org/x/tools/cmd/goimports"
7
ec2-macos-utils
aws
Go
package cmd import ( "errors" "fmt" "strings" "github.com/dustin/go-humanize" "github.com/sirupsen/logrus" "github.com/spf13/cobra" "github.com/aws/ec2-macos-utils/internal/contextual" "github.com/aws/ec2-macos-utils/internal/diskutil" "github.com/aws/ec2-macos-utils/internal/diskutil/identifier" "github.c...
144
ec2-macos-utils
aws
Go
package cmd import ( "fmt" "io/ioutil" "testing" mock_diskutil "github.com/aws/ec2-macos-utils/internal/diskutil/mocks" "github.com/aws/ec2-macos-utils/internal/diskutil/types" "github.com/golang/mock/gomock" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" ) func init() { logrus.SetOutput...
336
ec2-macos-utils
aws
Go
// Package cmd provides the functionality necessary for CLI commands in EC2 macOS Utils. package cmd import ( "errors" "fmt" "os" "strings" "time" "github.com/sirupsen/logrus" "github.com/spf13/cobra" "github.com/aws/ec2-macos-utils/internal/build" ) const shortLicenseText = "Copyright Amazon.com, Inc. or i...
99
ec2-macos-utils
aws
Go
package main import ( "os" "github.com/sirupsen/logrus" "github.com/spf13/cobra/doc" "github.com/aws/ec2-macos-utils/internal/cmd" ) func main() { outdir := "./docs" args := os.Args if len(args) >= 2 { outdir = args[1] } logrus.WithField("outdir", outdir).Info("generating docs") if err := os.MkdirAll(...
31
ec2-macos-utils
aws
Go
package contextual import ( "context" "github.com/aws/ec2-macos-utils/internal/system" ) // productKey is used to set and retrieve context held values for Product. var productKey = struct{}{} // WithProduct extends the context to provide a Product. func WithProduct(ctx context.Context, product *system.Product) co...
28
ec2-macos-utils
aws
Go
package diskutil import ( "fmt" "io" "github.com/aws/ec2-macos-utils/internal/diskutil/types" "howett.net/plist" ) // Decoder outlines the functionality necessary for decoding plist output from the macOS diskutil command. type Decoder interface { // DecodeSystemPartitions takes an io.ReadSeeker for the raw pli...
55
ec2-macos-utils
aws
Go
package diskutil import ( _ "embed" "strings" "testing" "github.com/aws/ec2-macos-utils/internal/diskutil/types" "github.com/stretchr/testify/assert" ) var ( //go:embed testdata/decoder/broken_disk_info.plist // decoderBrokenDiskInfo contains a disk plist file that is missing the plist header. decoderBroken...
210
ec2-macos-utils
aws
Go
// Package diskutil provides the functionality necessary for interacting with macOS's diskutil CLI. package diskutil //go:generate mockgen -source=diskutil.go -destination=mocks/mock_diskutil.go import ( "errors" "fmt" "strings" "github.com/aws/ec2-macos-utils/internal/diskutil/types" "github.com/aws/ec2-macos-...
335
ec2-macos-utils
aws
Go
package diskutil import ( "fmt" "testing" "github.com/stretchr/testify/assert" ) func TestMinimumGrowSpaceError_Error(t *testing.T) { const expectedSize uint64 = 0 e := FreeSpaceError{ freeSpaceBytes: expectedSize, } expectedErrorMessage := fmt.Sprintf("%d bytes available", 0) actualErrorMessage := e.Er...
23
ec2-macos-utils
aws
Go
package diskutil import ( "errors" "fmt" "github.com/aws/ec2-macos-utils/internal/diskutil/types" "github.com/dustin/go-humanize" "github.com/sirupsen/logrus" ) // GrowContainer grows a container to its maximum size by performing the following operations: // 1. Verify that the given types.DiskInfo is an APFS...
141
ec2-macos-utils
aws
Go
package diskutil import ( "fmt" "io/ioutil" "testing" mock_diskutil "github.com/aws/ec2-macos-utils/internal/diskutil/mocks" "github.com/aws/ec2-macos-utils/internal/diskutil/types" "github.com/golang/mock/gomock" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" ) func init() { logrus.SetO...
536
ec2-macos-utils
aws
Go
package diskutil import ( "fmt" "regexp" "github.com/aws/ec2-macos-utils/internal/diskutil/types" "github.com/aws/ec2-macos-utils/internal/util" ) // updatePhysicalStores provides separate functionality for fetching APFS physical stores for SystemPartitions. func updatePhysicalStores(partitions *types.SystemPart...
91
ec2-macos-utils
aws
Go
package diskutil import ( "fmt" "github.com/aws/ec2-macos-utils/internal/util" ) // UtilImpl outlines the functionality necessary for wrapping macOS's diskutil tool. The methods are intentionally // named to correspond to diskutil(8)'s subcommand names as its API. type UtilImpl interface { // APFSImpl outlines th...
108
ec2-macos-utils
aws
Go
package identifier import ( "regexp" "strings" ) // diskIDExp is the regexp expression for device identifiers. var diskIDExp = regexp.MustCompile("disk[0-9]+") // ParseDiskID parses a supported disk identifier from a string. func ParseDiskID(s string) string { if strings.TrimSpace(s) == "" { return "" } retur...
18
ec2-macos-utils
aws
Go
package identifier import ( "testing" "github.com/stretchr/testify/assert" ) func TestParseDiskID(t *testing.T) { type args struct { s string } tests := []struct { name string args args want string }{ { name: "with empty input", args: args{ s: "", }, want: "", }, { name: "witho...
55
ec2-macos-utils
aws
Go
// Code generated by MockGen. DO NOT EDIT. // Source: diskutil.go // Package mock_diskutil is a generated GoMock package. package mock_diskutil import ( reflect "reflect" types "github.com/aws/ec2-macos-utils/internal/diskutil/types" gomock "github.com/golang/mock/gomock" ) // MockDiskUtil is a mock of DiskUtil ...
134
ec2-macos-utils
aws
Go
package types import ( "fmt" "strings" "github.com/aws/ec2-macos-utils/internal/diskutil/identifier" ) // DiskInfo mirrors the output format of the command "diskutil info -plist <disk>" to store information about a disk. type DiskInfo struct { ContainerInfo AESHardware bool ...
148
ec2-macos-utils
aws
Go
package types import ( "testing" "github.com/stretchr/testify/assert" ) func TestDiskInfo_parentDeviceID(t *testing.T) { type args struct { disk *DiskInfo } tests := []struct { name string args args wantId string wantErr bool }{ { name: "Bad case: no APFS physical stores", args: args{ ...
83
ec2-macos-utils
aws
Go
package types import ( "fmt" "strings" ) // SystemPartitions mirrors the output format of the command "diskutil list -plist" to store all disk // and partition information. type SystemPartitions struct { AllDisks []string `plist:"AllDisks"` AllDisksAndPartitions []DiskPart `plist:"AllDisksAndPartit...
88
ec2-macos-utils
aws
Go
package types import ( "testing" "github.com/stretchr/testify/assert" ) func TestSystemPartitions_AvailableDiskSpace_WithoutTargetDisk(t *testing.T) { const ( testDiskID = "disk3" // should see 0 since testDiskID isn't in AllDisksAndPartitions expectedAvailableSize uint64 = 0 ) p := &SystemPartitions{ ...
61
ec2-macos-utils
aws
Go
package system import ( "fmt" "github.com/Masterminds/semver" ) // Release is used to define macOS releases in an enumerated constant (e.g. Mojave, Catalina, BigSur) type Release uint8 const ( Unknown Release = iota Mojave Catalina BigSur Monterey Ventura CompatMode ) func (r Release) String() string { s...
112
ec2-macos-utils
aws
Go
// Package system provides the functionality necessary for interacting with the macOS system. package system import ( "fmt" "io" "os" "howett.net/plist" ) const ( // versionPath is the path on the root filesystem to the SystemVersion plist versionPath = "/System/Library/CoreServices/SystemVersion.plist" // d...
119
ec2-macos-utils
aws
Go
package util import ( "bytes" "fmt" "io" "os" "os/exec" "os/user" "strconv" "strings" "syscall" ) // CommandOutput wraps the output from an exec command as strings. type CommandOutput struct { Stdout string Stderr string } // ExecuteCommand executes the command and returns Stdout and Stderr as strings. fu...
168
eks-anywhere
aws
Go
package main import ( "os" "github.com/aws/eks-anywhere/cmd/eks-a-tool/cmd" ) func main() { if cmd.Execute() == nil { os.Exit(0) } os.Exit(-1) }
15
eks-anywhere
aws
Go
package cmd import ( "github.com/spf13/cobra" ) var cloudstackCmd = &cobra.Command{ Use: "cloudstack", Short: "CloudStack commands", Long: "Use eks-a-tool cloudstack to run cloudstack utilities", } func init() { rootCmd.AddCommand(cloudstackCmd) }
16
eks-anywhere
aws
Go
package cmd import ( "github.com/spf13/cobra" ) var cloudstackRmCmd = &cobra.Command{ Use: "rm", Short: "CloudStack rm commands", Long: "Use eks-a-tool cloudstack rm to run cloudstack rm utilities", } func init() { cloudstackCmd.AddCommand(cloudstackRmCmd) }
16
eks-anywhere
aws
Go
package cmd import ( "log" "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/aws/eks-anywhere/internal/test/cleanup" "github.com/aws/eks-anywhere/pkg/validations" ) const dryRunFlag = "dry-run" var cloudstackRmVmsCmd = &cobra.Command{ Use: "vms <cluster-name>", PreRun: prerunCmdBindFlags, Sh...
46
eks-anywhere
aws
Go
package cmd import ( "github.com/spf13/cobra" ) var conformanceCmd = &cobra.Command{ Use: "conformance", Short: "Conformance tests", Long: "Use eks-a-tool conformance to run conformance tests", } func init() { rootCmd.AddCommand(conformanceCmd) }
16
eks-anywhere
aws
Go
package cmd import ( "log" "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/aws/eks-anywhere/internal/pkg/conformance" ) var conformanceDownloadCmd = &cobra.Command{ Use: "download", Short: "Conformance download command", Long: "This command downloads the conformance test suite", RunE: func(...
32
eks-anywhere
aws
Go
package cmd import ( "log" "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/aws/eks-anywhere/internal/pkg/conformance" ) var conformanceTestCmd = &cobra.Command{ Use: "test <cluster-context>", Short: "Conformance test command", Long: "This command run the conformance tests", RunE: func(cmd *...
36
eks-anywhere
aws
Go
package cmd import ( "fmt" "path" "path/filepath" "strings" "github.com/spf13/cobra" "github.com/spf13/cobra/doc" anywhere "github.com/aws/eks-anywhere/cmd/eksctl-anywhere/cmd" ) const fmTemplate = `--- title: "%s" linkTitle: "%s" --- ` var cmdDocPath string var docgenCmd = &cobra.Command{ Use: "docge...
59
eks-anywhere
aws
Go
package cmd import ( "github.com/spf13/cobra" ) var nutanixCmd = &cobra.Command{ Use: "nutanix", Short: "Nutanix commands", Long: "Use eks-a-tool nutanix to run nutanix utilities", } func init() { rootCmd.AddCommand(nutanixCmd) }
16
eks-anywhere
aws
Go
package cmd import ( "github.com/spf13/cobra" ) var nutanixRmCmd = &cobra.Command{ Use: "rm", Short: "Nutanix rm commands", Long: "Use eks-a-tool nutanix rm to run nutanix rm utilities", } func init() { nutanixCmd.AddCommand(nutanixRmCmd) }
16
eks-anywhere
aws
Go
package cmd import ( "log" "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/aws/eks-anywhere/internal/test/cleanup" "github.com/aws/eks-anywhere/pkg/validations" ) const ( endpointFlag = "endpoint" portFlag = "port" insecureFlag = "insecure" ignoreErrorsFlag = "ignoreErrors" ) ...
54
eks-anywhere
aws
Go
package cmd import ( "fmt" "log" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" "github.com/aws/eks-anywhere/pkg/logger" ) var rootCmd = &cobra.Command{ Use: "eks-a-tool", Short: "Amazon EKS Anywhere Tool", Long: `Use eks-a-tool to validate yo...
56
eks-anywhere
aws
Go
package cmd import ( "context" "fmt" "log" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" "github.com/aws/eks-anywhere/pkg/networkutils" ) var uniqueIpCmd = &cobra.Command{ Use: "unique-ip", Short: "Unique IP", Long: "Generate a random unique IP to be used for control pla...
53
eks-anywhere
aws
Go
package cmd import ( "context" "fmt" "log" "github.com/spf13/cobra" "github.com/aws/eks-anywhere/pkg/executables" "github.com/aws/eks-anywhere/pkg/types" "github.com/aws/eks-anywhere/pkg/validations" ) var validateClusterCmd = &cobra.Command{ Use: "validate-cluster <cluster-name> <kubeconfig>", Short: "V...
68
eks-anywhere
aws
Go
package cmd import ( "context" "fmt" "log" "github.com/spf13/cobra" "github.com/aws/eks-anywhere/pkg/executables" ) var versionsCmd = &cobra.Command{ Use: "versions", Short: "Get cluster versions", Long: "Get the versions of images in cluster", RunE: func(cmd *cobra.Command, args []string) error { err...
40
eks-anywhere
aws
Go
package cmd import ( "github.com/spf13/cobra" ) var vsphereCmd = &cobra.Command{ Use: "vsphere", Short: "VSphere commands", Long: "Use eks-a-tool vsphere to run vsphere utilities", } func init() { rootCmd.AddCommand(vsphereCmd) }
16
eks-anywhere
aws
Go
package cmd import ( "context" "fmt" "log" "os" "path/filepath" "strconv" "strings" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" "sigs.k8s.io/yaml" "github.com/aws/eks-anywhere/pkg/api/v1alpha1" "github.com/aws/eks-anywhere/pkg/filewriter" "github.com/aws/eks-anywhere/pkg/...
147
eks-anywhere
aws
Go
package cmd import ( "bytes" "context" "crypto/tls" "fmt" "io" "log" "net/http" "strings" "github.com/spf13/cobra" "github.com/spf13/viper" ) var sessions []string var vsphereSessionRmCommand = &cobra.Command{ Use: "sessions", Short: "vsphere logout sessions command", Long: "This command logs out...
126
eks-anywhere
aws
Go
package cmd import ( "github.com/spf13/cobra" ) var vsphereRmCmd = &cobra.Command{ Use: "rm", Short: "VSphere rm commands", Long: "Use eks-a-tool vsphere rm to run vsphere rm utilities", } func init() { vsphereCmd.AddCommand(vsphereRmCmd) }
16
eks-anywhere
aws
Go
package cmd import ( "context" "fmt" "log" "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/aws/eks-anywhere/pkg/executables" "github.com/aws/eks-anywhere/pkg/filewriter" "github.com/aws/eks-anywhere/pkg/validations" ) var vsphereRmVmsCmd = &cobra.Command{ Use: "vms <cluster-name>", Short: ...
60
eks-anywhere
aws
Go
package main import ( "fmt" "os" "os/signal" "syscall" "github.com/aws/eks-anywhere/cmd/eksctl-anywhere/cmd" "github.com/aws/eks-anywhere/pkg/eksctl" "github.com/aws/eks-anywhere/pkg/logger" ) func main() { sigChannel := make(chan os.Signal, 1) signal.Notify(sigChannel, syscall.SIGINT, syscall.SIGTERM) go ...
34
eks-anywhere
aws
Go
package cmd import "github.com/spf13/cobra" var applyCmd = &cobra.Command{ Use: "apply", Short: "Apply resources", Long: "Use eksctl anywhere apply to apply resources", } func init() { rootCmd.AddCommand(applyCmd) }
14
eks-anywhere
aws
Go
package cmd import ( "context" "fmt" "log" "github.com/spf13/cobra" "github.com/aws/eks-anywhere/pkg/curatedpackages" "github.com/aws/eks-anywhere/pkg/kubeconfig" ) type applyPackageOptions struct { fileName string // kubeConfig is an optional kubeconfig file to use when querying an // existing cluster. k...
77
eks-anywhere
aws
Go
package cmd import ( "context" "fmt" "log" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" "github.com/aws/eks-anywhere/cmd/eksctl-anywhere/cmd/internal/commands/artifacts" "github.com/aws/eks-anywhere/pkg/logger" "github.com/aws/eks-anywhere/pkg/registrymirror" "github.com/aws/e...
76
eks-anywhere
aws
Go
package cmd import ( "context" "fmt" "os" "github.com/aws/eks-anywhere/pkg/dependencies" "github.com/aws/eks-anywhere/pkg/logger" "github.com/aws/eks-anywhere/pkg/types" ) func cleanup(deps *dependencies.Dependencies, commandErr *error) { if *commandErr == nil { deps.Writer.CleanUpTemp() } } func close(ct...
30
eks-anywhere
aws
Go
package cmd import ( "context" "github.com/aws/eks-anywhere/pkg/cluster" "github.com/aws/eks-anywhere/pkg/dependencies" "github.com/aws/eks-anywhere/pkg/executables" "github.com/aws/eks-anywhere/pkg/kubeconfig" "github.com/aws/eks-anywhere/pkg/version" "github.com/aws/eks-anywhere/release/api/v1alpha1" ) func...
107
eks-anywhere
aws
Go
package cmd const ( imagesTarFile = "images.tar" eksaToolsImageTarFile = "tools-image.tar" cpWaitTimeoutFlag = "control-plane-wait-timeout" externalEtcdWaitTimeoutFlag = "external-etcd-wait-timeout" perMachineWaitTimeoutFlag = "per-machine-wait-timeout" unhealthyMachineTimeoutFlag...
21
eks-anywhere
aws
Go
package cmd import ( "github.com/spf13/cobra" ) // importCmd represents the import command. var copyCmd = &cobra.Command{ Use: "copy", Short: "Copy resources", Long: "Copy EKS Anywhere resources and artifacts", } func init() { rootCmd.AddCommand(copyCmd) }
17
eks-anywhere
aws
Go
package cmd import ( "context" "fmt" "log" "os" "github.com/spf13/cobra" "github.com/aws/eks-anywhere/pkg/config" "github.com/aws/eks-anywhere/pkg/curatedpackages" "github.com/aws/eks-anywhere/pkg/dependencies" "github.com/aws/eks-anywhere/pkg/manifests/bundles" "github.com/aws/eks-anywhere/pkg/registry" )...
147
eks-anywhere
aws
Go
package cmd import ( "github.com/spf13/cobra" ) var createCmd = &cobra.Command{ Use: "create", Short: "Create resources", Long: "Use eksctl anywhere create to create resources, such as clusters", } func init() { rootCmd.AddCommand(createCmd) }
16
eks-anywhere
aws
Go
package cmd import ( "fmt" "log" "github.com/spf13/cobra" "github.com/aws/eks-anywhere/pkg/api/v1alpha1" "github.com/aws/eks-anywhere/pkg/awsiamauth" "github.com/aws/eks-anywhere/pkg/clustermanager" "github.com/aws/eks-anywhere/pkg/dependencies" "github.com/aws/eks-anywhere/pkg/executables" "github.com/aws/...
190
eks-anywhere
aws
Go
package cmd import ( "context" "fmt" "log" "github.com/spf13/cobra" "github.com/aws/eks-anywhere/pkg/curatedpackages" "github.com/aws/eks-anywhere/pkg/kubeconfig" ) type createPackageOptions struct { fileName string // kubeConfig is an optional kubeconfig file to use when querying an // existing cluster. ...
76
eks-anywhere
aws
Go
package cmd import ( "github.com/spf13/cobra" ) var deleteCmd = &cobra.Command{ Use: "delete", Short: "Delete resources", Long: "Use eksctl anywhere delete to delete clusters", } func init() { rootCmd.AddCommand(deleteCmd) }
16
eks-anywhere
aws
Go
package cmd import ( "context" "fmt" "github.com/spf13/cobra" "github.com/aws/eks-anywhere/pkg/dependencies" "github.com/aws/eks-anywhere/pkg/kubeconfig" "github.com/aws/eks-anywhere/pkg/types" "github.com/aws/eks-anywhere/pkg/validations" "github.com/aws/eks-anywhere/pkg/workflows" ) type deleteClusterOpti...
133
eks-anywhere
aws
Go
package cmd import ( "context" "fmt" "log" "github.com/spf13/cobra" "github.com/aws/eks-anywhere/pkg/curatedpackages" "github.com/aws/eks-anywhere/pkg/kubeconfig" ) type deletePackageOptions struct { // kubeConfig is an optional kubeconfig file to use when querying an // existing cluster. kubeConfig s...
71
eks-anywhere
aws
Go
package cmd ////////////////////////////////////////////////////// // // WARNING: The command defined in this file is DEPRECATED. // // See ./import_images.go for the newer command. // ////////////////////////////////////////////////////// import ( "context" "fmt" "log" "net" "os" "path/filepath" "github.com/...
166
eks-anywhere
aws
Go
package cmd import ( "github.com/spf13/cobra" ) var describeCmd = &cobra.Command{ Use: "describe", Short: "Describe resources", Long: "Use eksctl anywhere describe to show details of a specific resource or group of resources", } func init() { rootCmd.AddCommand(describeCmd) }
16
eks-anywhere
aws
Go
package cmd import ( "context" "fmt" "log" "github.com/spf13/cobra" "github.com/aws/eks-anywhere/pkg/curatedpackages" "github.com/aws/eks-anywhere/pkg/kubeconfig" ) type describePackagesOption struct { // kubeConfig is an optional kubeconfig file to use when querying an // existing cluster. kubeConfig ...
72
eks-anywhere
aws
Go
package cmd import ( "github.com/spf13/cobra" ) var downloadCmd = &cobra.Command{ Use: "download", Short: "Download resources", Long: "Use eksctl anywhere download to download artifacts (manifests, bundles) used by EKS Anywhere", } func init() { rootCmd.AddCommand(downloadCmd) }
16
eks-anywhere
aws
Go
package cmd import ( "archive/tar" "bytes" "compress/gzip" "context" "fmt" "io" "log" "os" "path/filepath" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" "sigs.k8s.io/yaml" "github.com/aws/eks-anywhere/pkg/dependencies" "github.com/aws/eks-anywhere/pkg/files" "github.com/a...
223
eks-anywhere
aws
Go
package cmd import ( "context" "log" "path/filepath" "strings" "github.com/spf13/cobra" "github.com/aws/eks-anywhere/cmd/eksctl-anywhere/cmd/internal/commands/artifacts" "github.com/aws/eks-anywhere/pkg/curatedpackages/oras" "github.com/aws/eks-anywhere/pkg/dependencies" "github.com/aws/eks-anywhere/pkg/doc...
116
eks-anywhere
aws
Go
package cmd import ( "github.com/spf13/cobra" ) var expCmd = &cobra.Command{ Use: "exp", Short: "experimental commands", Long: "Use eksctl anywhere experimental commands", } func init() { rootCmd.AddCommand(expCmd) }
16
eks-anywhere
aws
Go
package cmd import ( "fmt" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" "github.com/aws/eks-anywhere/pkg/validations" ) const ( TinkerbellHardwareCSVFlagName = "hardware-csv" TinkerbellHardwareCSVFlagAlias = "z" TinkerbellHardwareCSVFlagDescription = "Path to a CSV...
69
eks-anywhere
aws
Go
package cmd import ( "github.com/spf13/cobra" ) var generateCmd = &cobra.Command{ Use: "generate", Short: "Generate resources", Long: "Use eksctl anywhere generate to generate resources, such as clusterconfig yaml", } func init() { rootCmd.AddCommand(generateCmd) }
16
eks-anywhere
aws
Go
package cmd import ( "context" "fmt" "log" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" "github.com/aws/eks-anywhere/pkg/api/v1alpha1" "github.com/aws/eks-anywhere/pkg/dependencies" "github.com/aws/eks-anywhere/pkg/diagnostics" "github.com/aws/eks-anywhere/pkg/kubeconfig" "gi...
117
eks-anywhere
aws
Go
package cmd import ( "fmt" "log" "strings" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" "sigs.k8s.io/yaml" "github.com/aws/eks-anywhere/internal/pkg/api" "github.com/aws/eks-anywhere/pkg/api/v1alpha1" "github.com/aws/eks-anywhere/pkg/constants" "github.com/aws/eks-anywhere/pk...
265
eks-anywhere
aws
Go
package cmd import ( "bufio" "fmt" "github.com/spf13/cobra" "github.com/aws/eks-anywhere/pkg/providers/tinkerbell/hardware" ) type hardwareOptions struct { csvPath string outputPath string } var hOpts = &hardwareOptions{} var generateHardwareCmd = &cobra.Command{ Use: "hardware", Short: "Generate har...
65
eks-anywhere
aws
Go
package cmd import ( "context" "fmt" "log" "github.com/spf13/cobra" "github.com/aws/eks-anywhere/pkg/curatedpackages" "github.com/aws/eks-anywhere/pkg/kubeconfig" ) type generatePackageOptions struct { kubeVersion string clusterName string registry string // kubeConfig is an optional kubeconfig file to...
100
eks-anywhere
aws
Go
package cmd import ( "context" "fmt" "log" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" "github.com/aws/eks-anywhere/pkg/constants" ) var getCmd = &cobra.Command{ Use: "get", Short: "Get resources", Long: "Use eksctl anywhere get to display one or many resources", } func ...
62
eks-anywhere
aws
Go
package cmd import ( "log" "github.com/spf13/cobra" "github.com/aws/eks-anywhere/pkg/kubeconfig" ) type getPackageOptions struct { output string // kubeConfig is an optional kubeconfig file to use when querying an // existing cluster. kubeConfig string clusterName string bundlesOverride string } ...
53
eks-anywhere
aws
Go
package cmd import ( "github.com/spf13/cobra" "github.com/aws/eks-anywhere/pkg/kubeconfig" ) type getPackageBundleOptions struct { output string // kubeConfig is an optional kubeconfig file to use when querying an // existing cluster. kubeConfig string bundlesOverride string } var gpbo = &getPackageBund...
45
eks-anywhere
aws
Go
package cmd import ( "github.com/spf13/cobra" "github.com/aws/eks-anywhere/pkg/kubeconfig" ) type getPackageBundleControllerOptions struct { output string // kubeConfig is an optional kubeconfig file to use when querying an // existing cluster. kubeConfig string bundlesOverride string } var gpbco = &get...
45
eks-anywhere
aws
Go
package cmd import ( "github.com/spf13/cobra" ) // importCmd represents the import command. var importCmd = &cobra.Command{ Use: "import", Short: "Import resources", Long: "Use eksctl anywhere import to import resources, such as images and helm charts", } func init() { rootCmd.AddCommand(importCmd) }
17
eks-anywhere
aws
Go
package cmd import ( "context" "log" "path/filepath" "github.com/spf13/cobra" "github.com/aws/eks-anywhere/cmd/eksctl-anywhere/cmd/internal/commands/artifacts" "github.com/aws/eks-anywhere/pkg/config" "github.com/aws/eks-anywhere/pkg/constants" "github.com/aws/eks-anywhere/pkg/curatedpackages/oras" "github....
154
eks-anywhere
aws
Go
package cmd import "github.com/spf13/cobra" var installCmd = &cobra.Command{ Use: "install", Short: "Install resources to the cluster", Long: "Use eksctl anywhere install to install resources into a cluster", } func init() { rootCmd.AddCommand(installCmd) }
14
eks-anywhere
aws
Go
package cmd import ( "context" "errors" "fmt" "log" "github.com/spf13/cobra" "github.com/aws/eks-anywhere/pkg/curatedpackages" "github.com/aws/eks-anywhere/pkg/kubeconfig" "github.com/aws/eks-anywhere/pkg/validations" "github.com/aws/eks-anywhere/pkg/version" ) type installControllerOptions struct { fileN...
85
eks-anywhere
aws
Go
package cmd import ( "context" "fmt" "log" "github.com/spf13/cobra" "github.com/aws/eks-anywhere/pkg/curatedpackages" "github.com/aws/eks-anywhere/pkg/kubeconfig" ) type installPackageOptions struct { kubeVersion string clusterName string packageName string registry string customConfigs []stri...
115
eks-anywhere
aws
Go
package cmd import ( "github.com/spf13/cobra" ) var listCmd = &cobra.Command{ Use: "list", Short: "List resources", Long: "Use eksctl anywhere list to list images and artifacts used by EKS Anywhere", } func init() { rootCmd.AddCommand(listCmd) }
16