Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
3fcc2697
Commit
3fcc2697
authored
Apr 03, 2018
by
jennybuckley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup CRD/CR confusion in webhook e2e tests
parent
6c96dfd8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
39 deletions
+54
-39
webhook.go
test/e2e/apimachinery/webhook.go
+42
-27
Makefile
test/images/webhook/Makefile
+1
-1
main.go
test/images/webhook/main.go
+10
-10
manifest.go
test/utils/image/manifest.go
+1
-1
No files found.
test/e2e/apimachinery/webhook.go
View file @
3fcc2697
This diff is collapsed.
Click to expand it.
test/images/webhook/Makefile
View file @
3fcc2697
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
# limitations under the License.
# limitations under the License.
IMAGE
=
gcr.io/kubernetes-e2e-test-images/k8s-sample-admission-webhook-amd64
IMAGE
=
gcr.io/kubernetes-e2e-test-images/k8s-sample-admission-webhook-amd64
TAG
=
1.
9v2
TAG
=
1.
10v1
build
:
build
:
CGO_ENABLED
=
0
GOOS
=
linux go build
-a
-installsuffix
cgo
-o
webhook .
CGO_ENABLED
=
0
GOOS
=
linux go build
-a
-installsuffix
cgo
-o
webhook .
...
...
test/images/webhook/main.go
View file @
3fcc2697
...
@@ -204,8 +204,8 @@ func mutateConfigmaps(ar v1beta1.AdmissionReview) *v1beta1.AdmissionResponse {
...
@@ -204,8 +204,8 @@ func mutateConfigmaps(ar v1beta1.AdmissionReview) *v1beta1.AdmissionResponse {
return
&
reviewResponse
return
&
reviewResponse
}
}
func
mutateC
RD
(
ar
v1beta1
.
AdmissionReview
)
*
v1beta1
.
AdmissionResponse
{
func
mutateC
ustomResource
(
ar
v1beta1
.
AdmissionReview
)
*
v1beta1
.
AdmissionResponse
{
glog
.
V
(
2
)
.
Info
(
"mutating c
rd
"
)
glog
.
V
(
2
)
.
Info
(
"mutating c
ustom resource
"
)
cr
:=
struct
{
cr
:=
struct
{
metav1
.
ObjectMeta
metav1
.
ObjectMeta
Data
map
[
string
]
string
Data
map
[
string
]
string
...
@@ -232,8 +232,8 @@ func mutateCRD(ar v1beta1.AdmissionReview) *v1beta1.AdmissionResponse {
...
@@ -232,8 +232,8 @@ func mutateCRD(ar v1beta1.AdmissionReview) *v1beta1.AdmissionResponse {
return
&
reviewResponse
return
&
reviewResponse
}
}
func
admitC
RD
(
ar
v1beta1
.
AdmissionReview
)
*
v1beta1
.
AdmissionResponse
{
func
admitC
ustomResource
(
ar
v1beta1
.
AdmissionReview
)
*
v1beta1
.
AdmissionResponse
{
glog
.
V
(
2
)
.
Info
(
"admitting c
rd
"
)
glog
.
V
(
2
)
.
Info
(
"admitting c
ustom resource
"
)
cr
:=
struct
{
cr
:=
struct
{
metav1
.
ObjectMeta
metav1
.
ObjectMeta
Data
map
[
string
]
string
Data
map
[
string
]
string
...
@@ -324,12 +324,12 @@ func serveMutateConfigmaps(w http.ResponseWriter, r *http.Request) {
...
@@ -324,12 +324,12 @@ func serveMutateConfigmaps(w http.ResponseWriter, r *http.Request) {
serve
(
w
,
r
,
mutateConfigmaps
)
serve
(
w
,
r
,
mutateConfigmaps
)
}
}
func
serveC
RD
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
func
serveC
ustomResource
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
serve
(
w
,
r
,
admitC
RD
)
serve
(
w
,
r
,
admitC
ustomResource
)
}
}
func
serveMutateC
RD
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
func
serveMutateC
ustomResource
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
serve
(
w
,
r
,
mutateC
RD
)
serve
(
w
,
r
,
mutateC
ustomResource
)
}
}
func
main
()
{
func
main
()
{
...
@@ -342,8 +342,8 @@ func main() {
...
@@ -342,8 +342,8 @@ func main() {
http
.
HandleFunc
(
"/mutating-pods"
,
serveMutatePods
)
http
.
HandleFunc
(
"/mutating-pods"
,
serveMutatePods
)
http
.
HandleFunc
(
"/configmaps"
,
serveConfigmaps
)
http
.
HandleFunc
(
"/configmaps"
,
serveConfigmaps
)
http
.
HandleFunc
(
"/mutating-configmaps"
,
serveMutateConfigmaps
)
http
.
HandleFunc
(
"/mutating-configmaps"
,
serveMutateConfigmaps
)
http
.
HandleFunc
(
"/c
rd"
,
serveCRD
)
http
.
HandleFunc
(
"/c
ustom-resource"
,
serveCustomResource
)
http
.
HandleFunc
(
"/mutating-c
rd"
,
serveMutateCRD
)
http
.
HandleFunc
(
"/mutating-c
ustom-resource"
,
serveMutateCustomResource
)
clientset
:=
getClient
()
clientset
:=
getClient
()
server
:=
&
http
.
Server
{
server
:=
&
http
.
Server
{
Addr
:
":443"
,
Addr
:
":443"
,
...
...
test/utils/image/manifest.go
View file @
3fcc2697
...
@@ -48,7 +48,7 @@ func (i *ImageConfig) SetVersion(version string) {
...
@@ -48,7 +48,7 @@ func (i *ImageConfig) SetVersion(version string) {
}
}
var
(
var
(
AdmissionWebhook
=
ImageConfig
{
e2eRegistry
,
"k8s-sample-admission-webhook"
,
"1.
9v2
"
,
true
}
AdmissionWebhook
=
ImageConfig
{
e2eRegistry
,
"k8s-sample-admission-webhook"
,
"1.
10v1
"
,
true
}
APIServer
=
ImageConfig
{
e2eRegistry
,
"k8s-aggregator-sample-apiserver"
,
"1.7v2"
,
true
}
APIServer
=
ImageConfig
{
e2eRegistry
,
"k8s-aggregator-sample-apiserver"
,
"1.7v2"
,
true
}
AppArmorLoader
=
ImageConfig
{
gcRegistry
,
"apparmor-loader"
,
"0.1"
,
false
}
AppArmorLoader
=
ImageConfig
{
gcRegistry
,
"apparmor-loader"
,
"0.1"
,
false
}
BusyBox
=
ImageConfig
{
gcRegistry
,
"busybox"
,
"1.24"
,
false
}
BusyBox
=
ImageConfig
{
gcRegistry
,
"busybox"
,
"1.24"
,
false
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment