Updating versioning

This commit is contained in:
Chris Stuurman 2024-03-28 22:42:48 +02:00
parent f512544adb
commit 9cdfb40931
11 changed files with 54 additions and 59 deletions

1
.gitignore vendored
View File

@ -7,3 +7,4 @@ apiserver.local.config
charts
_test
icon
vendor

View File

@ -3,7 +3,7 @@ OS ?= $(shell $(GO) env GOOS)
ARCH ?= $(shell $(GO) env GOARCH)
IMAGE_NAME := "cert-manager-webhook-sthome"
IMAGE_TAG := "latest"
IMAGE_TAG := "0.0.3(Alpha)"
OUT := $(shell pwd)/_out
@ -33,8 +33,7 @@ clean:
.PHONY: build
build: dependencies
go run cmd/buildnumber.go
go build -o $(IMAGE_NAME)
go run cmd/buildnumber.go
docker build -t "$(IMAGE_NAME):$(IMAGE_TAG)" .
.PHONY: rendered-manifest.yaml
@ -43,9 +42,9 @@ rendered-manifest.yaml: $(OUT)/rendered-manifest.yaml
$(OUT)/rendered-manifest.yaml: $(HELM_FILES) | $(OUT)
helm template \
--name sthome-webhook \
--set image.repository=$(IMAGE_NAME) \
--set image.tag=$(IMAGE_TAG) \
deploy/sthome-webhook > $@
--set image.repository=$(IMAGE_NAME) \
--set image.tag=$(IMAGE_TAG) \
deploy/sthome-webhook > $@
_test $(OUT) _test/kubebuilder-$(KUBEBUILDER_VERSION)-$(OS)-$(ARCH):
mkdir -p $@

View File

@ -8,6 +8,11 @@ import (
"time"
)
var (
version = "0.0.3(Alpha)"
buildTime string
)
func main() {
// Load the file content
vFileData, _ := os.ReadFile("version.txt")
@ -17,7 +22,7 @@ func main() {
vLines := strings.Split(string(vFileData), "\n")
// 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
// 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
// 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.
_ = os.WriteFile("version.txt", []byte(outStr), 0777)

View File

@ -1,6 +1,6 @@
apiVersion: v1
appVersion: "v0.0.3"
appVersion: "v0.0.3(Alpha)"
description: Cert-Manager webhook for sthome
name: sthome-webhook
version: 0.0.3
version: 0.0.3(Alpha)

View File

@ -30,7 +30,7 @@ clusterIssuer:
image:
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: IfNotPresent

8
go.mod
View File

@ -13,7 +13,10 @@ require (
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 (
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/emicklei/go-restful/v3 v3.11.0 // 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/fsnotify/fsnotify v1.7.0 // 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/yaml.v2 v2.4.0 // 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/component-base v0.29.0 // indirect
k8s.io/kms v0.29.0 // indirect
k8s.io/kube-openapi v0.0.0-20240103051144-eec4567ac022 // 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/controller-runtime v0.16.3 // indirect
sigs.k8s.io/gateway-api v1.0.0 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect

6
go.sum
View File

@ -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/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 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/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
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-20191204190536-9bdfabe68543/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/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=
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=
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/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/go.mod h1:4cUgr0Lnp5FZ0Cdq8FdRwCvpiWws7LVhLHGIudLlf4c=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=

View File

@ -3,13 +3,10 @@ package main
import (
"os"
"testing"
acmetest "github.com/cert-manager/cert-manager/test/acme"
"github.com/stuurmcp/cert-manager-webhook-sthome/sthome"
)
var (
zone = os.Getenv("TEST_ZONE_NAME")
zone = os.Getenv("sthome.net")
)
func TestRunsSuite(t *testing.T) {
@ -19,22 +16,24 @@ func TestRunsSuite(t *testing.T) {
//
// Uncomment the below fixture when implementing your custom DNS provider
//fixture := acmetest.NewFixture(&customDNSProviderSolver{},
// acmetest.SetResolvedZone(zone),
// acmetest.SetAllowAmbientCredentials(false),
// acmetest.SetManifestPath("testdata/sthome-solver"),
// acmetest.SetBinariesPath("_test/kubebuilder/bin"),
//)
solver := sthome.New("59351")
fixture := acmetest.NewFixture(solver,
acmetest.SetResolvedZone("sthome.net."),
acmetest.SetManifestPath("testdata/sthome-solver"),
acmetest.SetDNSServer("127.0.0.1:59351"),
acmetest.SetUseAuthoritative(false),
)
//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.RunBasic(t)
fixture.RunExtended(t)
/*
fixture := acmetest.NewFixture(&customDNSProviderSolver{},
acmetest.SetResolvedZone(zone),
acmetest.SetAllowAmbientCredentials(false),
acmetest.SetManifestPath("testdata/sthome-solver"),
acmetest.SetBinariesPath("_test/kubebuilder/bin"),
)
solver := sthome.New("59351")
fixture := acmetest.NewFixture(solver,
acmetest.SetResolvedZone("sthome.net."),
acmetest.SetManifestPath("testdata/sthome-solver"),
acmetest.SetDNSServer("127.0.0.1:59351"),
acmetest.SetUseAuthoritative(false),
)
//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.RunBasic(t)
fixture.RunExtended(t)
*/
}

View File

@ -6,10 +6,6 @@ package tests
import (
"os"
"testing"
"github.com/cert-manager/cert-manager/test/acme/dns"
"github.com/cert-manager/cert-manager-webhook-sthome/sthome"
)
var (
@ -25,14 +21,15 @@ func TestRunsSuite(t *testing.T) {
if err != nil {
t.Fatalf("error getting current working dir: %s", err.Error())
}
/*
fixture := dns.NewFixture(&sthome.ProviderSolver{},
dns.SetResolvedZone(zone),
dns.SetAllowAmbientCredentials(true),
dns.SetBinariesPath(currentDir+"/kubebuilder/bin"),
dns.SetManifestPath(currentDir+"/testdata"),
dns.SetStrict(true),
)
fixture := dns.NewFixture(&sthome.ProviderSolver{},
dns.SetResolvedZone(zone),
dns.SetAllowAmbientCredentials(true),
dns.SetBinariesPath(currentDir+"/kubebuilder/bin"),
dns.SetManifestPath(currentDir+"/testdata"),
dns.SetStrict(true),
)
fixture.RunConformance(t)
fixture.RunConformance(t)
*/
}

View File

@ -7,7 +7,7 @@ import (
// These are set during build time via -ldflags
var (
version = "0.0.1+dev"
version = "0.0.3+dev"
gitCommit string
buildDate string
)

View File

@ -1,3 +1,3 @@
0.0.3(Alpha)
20240328-0000
01
0.0.3(Alpha)
20240328-2232
14