Skip to content

Commit

Permalink
Fix issues with PR for cert-manager
Browse files Browse the repository at this point in the history
Corrects the order of the arguments for the apply command which
stopped the CRD from working. Also adds app to the list of
available.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Oct 20, 2019
1 parent 8b7dbf6 commit d4bea3e
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@


[[constraint]]
version = "0.1.0"
version = "0.1.1"
name = "github.com/alexellis/go-execute"
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ k3sup app install metrics-server # PC only
# Get a public IP / Service LoadBalancer via DigitalOcean
# or Packet.com
k3sup app install inlets-operator # PC only

# cert-manager - obtain free TLS certificates from LetsEncrypt
k3sup app install cert-manager
```

Find out more:
Expand Down
13 changes: 9 additions & 4 deletions pkg/cmd/certmanager_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ func makeInstallCertManager() *cobra.Command {
var certManager = &cobra.Command{
Use: "cert-manager",
Short: "Install cert-manager",
Long: "Install Cert-Manager",
Example: "k3sup install cert-manager --namespace cert-manager",
Long: "Install cert-manager for obtaining TLS certificates from LetsEncrypt",
Example: "k3sup install cert-manager",
SilenceUsage: true,
}

Expand Down Expand Up @@ -86,12 +86,17 @@ func makeInstallCertManager() *cobra.Command {
return err
}

err = kubectl("apply", "-f", "--validate", "false", "https://raw.githubusercontent.com/jetstack/cert-manager/release-0.11/deploy/manifests/00-crds.yaml")
log.Printf("Applying CRD\n")

res, err := kubectlTask("apply", "--validate=false", "-f", "https://raw.githubusercontent.com/jetstack/cert-manager/release-0.11/deploy/manifests/00-crds.yaml")
if err != nil {
return err
}
if len(res.Stderr) > 0 {
return fmt.Errorf("Error applying CRD: %s", res.Stderr)
}

err = kubectl("apply", "-n", namespace, "-R", "-f", outputPath)
err = kubectl("apply", "-R", "-f", outputPath)
if err != nil {
return err
}
Expand Down
6 changes: 6 additions & 0 deletions pkg/cmd/kubernetes_exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ func getArchitecture() string {

func templateChart(basePath, chart, namespace, outputPath, values string, overrides map[string]string) error {

rmErr := os.RemoveAll(outputPath)

if rmErr != nil {
log.Printf("Error cleaning up: %s, %s\n", outputPath, rmErr.Error())
}

mkErr := os.MkdirAll(outputPath, 0700)
if mkErr != nil {
return mkErr
Expand Down
7 changes: 6 additions & 1 deletion vendor/github.com/alexellis/go-execute/exec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d4bea3e

Please sign in to comment.