Skip to content

Commit

Permalink
version should be working :fingerscrossed:
Browse files Browse the repository at this point in the history
  • Loading branch information
pthomison committed Apr 5, 2024
1 parent 5e046d9 commit 8acb717
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 70 deletions.
6 changes: 6 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ builds:
- GO111MODULE=on
tags:
- containers_image_openpgp
ldflags:
- |
-s -w
-X github.com/pthomison/k3auto/cmd.version={{.Version}}
-X github.com/pthomison/k3auto/cmd.commit={{.Commit}}
-X github.com/pthomison/k3auto/cmd.date={{.Date}}
goos:
- linux
- darwin
Expand Down
7 changes: 0 additions & 7 deletions cmd/k3auto.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ var (
MinimalFlag bool
)

// ldflag vars
var (
version = "dev"
commit = "none"
date = "unknown"
)

func init() {
K3AutoCmd.PersistentFlags().StringVarP(&ClusterConfigFileFlag, "cluster-config", "c", "", "Override Cluster Config File")
K3AutoCmd.PersistentFlags().StringVarP(&DeploymentDirectoryFlag, "deployment-directory", "d", "", "Deployment Directory")
Expand Down
19 changes: 0 additions & 19 deletions cmd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,6 @@ func checkError(err error) {
}
}

// func lookupIpv4() (string, error) {
// // get list of available addresses
// addr, err := net.InterfaceAddrs()
// if err != nil {
// return "", err
// }

// for _, addr := range addr {
// if ipnet, ok := addr.(*net.IPNet); ok && !ipnet.IP.IsLoopback() {
// // check if IPv4 or IPv6 is not nil
// if ipnet.IP.To4() != nil {
// // print available addresses
// return ipnet.IP.String(), nil
// }
// }
// }
// return "", errors.New("no ipv4 network detected")
// }

func Deploy(ctx context.Context, name string, directory string, filesystem afero.Fs) error {
imageRef := fmt.Sprintf("%v:%v", name, name)

Expand Down
41 changes: 8 additions & 33 deletions cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,17 @@ import (
"github.com/spf13/cobra"
)

// ldflag vars
var (
version = "dev"
commit = "none"
date = "unknown"
)

var VersionCmd = &cobra.Command{
Use: "version",
Short: "Implementation Pending; Update the deployments in a cluster",
Short: "Prints the version, commit, & build date",
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("Version: %v\nCommit: %v\nDate: %v\n", version, commit, date)
},
}

// func k3AutoUpdate(cmd *cobra.Command, args []string) {
// ctx := cmd.Context()
// if ctx == nil {
// ctx = context.Background()
// }

// var err error

// // clusterConfig, err := parseConfigFile(ClusterConfigFileFlag)
// // checkError(err)
// // logrus.Info("K3D Config File Loaded: ", ClusterConfigFileFlag)

// if !MinimalFlag {

// logrus.Info("Injecting Default Deployments")
// err = Deploy(ctx, "default", defaults.DefaultDeploymentsFolder, afero.FromIOFS{FS: defaults.DefaultDeployments})
// checkError(err)
// logrus.Info("Default Deployments Injected")

// }

// if DeploymentDirectoryFlag != "" {

// logrus.Info("Injecting Directory Deployments")
// err = Deploy(ctx, "deployments", DeploymentDirectoryFlag, afero.NewOsFs())
// checkError(err)

// logrus.Info("Directory Deployments Injected")

// }
// }
2 changes: 0 additions & 2 deletions default/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ const (
K3dConfigLocation = "k3d-config.yaml"

DefaultDeploymentsFolder = "deployments"

// RegistryDeploymentFolder = "registry"
)

var (
Expand Down
10 changes: 1 addition & 9 deletions default/k3d-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,18 @@ metadata:
name: k3auto
servers: 1
image: docker.io/rancher/k3s:v1.29.1-k3s1
# network: bridge
kubeAPI:
# host: host.docker.internal
hostPort: "6443"

ports:
- port: 8080:80 # same as `--port '8080:80@loadbalancer'`
- port: 8080:80
nodeFilters:
- loadbalancer

options:
k3d:
wait: true
timeout: 3m0s
# disableLoadbalancer: true

k3s:
extraArgs:
Expand All @@ -34,8 +31,3 @@ options:
switchCurrentContext: true

runtime: {}

registries:
create:
name: k3auto-registry.localhost
hostPort: "8888"

0 comments on commit 8acb717

Please sign in to comment.