Updated shell.go

This commit is contained in:
Chris Stuurman 2024-04-19 22:58:45 +02:00
parent 6b58b5da3c
commit 1356c61fc0
4 changed files with 10 additions and 13 deletions

View File

@ -1,5 +1,5 @@
apiVersion: v1
appVersion: v0.0.5-alpha.110
appVersion: v0.0.5-alpha.111
description: Cert-Manager webhook for sthome
name: sthome-webhook
version: 0.0.5-alpha.110
version: 0.0.5-alpha.111

View File

@ -31,7 +31,7 @@ clusterIssuer:
image:
repository: stuurmcp/cert-manager-webhook-sthome
#repository: wstat.sthome.net:5000/cert-manager-webhook-sthome
tag: 0.0.5-alpha.110
tag: 0.0.5-alpha.111
#pullPolicy should be IfNotPresent. Set to Always for testing purposes
pullPolicy: IfNotPresent

View File

@ -9,7 +9,7 @@ import (
"sync"
"time"
"github.com/jetstack/cert-manager/pkg/acme/webhook/apis/acme/v1alpha1"
"github.com/cert-manager/cert-manager/pkg/acme/webhook/apis/acme/v1alpha1"
"k8s.io/klog/v2"
)
@ -32,8 +32,7 @@ const (
var (
AcmeAuthCmd = AcmeDir + "/" + AuthScript
wg sync.WaitGroup // wg is used to wait for the program to finish.
mutex sync.Mutex // mutex is used to define a critical section of code.
mutex sync.Mutex // mutex is used to define a critical section of code.
)
// CapturingPassThroughWriter is a writer that remembers
@ -64,7 +63,6 @@ func SetChallenge(ch *v1alpha1.ChallengeRequest) (bool, error) {
SetupWorkdir() // update workdir if any of the copied files were updated on host
return Execute(
Shell,
// "-c",
AcmeAuthCmd,
"set",
ch.DNSName,
@ -80,7 +78,6 @@ func UnsetChallenge(ch *v1alpha1.ChallengeRequest) (bool, error) {
SetupWorkdir() // update workdir if any of the copied files were updated on host
return Execute(
Shell,
// "-c",
AcmeAuthCmd,
"unset",
ch.DNSName,
@ -155,7 +152,7 @@ func updateWorkdir() {
func createWorkdir() error {
finfo, err := os.Stat(Workdir)
if os.IsNotExist(err) {
klog.Infof("Creating folder \"%s\".", Workdir)
klog.Infof("Creating folder \"%s\"", Workdir)
err = os.Mkdir(Workdir, 0755)
if err != nil {
panic(err)
@ -173,7 +170,7 @@ func updateIfStale(filename string, mode os.FileMode) error {
if result > 0 {
err = CopyFile(sourceFile, destFile, mode)
if err == nil {
klog.Infof("Updated \"%s\" from \"%s\" folder.", destFile, AcmeDir)
klog.Infof("Updated \"%s\" from \"%s\" folder", destFile, AcmeDir)
}
}
return err

View File

@ -1,3 +1,3 @@
0.0.5-alpha.110
20240419-2130
110
0.0.5-alpha.111
20240419-2247
111