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
01035ba9
Unverified
Commit
01035ba9
authored
Jun 21, 2020
by
Hussein Galal
Committed by
GitHub
Jun 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update helm controller to 0.6.3 (#1931)
* update helm controller to 0.6.3 * update klipper-helm to v0.2.7
parent
556d2ad6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
97 additions
and
38 deletions
+97
-38
go.mod
go.mod
+1
-1
go.sum
go.sum
+2
-2
image-list.txt
scripts/airgap/image-list.txt
+1
-1
types.go
...ncher/helm-controller/pkg/apis/helm.cattle.io/v1/types.go
+1
-0
controller.go
...github.com/rancher/helm-controller/pkg/helm/controller.go
+91
-33
modules.txt
vendor/modules.txt
+1
-1
No files found.
go.mod
View file @
01035ba9
...
@@ -98,7 +98,7 @@ require (
...
@@ -98,7 +98,7 @@ require (
github.com/pkg/errors v0.9.1
github.com/pkg/errors v0.9.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.2.0
github.com/rancher/dynamiclistener v0.2.0
github.com/rancher/helm-controller v0.6.
2
github.com/rancher/helm-controller v0.6.
3
github.com/rancher/kine v0.4.0
github.com/rancher/kine v0.4.0
github.com/rancher/remotedialer v0.2.0
github.com/rancher/remotedialer v0.2.0
github.com/rancher/wrangler v0.6.1
github.com/rancher/wrangler v0.6.1
...
...
go.sum
View file @
01035ba9
...
@@ -626,8 +626,8 @@ github.com/rancher/dynamiclistener v0.2.0 h1:KucYwJXVVGhZ/NndfMCeQoCafT/VN7kvqSG
...
@@ -626,8 +626,8 @@ github.com/rancher/dynamiclistener v0.2.0 h1:KucYwJXVVGhZ/NndfMCeQoCafT/VN7kvqSG
github.com/rancher/dynamiclistener v0.2.0/go.mod h1:fs/dxyNcB3YT6W9fVz4bDGfhmSQS17QQup6BIcGF++s=
github.com/rancher/dynamiclistener v0.2.0/go.mod h1:fs/dxyNcB3YT6W9fVz4bDGfhmSQS17QQup6BIcGF++s=
github.com/rancher/flannel v0.11.0-k3s.2 h1:0GVr5ORAIvcri1LYTE8eMQ+NrRbuPeIniPaW51IzLco=
github.com/rancher/flannel v0.11.0-k3s.2 h1:0GVr5ORAIvcri1LYTE8eMQ+NrRbuPeIniPaW51IzLco=
github.com/rancher/flannel v0.11.0-k3s.2/go.mod h1:Hn4ZV+eq0LhLZP63xZnxdGwXEoRSxs5sxELxu27M3UA=
github.com/rancher/flannel v0.11.0-k3s.2/go.mod h1:Hn4ZV+eq0LhLZP63xZnxdGwXEoRSxs5sxELxu27M3UA=
github.com/rancher/helm-controller v0.6.
2 h1:YUj8YHFyaMInu52GfA7KeXQQg8uOvwHpBqDUwFzLsIk
=
github.com/rancher/helm-controller v0.6.
3 h1:tsqSXndQ7Ms8S0mBd2zWOcTV1tiZ4BUYkemYnijNXio
=
github.com/rancher/helm-controller v0.6.
2
/go.mod h1:ZylsxIMGNADRPRNW+NiBWhrwwks9vnKLQiCHYWb6Bi0=
github.com/rancher/helm-controller v0.6.
3
/go.mod h1:ZylsxIMGNADRPRNW+NiBWhrwwks9vnKLQiCHYWb6Bi0=
github.com/rancher/kine v0.4.0 h1:1IhWy3TzjExG8xnj46eyUEWdzqNAD1WrgL4eEBKm6Uc=
github.com/rancher/kine v0.4.0 h1:1IhWy3TzjExG8xnj46eyUEWdzqNAD1WrgL4eEBKm6Uc=
github.com/rancher/kine v0.4.0/go.mod h1:IImtCJ68AIkE+VY/kUI0NkyJL5q5WzO8QvMsSXqbrpA=
github.com/rancher/kine v0.4.0/go.mod h1:IImtCJ68AIkE+VY/kUI0NkyJL5q5WzO8QvMsSXqbrpA=
github.com/rancher/kubernetes v1.18.3-k3s1 h1:QYh2MY+odOzBQedwClFdX1tRtYQADaFRWi+etbBJvuU=
github.com/rancher/kubernetes v1.18.3-k3s1 h1:QYh2MY+odOzBQedwClFdX1tRtYQADaFRWi+etbBJvuU=
...
...
scripts/airgap/image-list.txt
View file @
01035ba9
docker.io/rancher/coredns-coredns:1.6.3
docker.io/rancher/coredns-coredns:1.6.3
docker.io/rancher/klipper-helm:v0.2.
6
docker.io/rancher/klipper-helm:v0.2.
7
docker.io/rancher/klipper-lb:v0.1.2
docker.io/rancher/klipper-lb:v0.1.2
docker.io/rancher/library-traefik:1.7.19
docker.io/rancher/library-traefik:1.7.19
docker.io/rancher/local-path-provisioner:v0.0.14
docker.io/rancher/local-path-provisioner:v0.0.14
...
...
vendor/github.com/rancher/helm-controller/pkg/apis/helm.cattle.io/v1/types.go
View file @
01035ba9
...
@@ -25,6 +25,7 @@ type HelmChartSpec struct {
...
@@ -25,6 +25,7 @@ type HelmChartSpec struct {
ValuesContent
string
`json:"valuesContent,omitempty"`
ValuesContent
string
`json:"valuesContent,omitempty"`
HelmVersion
string
`json:"helmVersion,omitempty"`
HelmVersion
string
`json:"helmVersion,omitempty"`
Bootstrap
bool
`json:"bootstrap,omitempty"`
Bootstrap
bool
`json:"bootstrap,omitempty"`
ChartContent
string
`json:"chartContent,omitempty"`
}
}
type
HelmChartStatus
struct
{
type
HelmChartStatus
struct
{
...
...
vendor/github.com/rancher/helm-controller/pkg/helm/controller.go
View file @
01035ba9
...
@@ -39,7 +39,7 @@ type Controller struct {
...
@@ -39,7 +39,7 @@ type Controller struct {
}
}
const
(
const
(
image
=
"rancher/klipper-helm:v0.2.
6
"
image
=
"rancher/klipper-helm:v0.2.
7
"
Label
=
"helmcharts.helm.cattle.io/chart"
Label
=
"helmcharts.helm.cattle.io/chart"
CRDName
=
"helmcharts.helm.cattle.io"
CRDName
=
"helmcharts.helm.cattle.io"
Name
=
"helm-controller"
Name
=
"helm-controller"
...
@@ -94,17 +94,20 @@ func (c *Controller) OnHelmChanged(key string, chart *helmv1.HelmChart) (*helmv1
...
@@ -94,17 +94,20 @@ func (c *Controller) OnHelmChanged(key string, chart *helmv1.HelmChart) (*helmv1
return
nil
,
nil
return
nil
,
nil
}
}
if
chart
.
Spec
.
Chart
==
""
{
if
chart
.
Spec
.
Chart
==
""
&&
chart
.
Spec
.
ChartContent
==
""
{
return
chart
,
nil
return
chart
,
nil
}
}
objs
:=
objectset
.
NewObjectSet
()
objs
:=
objectset
.
NewObjectSet
()
job
,
c
onfigMap
:=
job
(
chart
)
job
,
valuesConfigMap
,
contentC
onfigMap
:=
job
(
chart
)
objs
.
Add
(
serviceAccount
(
chart
))
objs
.
Add
(
serviceAccount
(
chart
))
objs
.
Add
(
roleBinding
(
chart
))
objs
.
Add
(
roleBinding
(
chart
))
objs
.
Add
(
job
)
objs
.
Add
(
job
)
if
configMap
!=
nil
{
if
valuesConfigMap
!=
nil
{
objs
.
Add
(
configMap
)
objs
.
Add
(
valuesConfigMap
)
}
if
contentConfigMap
!=
nil
{
objs
.
Add
(
contentConfigMap
)
}
}
if
err
:=
c
.
apply
.
WithOwner
(
chart
)
.
Apply
(
objs
);
err
!=
nil
{
if
err
:=
c
.
apply
.
WithOwner
(
chart
)
.
Apply
(
objs
);
err
!=
nil
{
...
@@ -120,7 +123,7 @@ func (c *Controller) OnHelmRemove(key string, chart *helmv1.HelmChart) (*helmv1.
...
@@ -120,7 +123,7 @@ func (c *Controller) OnHelmRemove(key string, chart *helmv1.HelmChart) (*helmv1.
if
chart
.
Spec
.
Chart
==
""
{
if
chart
.
Spec
.
Chart
==
""
{
return
chart
,
nil
return
chart
,
nil
}
}
job
,
_
:=
job
(
chart
)
job
,
_
,
_
:=
job
(
chart
)
job
,
err
:=
c
.
jobsCache
.
Get
(
chart
.
Namespace
,
job
.
Name
)
job
,
err
:=
c
.
jobsCache
.
Get
(
chart
.
Namespace
,
job
.
Name
)
if
errors
.
IsNotFound
(
err
)
{
if
errors
.
IsNotFound
(
err
)
{
...
@@ -147,7 +150,7 @@ func (c *Controller) OnHelmRemove(key string, chart *helmv1.HelmChart) (*helmv1.
...
@@ -147,7 +150,7 @@ func (c *Controller) OnHelmRemove(key string, chart *helmv1.HelmChart) (*helmv1.
return
newChart
,
c
.
apply
.
WithOwner
(
newChart
)
.
Apply
(
objectset
.
NewObjectSet
())
return
newChart
,
c
.
apply
.
WithOwner
(
newChart
)
.
Apply
(
objectset
.
NewObjectSet
())
}
}
func
job
(
chart
*
helmv1
.
HelmChart
)
(
*
batch
.
Job
,
*
core
.
ConfigMap
)
{
func
job
(
chart
*
helmv1
.
HelmChart
)
(
*
batch
.
Job
,
*
core
.
ConfigMap
,
*
core
.
ConfigMap
)
{
oneThousand
:=
int32
(
1000
)
oneThousand
:=
int32
(
1000
)
valuesHash
:=
sha256
.
Sum256
([]
byte
(
chart
.
Spec
.
ValuesContent
))
valuesHash
:=
sha256
.
Sum256
([]
byte
(
chart
.
Spec
.
ValuesContent
))
...
@@ -247,35 +250,13 @@ func job(chart *helmv1.HelmChart) (*batch.Job, *core.ConfigMap) {
...
@@ -247,35 +250,13 @@ func job(chart *helmv1.HelmChart) (*batch.Job, *core.ConfigMap) {
}
}
setProxyEnv
(
job
)
setProxyEnv
(
job
)
configMap
:=
configMap
(
chart
)
valueConfigMap
:=
setValuesConfigMap
(
job
,
chart
)
if
configMap
==
nil
{
contentConfigMap
:=
setContentConfigMap
(
job
,
chart
)
return
job
,
nil
}
job
.
Spec
.
Template
.
Spec
.
Volumes
=
[]
core
.
Volume
{
return
job
,
valueConfigMap
,
contentConfigMap
{
Name
:
"values"
,
VolumeSource
:
core
.
VolumeSource
{
ConfigMap
:
&
core
.
ConfigMapVolumeSource
{
LocalObjectReference
:
core
.
LocalObjectReference
{
Name
:
configMap
.
Name
,
},
},
},
},
}
job
.
Spec
.
Template
.
Spec
.
Containers
[
0
]
.
VolumeMounts
=
[]
core
.
VolumeMount
{
{
MountPath
:
"/config"
,
Name
:
"values"
,
},
}
return
job
,
configMap
}
}
func
c
onfigMap
(
chart
*
helmv1
.
HelmChart
)
*
core
.
ConfigMap
{
func
valuesC
onfigMap
(
chart
*
helmv1
.
HelmChart
)
*
core
.
ConfigMap
{
if
chart
.
Spec
.
ValuesContent
==
""
{
if
chart
.
Spec
.
ValuesContent
==
""
{
return
nil
return
nil
}
}
...
@@ -402,3 +383,80 @@ func setProxyEnv(job *batch.Job) {
...
@@ -402,3 +383,80 @@ func setProxyEnv(job *batch.Job) {
envar
)
envar
)
}
}
}
}
func
contentConfigMap
(
chart
*
helmv1
.
HelmChart
)
*
core
.
ConfigMap
{
if
chart
.
Spec
.
ChartContent
==
""
{
return
nil
}
return
&
core
.
ConfigMap
{
TypeMeta
:
meta
.
TypeMeta
{
APIVersion
:
"v1"
,
Kind
:
"ConfigMap"
,
},
ObjectMeta
:
meta
.
ObjectMeta
{
Name
:
fmt
.
Sprintf
(
"chart-content-%s"
,
chart
.
Name
),
Namespace
:
chart
.
Namespace
,
},
Data
:
map
[
string
]
string
{
fmt
.
Sprintf
(
"%s.tgz.base64"
,
chart
.
Name
)
:
chart
.
Spec
.
ChartContent
,
},
}
}
func
setValuesConfigMap
(
job
*
batch
.
Job
,
chart
*
helmv1
.
HelmChart
)
*
core
.
ConfigMap
{
configMap
:=
valuesConfigMap
(
chart
)
if
configMap
==
nil
{
return
nil
}
job
.
Spec
.
Template
.
Spec
.
Volumes
=
append
(
job
.
Spec
.
Template
.
Spec
.
Volumes
,
[]
core
.
Volume
{
{
Name
:
"values"
,
VolumeSource
:
core
.
VolumeSource
{
ConfigMap
:
&
core
.
ConfigMapVolumeSource
{
LocalObjectReference
:
core
.
LocalObjectReference
{
Name
:
configMap
.
Name
,
},
},
},
},
}
...
)
job
.
Spec
.
Template
.
Spec
.
Containers
[
0
]
.
VolumeMounts
=
append
(
job
.
Spec
.
Template
.
Spec
.
Containers
[
0
]
.
VolumeMounts
,
[]
core
.
VolumeMount
{
{
MountPath
:
"/config"
,
Name
:
"values"
,
},
}
...
)
return
configMap
}
func
setContentConfigMap
(
job
*
batch
.
Job
,
chart
*
helmv1
.
HelmChart
)
*
core
.
ConfigMap
{
configMap
:=
contentConfigMap
(
chart
)
if
configMap
==
nil
{
return
nil
}
job
.
Spec
.
Template
.
Spec
.
Volumes
=
append
(
job
.
Spec
.
Template
.
Spec
.
Volumes
,
[]
core
.
Volume
{
{
Name
:
"content"
,
VolumeSource
:
core
.
VolumeSource
{
ConfigMap
:
&
core
.
ConfigMapVolumeSource
{
LocalObjectReference
:
core
.
LocalObjectReference
{
Name
:
configMap
.
Name
,
},
},
},
},
}
...
)
job
.
Spec
.
Template
.
Spec
.
Containers
[
0
]
.
VolumeMounts
=
append
(
job
.
Spec
.
Template
.
Spec
.
Containers
[
0
]
.
VolumeMounts
,
[]
core
.
VolumeMount
{
{
MountPath
:
"/chart"
,
Name
:
"content"
,
},
}
...
)
return
configMap
}
vendor/modules.txt
View file @
01035ba9
...
@@ -727,7 +727,7 @@ github.com/rancher/dynamiclistener/factory
...
@@ -727,7 +727,7 @@ github.com/rancher/dynamiclistener/factory
github.com/rancher/dynamiclistener/storage/file
github.com/rancher/dynamiclistener/storage/file
github.com/rancher/dynamiclistener/storage/kubernetes
github.com/rancher/dynamiclistener/storage/kubernetes
github.com/rancher/dynamiclistener/storage/memory
github.com/rancher/dynamiclistener/storage/memory
# github.com/rancher/helm-controller v0.6.
2
# github.com/rancher/helm-controller v0.6.
3
github.com/rancher/helm-controller/pkg/apis/helm.cattle.io
github.com/rancher/helm-controller/pkg/apis/helm.cattle.io
github.com/rancher/helm-controller/pkg/apis/helm.cattle.io/v1
github.com/rancher/helm-controller/pkg/apis/helm.cattle.io/v1
github.com/rancher/helm-controller/pkg/generated/clientset/versioned
github.com/rancher/helm-controller/pkg/generated/clientset/versioned
...
...
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