Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support reading header values from secret/configmap etc like ENV vars #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH))
BASEIMAGE_PROD ?= gcr.io/distroless/static
BASEIMAGE_DBG ?= debian:stretch

GO_VERSION ?= 1.13.5
GO_VERSION ?= 1.14.3
BUILD_IMAGE ?= appscode/golang-dev:$(GO_VERSION)

OUTBIN = bin/$(OS)_$(ARCH)/$(BIN)
Expand Down
350 changes: 305 additions & 45 deletions api/v1/generated.pb.go

Large diffs are not rendered by default.

15 changes: 14 additions & 1 deletion api/v1/generated.proto

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

41 changes: 39 additions & 2 deletions api/v1/openapi_generated.go

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

13 changes: 12 additions & 1 deletion api/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ type HTTPPostAction struct {
Scheme core.URIScheme `json:"scheme,omitempty" protobuf:"bytes,4,opt,name=scheme,casttype=k8s.io/api/core/v1.URIScheme"`
// Custom headers to set in the request. HTTP allows repeated headers.
// +optional
HTTPHeaders []core.HTTPHeader `json:"httpHeaders,omitempty" protobuf:"bytes,5,rep,name=httpHeaders"`
HTTPHeaders []HTTPHeader `json:"httpHeaders,omitempty" protobuf:"bytes,5,rep,name=httpHeaders"`
// Body to set in the request.
// +optional
Body string `json:"body,omitempty" protobuf:"bytes,6,opt,name=body"`
Expand All @@ -77,3 +77,14 @@ type FormEntry struct {
Key string `json:"key,omitempty" protobuf:"bytes,1,rep,name=key"`
Values []string `json:"values,omitempty" protobuf:"bytes,2,rep,name=values"`
}

// HTTPHeader describes a custom header to be used in HTTP probes
type HTTPHeader struct {
// The header field name
Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
// The header field value
Value string `json:"value,omitempty" protobuf:"bytes,2,opt,name=value"`
// Source for the header field's value. Cannot be used if value is not empty.
// +optional
ValueFrom *core.EnvVarSource `json:"valueFrom,omitempty" protobuf:"bytes,3,opt,name=valueFrom"`
}
27 changes: 25 additions & 2 deletions api/v1/zz_generated.deepcopy.go

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

4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module kmodules.xyz/prober
go 1.12

require (
github.com/appscode/go v0.0.0-20191119085241-0887d8ec2ecc
github.com/appscode/go v0.0.0-20200323182826-54e98e09185a
github.com/gabriel-vasile/mimetype v0.3.22
github.com/go-openapi/spec v0.19.2
github.com/go-openapi/swag v0.19.4 // indirect
Expand All @@ -17,7 +17,7 @@ require (
k8s.io/client-go v12.0.0+incompatible
k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf
k8s.io/utils v0.0.0-20190801114015-581e00157fb1
kmodules.xyz/client-go v0.0.0-20191211192817-f1dcd02124ba
kmodules.xyz/client-go v0.0.0-20200518125232-435dcc370844
)

replace (
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/appscode/go v0.0.0-20191119085241-0887d8ec2ecc h1:Q5jwbRq/a1Tien+Is8Zn6HMBRgE13+UOQ9mTvrIuvuE=
github.com/appscode/go v0.0.0-20191119085241-0887d8ec2ecc/go.mod h1:OawnOmAL4ZX3YaPdN+8HTNwBveT1jMsqP74moa9XUbE=
github.com/appscode/go v0.0.0-20200323182826-54e98e09185a h1:cZ80NKoLRaW1PVCWXAJE+YFkBAmLZ8BnrJmH0ClY1Gs=
github.com/appscode/go v0.0.0-20200323182826-54e98e09185a/go.mod h1:lIcm8Z6VPuvcw/a3EeOWcG6R3I13iHMLYbtVP7TKufY=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
Expand Down Expand Up @@ -381,8 +383,8 @@ k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf h1:EYm5AW/UUDbnmnI+gK0TJD
k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E=
k8s.io/utils v0.0.0-20190801114015-581e00157fb1 h1:+ySTxfHnfzZb9ys375PXNlLhkJPLKgHajBU0N62BDvE=
k8s.io/utils v0.0.0-20190801114015-581e00157fb1/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
kmodules.xyz/client-go v0.0.0-20191211192817-f1dcd02124ba h1:167+cDonVeZSmfbterebD6SofCnpjaiDS9St2RGhRug=
kmodules.xyz/client-go v0.0.0-20191211192817-f1dcd02124ba/go.mod h1:OFxuKCiVR+MYlR2a08FkfaF+IbXkLe0xBetu2LTUuGI=
kmodules.xyz/client-go v0.0.0-20200518125232-435dcc370844 h1:+g4XBo2szMo3/uPlUrEJjOwyEgv4NRAu0YSlDQOLFDw=
kmodules.xyz/client-go v0.0.0-20200518125232-435dcc370844/go.mod h1:z/AkrES60XR+jeKGg5zJyPd13NdG/Di0BptbG1gnS60=
modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw=
modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk=
modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k=
Expand Down
4 changes: 2 additions & 2 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
github.com/PuerkitoBio/purell
# github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578
github.com/PuerkitoBio/urlesc
# github.com/appscode/go v0.0.0-20191119085241-0887d8ec2ecc
# github.com/appscode/go v0.0.0-20200323182826-54e98e09185a
github.com/appscode/go/context
github.com/appscode/go/log
# github.com/davecgh/go-spew v1.1.1
Expand Down Expand Up @@ -244,7 +244,7 @@ k8s.io/kube-openapi/pkg/common
# k8s.io/utils v0.0.0-20190801114015-581e00157fb1 => k8s.io/utils v0.0.0-20190801114015-581e00157fb1
k8s.io/utils/integer
k8s.io/utils/io
# kmodules.xyz/client-go v0.0.0-20191211192817-f1dcd02124ba
# kmodules.xyz/client-go v0.0.0-20200518125232-435dcc370844
kmodules.xyz/client-go/tools/exec
# sigs.k8s.io/yaml v1.1.0 => sigs.k8s.io/yaml v1.1.0
sigs.k8s.io/yaml