Compare commits
2 Commits
334ac1b217
...
9cdfb40931
| Author | SHA1 | Date | |
|---|---|---|---|
| 9cdfb40931 | |||
| f512544adb |
1
.gitignore
vendored
1
.gitignore
vendored
@ -7,3 +7,4 @@ apiserver.local.config
|
|||||||
charts
|
charts
|
||||||
_test
|
_test
|
||||||
icon
|
icon
|
||||||
|
vendor
|
||||||
|
|||||||
3
Makefile
3
Makefile
@ -3,7 +3,7 @@ OS ?= $(shell $(GO) env GOOS)
|
|||||||
ARCH ?= $(shell $(GO) env GOARCH)
|
ARCH ?= $(shell $(GO) env GOARCH)
|
||||||
|
|
||||||
IMAGE_NAME := "cert-manager-webhook-sthome"
|
IMAGE_NAME := "cert-manager-webhook-sthome"
|
||||||
IMAGE_TAG := "latest"
|
IMAGE_TAG := "0.0.3(Alpha)"
|
||||||
|
|
||||||
OUT := $(shell pwd)/_out
|
OUT := $(shell pwd)/_out
|
||||||
|
|
||||||
@ -34,7 +34,6 @@ clean:
|
|||||||
.PHONY: build
|
.PHONY: build
|
||||||
build: dependencies
|
build: dependencies
|
||||||
go run cmd/buildnumber.go
|
go run cmd/buildnumber.go
|
||||||
go build -o $(IMAGE_NAME)
|
|
||||||
docker build -t "$(IMAGE_NAME):$(IMAGE_TAG)" .
|
docker build -t "$(IMAGE_NAME):$(IMAGE_TAG)" .
|
||||||
|
|
||||||
.PHONY: rendered-manifest.yaml
|
.PHONY: rendered-manifest.yaml
|
||||||
|
|||||||
@ -8,6 +8,11 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
version = "0.0.3(Alpha)"
|
||||||
|
buildTime string
|
||||||
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// Load the file content
|
// Load the file content
|
||||||
vFileData, _ := os.ReadFile("version.txt")
|
vFileData, _ := os.ReadFile("version.txt")
|
||||||
@ -17,7 +22,7 @@ func main() {
|
|||||||
vLines := strings.Split(string(vFileData), "\n")
|
vLines := strings.Split(string(vFileData), "\n")
|
||||||
|
|
||||||
// Generate a timestamp.
|
// Generate a timestamp.
|
||||||
bTime := time.Now().Format("20060102-1504")
|
buildTime = time.Now().Format("20060102-1504")
|
||||||
|
|
||||||
// Load the count from the 3rd line of the file
|
// Load the count from the 3rd line of the file
|
||||||
// It's a string so we need to convert to integer
|
// It's a string so we need to convert to integer
|
||||||
@ -27,7 +32,7 @@ func main() {
|
|||||||
|
|
||||||
// Generate a single string to write back to the file
|
// Generate a single string to write back to the file
|
||||||
// Note, we didn't change the version string
|
// Note, we didn't change the version string
|
||||||
outStr := vLines[0] + "\n" + bTime + "\n" + fmt.Sprint(bNum)
|
outStr := version + "\n" + buildTime + "\n" + fmt.Sprint(bNum)
|
||||||
|
|
||||||
// Write the data back to the file.
|
// Write the data back to the file.
|
||||||
_ = os.WriteFile("version.txt", []byte(outStr), 0777)
|
_ = os.WriteFile("version.txt", []byte(outStr), 0777)
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
appVersion: "v0.0.3"
|
appVersion: "v0.0.3(Alpha)"
|
||||||
description: Cert-Manager webhook for sthome
|
description: Cert-Manager webhook for sthome
|
||||||
name: sthome-webhook
|
name: sthome-webhook
|
||||||
version: 0.0.3
|
version: 0.0.3(Alpha)
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ clusterIssuer:
|
|||||||
|
|
||||||
image:
|
image:
|
||||||
repository: stuurmcp/cert-manager-webhook-sthome
|
repository: stuurmcp/cert-manager-webhook-sthome
|
||||||
tag: 0.0.3
|
tag: 0.0.3(Alpha)
|
||||||
#pullPolicy should be IfNotPresent. Set to Always for testing purposes
|
#pullPolicy should be IfNotPresent. Set to Always for testing purposes
|
||||||
pullPolicy: IfNotPresent
|
pullPolicy: IfNotPresent
|
||||||
|
|
||||||
|
|||||||
8
go.mod
8
go.mod
@ -13,7 +13,10 @@ require (
|
|||||||
k8s.io/client-go v0.29.0
|
k8s.io/client-go v0.29.0
|
||||||
)
|
)
|
||||||
|
|
||||||
require k8s.io/klog/v2 v2.110.1
|
require (
|
||||||
|
k8s.io/apimachinery v0.29.0
|
||||||
|
k8s.io/klog/v2 v2.110.1
|
||||||
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/NYTimes/gziphandler v1.1.1 // indirect
|
github.com/NYTimes/gziphandler v1.1.1 // indirect
|
||||||
@ -28,7 +31,6 @@ require (
|
|||||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||||
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
|
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
|
||||||
github.com/evanphx/json-patch v5.7.0+incompatible // indirect
|
github.com/evanphx/json-patch v5.7.0+incompatible // indirect
|
||||||
github.com/evanphx/json-patch/v5 v5.7.0 // indirect
|
|
||||||
github.com/felixge/httpsnoop v1.0.4 // indirect
|
github.com/felixge/httpsnoop v1.0.4 // indirect
|
||||||
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
||||||
github.com/go-logr/logr v1.4.1 // indirect
|
github.com/go-logr/logr v1.4.1 // indirect
|
||||||
@ -100,14 +102,12 @@ require (
|
|||||||
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
|
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
k8s.io/apimachinery v0.29.0 // indirect
|
|
||||||
k8s.io/apiserver v0.29.0 // indirect
|
k8s.io/apiserver v0.29.0 // indirect
|
||||||
k8s.io/component-base v0.29.0 // indirect
|
k8s.io/component-base v0.29.0 // indirect
|
||||||
k8s.io/kms v0.29.0 // indirect
|
k8s.io/kms v0.29.0 // indirect
|
||||||
k8s.io/kube-openapi v0.0.0-20240103051144-eec4567ac022 // indirect
|
k8s.io/kube-openapi v0.0.0-20240103051144-eec4567ac022 // indirect
|
||||||
k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect
|
k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect
|
||||||
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0 // indirect
|
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0 // indirect
|
||||||
sigs.k8s.io/controller-runtime v0.16.3 // indirect
|
|
||||||
sigs.k8s.io/gateway-api v1.0.0 // indirect
|
sigs.k8s.io/gateway-api v1.0.0 // indirect
|
||||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
|
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
|
||||||
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
|
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
|
||||||
|
|||||||
6
go.sum
6
go.sum
@ -38,8 +38,6 @@ github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBF
|
|||||||
github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE=
|
github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE=
|
||||||
github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI=
|
github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI=
|
||||||
github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
|
github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
|
||||||
github.com/evanphx/json-patch/v5 v5.7.0 h1:nJqP7uwL84RJInrohHfW0Fx3awjbm8qZeFv0nW9SYGc=
|
|
||||||
github.com/evanphx/json-patch/v5 v5.7.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ=
|
|
||||||
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
|
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
|
||||||
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
|
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
|
||||||
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
|
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
|
||||||
@ -274,8 +272,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
|
|||||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw=
|
|
||||||
gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
|
|
||||||
google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=
|
google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=
|
||||||
google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=
|
google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=
|
||||||
google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 h1:nz5NESFLZbJGPFxDT/HCn+V1mZ8JGNoY4nUpmW/Y2eg=
|
google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 h1:nz5NESFLZbJGPFxDT/HCn+V1mZ8JGNoY4nUpmW/Y2eg=
|
||||||
@ -325,8 +321,6 @@ k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCf
|
|||||||
k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||||
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0 h1:/U5vjBbQn3RChhv7P11uhYvCSm5G2GaIi5AIGBS6r4c=
|
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0 h1:/U5vjBbQn3RChhv7P11uhYvCSm5G2GaIi5AIGBS6r4c=
|
||||||
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0/go.mod h1:z7+wmGM2dfIiLRfrC6jb5kV2Mq/sK1ZP303cxzkV5Y4=
|
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0/go.mod h1:z7+wmGM2dfIiLRfrC6jb5kV2Mq/sK1ZP303cxzkV5Y4=
|
||||||
sigs.k8s.io/controller-runtime v0.16.3 h1:2TuvuokmfXvDUamSx1SuAOO3eTyye+47mJCigwG62c4=
|
|
||||||
sigs.k8s.io/controller-runtime v0.16.3/go.mod h1:j7bialYoSn142nv9sCOJmQgDXQXxnroFU4VnX/brVJ0=
|
|
||||||
sigs.k8s.io/gateway-api v1.0.0 h1:iPTStSv41+d9p0xFydll6d7f7MOBGuqXM6p2/zVYMAs=
|
sigs.k8s.io/gateway-api v1.0.0 h1:iPTStSv41+d9p0xFydll6d7f7MOBGuqXM6p2/zVYMAs=
|
||||||
sigs.k8s.io/gateway-api v1.0.0/go.mod h1:4cUgr0Lnp5FZ0Cdq8FdRwCvpiWws7LVhLHGIudLlf4c=
|
sigs.k8s.io/gateway-api v1.0.0/go.mod h1:4cUgr0Lnp5FZ0Cdq8FdRwCvpiWws7LVhLHGIudLlf4c=
|
||||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
||||||
|
|||||||
21
main_test.go
21
main_test.go
@ -3,13 +3,10 @@ package main
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
acmetest "github.com/cert-manager/cert-manager/test/acme"
|
|
||||||
"github.com/stuurmcp/cert-manager-webhook-sthome/sthome"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
zone = os.Getenv("TEST_ZONE_NAME")
|
zone = os.Getenv("sthome.net")
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRunsSuite(t *testing.T) {
|
func TestRunsSuite(t *testing.T) {
|
||||||
@ -19,12 +16,13 @@ func TestRunsSuite(t *testing.T) {
|
|||||||
//
|
//
|
||||||
|
|
||||||
// Uncomment the below fixture when implementing your custom DNS provider
|
// Uncomment the below fixture when implementing your custom DNS provider
|
||||||
//fixture := acmetest.NewFixture(&customDNSProviderSolver{},
|
/*
|
||||||
// acmetest.SetResolvedZone(zone),
|
fixture := acmetest.NewFixture(&customDNSProviderSolver{},
|
||||||
// acmetest.SetAllowAmbientCredentials(false),
|
acmetest.SetResolvedZone(zone),
|
||||||
// acmetest.SetManifestPath("testdata/sthome-solver"),
|
acmetest.SetAllowAmbientCredentials(false),
|
||||||
// acmetest.SetBinariesPath("_test/kubebuilder/bin"),
|
acmetest.SetManifestPath("testdata/sthome-solver"),
|
||||||
//)
|
acmetest.SetBinariesPath("_test/kubebuilder/bin"),
|
||||||
|
)
|
||||||
solver := sthome.New("59351")
|
solver := sthome.New("59351")
|
||||||
fixture := acmetest.NewFixture(solver,
|
fixture := acmetest.NewFixture(solver,
|
||||||
acmetest.SetResolvedZone("sthome.net."),
|
acmetest.SetResolvedZone("sthome.net."),
|
||||||
@ -32,9 +30,10 @@ func TestRunsSuite(t *testing.T) {
|
|||||||
acmetest.SetDNSServer("127.0.0.1:59351"),
|
acmetest.SetDNSServer("127.0.0.1:59351"),
|
||||||
acmetest.SetUseAuthoritative(false),
|
acmetest.SetUseAuthoritative(false),
|
||||||
)
|
)
|
||||||
|
|
||||||
//need to uncomment and RunConformance delete runBasic and runExtended once https://github.com/cert-manager/cert-manager/pull/4835 is merged
|
//need to uncomment and RunConformance delete runBasic and runExtended once https://github.com/cert-manager/cert-manager/pull/4835 is merged
|
||||||
//fixture.RunConformance(t)
|
//fixture.RunConformance(t)
|
||||||
fixture.RunBasic(t)
|
fixture.RunBasic(t)
|
||||||
fixture.RunExtended(t)
|
fixture.RunExtended(t)
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,10 +6,6 @@ package tests
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/cert-manager/cert-manager/test/acme/dns"
|
|
||||||
|
|
||||||
"github.com/cert-manager/cert-manager-webhook-sthome/sthome"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -25,7 +21,7 @@ func TestRunsSuite(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("error getting current working dir: %s", err.Error())
|
t.Fatalf("error getting current working dir: %s", err.Error())
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
fixture := dns.NewFixture(&sthome.ProviderSolver{},
|
fixture := dns.NewFixture(&sthome.ProviderSolver{},
|
||||||
dns.SetResolvedZone(zone),
|
dns.SetResolvedZone(zone),
|
||||||
dns.SetAllowAmbientCredentials(true),
|
dns.SetAllowAmbientCredentials(true),
|
||||||
@ -35,4 +31,5 @@ func TestRunsSuite(t *testing.T) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
fixture.RunConformance(t)
|
fixture.RunConformance(t)
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import (
|
|||||||
|
|
||||||
// These are set during build time via -ldflags
|
// These are set during build time via -ldflags
|
||||||
var (
|
var (
|
||||||
version = "0.0.1+dev"
|
version = "0.0.3+dev"
|
||||||
gitCommit string
|
gitCommit string
|
||||||
buildDate string
|
buildDate string
|
||||||
)
|
)
|
||||||
|
|||||||
0
vendor/modules.txt
vendored
0
vendor/modules.txt
vendored
@ -1,3 +1,3 @@
|
|||||||
0.0.3(Alpha)
|
0.0.3(Alpha)
|
||||||
20240328-0000
|
20240328-2232
|
||||||
01
|
14
|
||||||
Loading…
Reference in New Issue
Block a user