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
b67b6247
Commit
b67b6247
authored
Nov 08, 2019
by
Darren Shepherd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update dynamiclistener
parent
53d3ab07
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
21 deletions
+49
-21
go.mod
go.mod
+1
-1
go.sum
go.sum
+2
-0
redirect.go
vendor/github.com/rancher/dynamiclistener/redirect.go
+0
-2
controller.go
.../rancher/dynamiclistener/storage/kubernetes/controller.go
+45
-17
modules.txt
vendor/modules.txt
+1
-1
No files found.
go.mod
View file @
b67b6247
...
@@ -96,7 +96,7 @@ require (
...
@@ -96,7 +96,7 @@ require (
github.com/opencontainers/runc v1.0.0-rc2.0.20190611121236-6cc515888830
github.com/opencontainers/runc v1.0.0-rc2.0.20190611121236-6cc515888830
github.com/pkg/errors v0.8.1
github.com/pkg/errors v0.8.1
github.com/rakelkar/gonetsh v0.0.0-20190719023240-501daadcadf8 // indirect
github.com/rakelkar/gonetsh v0.0.0-20190719023240-501daadcadf8 // indirect
github.com/rancher/dynamiclistener v0.1.1-0.20191
031022009-6224794ef3cb
github.com/rancher/dynamiclistener v0.1.1-0.20191
108205817-245f86cc340a
github.com/rancher/helm-controller v0.2.2
github.com/rancher/helm-controller v0.2.2
github.com/rancher/kine v0.1.2-0.20191107225357-527576e3452f
github.com/rancher/kine v0.1.2-0.20191107225357-527576e3452f
github.com/rancher/remotedialer v0.2.0
github.com/rancher/remotedialer v0.2.0
...
...
go.sum
View file @
b67b6247
...
@@ -564,6 +564,8 @@ github.com/rancher/cri-tools v1.16.1-k3s.1 h1:iporgQ46noE6dtLzq6fWcIO2qjyPZy2m42
...
@@ -564,6 +564,8 @@ github.com/rancher/cri-tools v1.16.1-k3s.1 h1:iporgQ46noE6dtLzq6fWcIO2qjyPZy2m42
github.com/rancher/cri-tools v1.16.1-k3s.1/go.mod h1:TEKhKv2EJIZp+p9jnEy4C63g8CosJzsI4kyKKkHag+8=
github.com/rancher/cri-tools v1.16.1-k3s.1/go.mod h1:TEKhKv2EJIZp+p9jnEy4C63g8CosJzsI4kyKKkHag+8=
github.com/rancher/dynamiclistener v0.1.1-0.20191031022009-6224794ef3cb h1:bMoA9UHr1QNTWVrf0fSJCba6YDU1xmt2jmeohpiugKg=
github.com/rancher/dynamiclistener v0.1.1-0.20191031022009-6224794ef3cb h1:bMoA9UHr1QNTWVrf0fSJCba6YDU1xmt2jmeohpiugKg=
github.com/rancher/dynamiclistener v0.1.1-0.20191031022009-6224794ef3cb/go.mod h1:fs/dxyNcB3YT6W9fVz4bDGfhmSQS17QQup6BIcGF++s=
github.com/rancher/dynamiclistener v0.1.1-0.20191031022009-6224794ef3cb/go.mod h1:fs/dxyNcB3YT6W9fVz4bDGfhmSQS17QQup6BIcGF++s=
github.com/rancher/dynamiclistener v0.1.1-0.20191108205817-245f86cc340a h1:yIQXTC2BjGQ4Bt5Y7QhnxNWbbq8e6koH+pFrJL2VsIs=
github.com/rancher/dynamiclistener v0.1.1-0.20191108205817-245f86cc340a/go.mod h1:fs/dxyNcB3YT6W9fVz4bDGfhmSQS17QQup6BIcGF++s=
github.com/rancher/flannel v0.11.0-k3s.1 h1:mIwnfWDafjzQgFkZeJ1AkFrrAT3EdBaA1giE0eLJKo8=
github.com/rancher/flannel v0.11.0-k3s.1 h1:mIwnfWDafjzQgFkZeJ1AkFrrAT3EdBaA1giE0eLJKo8=
github.com/rancher/flannel v0.11.0-k3s.1/go.mod h1:Hn4ZV+eq0LhLZP63xZnxdGwXEoRSxs5sxELxu27M3UA=
github.com/rancher/flannel v0.11.0-k3s.1/go.mod h1:Hn4ZV+eq0LhLZP63xZnxdGwXEoRSxs5sxELxu27M3UA=
github.com/rancher/helm-controller v0.2.2 h1:MUqisy53/Ay1EYOF2uTCYBbGpgtZLNKKrI01BdxIbQo=
github.com/rancher/helm-controller v0.2.2 h1:MUqisy53/Ay1EYOF2uTCYBbGpgtZLNKKrI01BdxIbQo=
...
...
vendor/github.com/rancher/dynamiclistener/redirect.go
View file @
b67b6247
package
dynamiclistener
package
dynamiclistener
import
(
import
(
"fmt"
"net"
"net"
"net/http"
"net/http"
"strconv"
"strconv"
...
@@ -12,7 +11,6 @@ import (
...
@@ -12,7 +11,6 @@ import (
func
HTTPRedirect
(
next
http
.
Handler
)
http
.
Handler
{
func
HTTPRedirect
(
next
http
.
Handler
)
http
.
Handler
{
return
http
.
HandlerFunc
(
return
http
.
HandlerFunc
(
func
(
rw
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
func
(
rw
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
fmt
.
Println
(
"!!!!!"
,
r
.
URL
.
String
(),
r
.
Header
)
if
r
.
Header
.
Get
(
"x-Forwarded-Proto"
)
==
"https"
||
if
r
.
Header
.
Get
(
"x-Forwarded-Proto"
)
==
"https"
||
r
.
Header
.
Get
(
"x-Forwarded-Proto"
)
==
"wss"
||
r
.
Header
.
Get
(
"x-Forwarded-Proto"
)
==
"wss"
||
strings
.
HasPrefix
(
r
.
URL
.
Path
,
"/ping"
)
||
strings
.
HasPrefix
(
r
.
URL
.
Path
,
"/ping"
)
||
...
...
vendor/github.com/rancher/dynamiclistener/storage/kubernetes/controller.go
View file @
b67b6247
...
@@ -9,8 +9,11 @@ import (
...
@@ -9,8 +9,11 @@ import (
"github.com/rancher/wrangler-api/pkg/generated/controllers/core"
"github.com/rancher/wrangler-api/pkg/generated/controllers/core"
v1controller
"github.com/rancher/wrangler-api/pkg/generated/controllers/core/v1"
v1controller
"github.com/rancher/wrangler-api/pkg/generated/controllers/core/v1"
"github.com/rancher/wrangler/pkg/start"
"github.com/rancher/wrangler/pkg/start"
"github.com/sirupsen/logrus"
v1
"k8s.io/api/core/v1"
v1
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/equality"
"k8s.io/apimachinery/pkg/api/equality"
"k8s.io/apimachinery/pkg/api/errors"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
)
)
type
CoreGetter
func
()
*
core
.
Factory
type
CoreGetter
func
()
*
core
.
Factory
...
@@ -79,31 +82,56 @@ func (s *storage) Get() (*v1.Secret, error) {
...
@@ -79,31 +82,56 @@ func (s *storage) Get() (*v1.Secret, error) {
return
s
.
storage
.
Get
()
return
s
.
storage
.
Get
()
}
}
func
(
s
*
storage
)
Update
(
secret
*
v1
.
Secret
)
(
err
error
)
{
func
(
s
*
storage
)
targetSecret
()
(
*
v1
.
Secret
,
error
)
{
s
.
Lock
()
existingSecret
,
err
:=
s
.
secrets
.
Get
(
s
.
namespace
,
s
.
name
,
metav1
.
GetOptions
{})
defer
s
.
Unlock
()
if
errors
.
IsNotFound
(
err
)
{
return
&
v1
.
Secret
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
s
.
name
,
Namespace
:
s
.
namespace
,
},
},
nil
}
return
existingSecret
,
err
}
if
s
.
secrets
!=
nil
{
func
(
s
*
storage
)
saveInK8s
(
secret
*
v1
.
Secret
)
(
*
v1
.
Secret
,
error
)
{
if
secret
.
UID
==
""
{
if
s
.
secrets
==
nil
{
secret
.
Name
=
s
.
name
return
secret
,
nil
secret
.
Namespace
=
s
.
namespace
}
secret
,
err
=
s
.
secrets
.
Create
(
secret
)
targetSecret
,
err
:=
s
.
targetSecret
()
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
nil
,
err
}
if
equality
.
Semantic
.
DeepEqual
(
targetSecret
.
Annotations
,
secret
.
Annotations
)
&&
equality
.
Semantic
.
DeepEqual
(
targetSecret
.
Data
,
secret
.
Data
)
{
return
secret
,
nil
}
}
targetSecret
.
Annotations
=
secret
.
Annotations
targetSecret
.
Type
=
v1
.
SecretTypeTLS
targetSecret
.
Data
=
secret
.
Data
if
targetSecret
.
UID
==
""
{
logrus
.
Infof
(
"Creating new TLS secret for %v"
,
targetSecret
.
Annotations
)
return
s
.
secrets
.
Create
(
targetSecret
)
}
else
{
}
else
{
existingSecret
,
err
:=
s
.
storage
.
Get
()
logrus
.
Infof
(
"Updating TLS secret for %v"
,
targetSecret
.
Annotations
)
if
err
!=
nil
{
return
s
.
secrets
.
Update
(
targetSecret
)
return
err
}
}
if
!
equality
.
Semantic
.
DeepEqual
(
secret
.
Data
,
existingSecret
.
Data
)
{
}
secret
,
err
=
s
.
secrets
.
Update
(
secret
)
func
(
s
*
storage
)
Update
(
secret
*
v1
.
Secret
)
(
err
error
)
{
s
.
Lock
()
defer
s
.
Unlock
()
secret
,
err
=
s
.
saveInK8s
(
secret
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
}
}
}
// update underlying storage
return
s
.
storage
.
Update
(
secret
)
return
s
.
storage
.
Update
(
secret
)
}
}
vendor/modules.txt
View file @
b67b6247
...
@@ -726,7 +726,7 @@ github.com/prometheus/procfs/internal/util
...
@@ -726,7 +726,7 @@ github.com/prometheus/procfs/internal/util
# github.com/rakelkar/gonetsh v0.0.0-20190719023240-501daadcadf8
# github.com/rakelkar/gonetsh v0.0.0-20190719023240-501daadcadf8
github.com/rakelkar/gonetsh/netroute
github.com/rakelkar/gonetsh/netroute
github.com/rakelkar/gonetsh/netsh
github.com/rakelkar/gonetsh/netsh
# github.com/rancher/dynamiclistener v0.1.1-0.20191
031022009-6224794ef3cb
# github.com/rancher/dynamiclistener v0.1.1-0.20191
108205817-245f86cc340a
github.com/rancher/dynamiclistener
github.com/rancher/dynamiclistener
github.com/rancher/dynamiclistener/factory
github.com/rancher/dynamiclistener/factory
github.com/rancher/dynamiclistener/storage/file
github.com/rancher/dynamiclistener/storage/file
...
...
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