Commit ab273a7f authored by galal-hussein's avatar galal-hussein Committed by Craig Jellick

update helm controller

parent 0f927074
...@@ -98,7 +98,7 @@ require ( ...@@ -98,7 +98,7 @@ require (
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.2.0 github.com/rancher/dynamiclistener v0.2.0
github.com/rancher/helm-controller v0.3.0 github.com/rancher/helm-controller v0.4.0
github.com/rancher/kine v0.3.2 github.com/rancher/kine v0.3.2
github.com/rancher/remotedialer v0.2.0 github.com/rancher/remotedialer v0.2.0
github.com/rancher/wrangler v0.4.0 github.com/rancher/wrangler v0.4.0
......
...@@ -715,6 +715,8 @@ github.com/rancher/flannel v0.11.0-k3s.1 h1:mIwnfWDafjzQgFkZeJ1AkFrrAT3EdBaA1giE ...@@ -715,6 +715,8 @@ github.com/rancher/flannel v0.11.0-k3s.1 h1:mIwnfWDafjzQgFkZeJ1AkFrrAT3EdBaA1giE
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.3.0 h1:sYRpOiJc4+NmSEkft3lR2pwaEPOrPzZOTo2UjFnVF4I= github.com/rancher/helm-controller v0.3.0 h1:sYRpOiJc4+NmSEkft3lR2pwaEPOrPzZOTo2UjFnVF4I=
github.com/rancher/helm-controller v0.3.0/go.mod h1:194LHuZRrxcD82bG1rJtOWsw98U4JbPhDWqvL7l3PAw= github.com/rancher/helm-controller v0.3.0/go.mod h1:194LHuZRrxcD82bG1rJtOWsw98U4JbPhDWqvL7l3PAw=
github.com/rancher/helm-controller v0.4.0 h1:VO7TqMsMWh3TJK7U38LLht1uHiDy0fSYWSywT0bE5lY=
github.com/rancher/helm-controller v0.4.0/go.mod h1:194LHuZRrxcD82bG1rJtOWsw98U4JbPhDWqvL7l3PAw=
github.com/rancher/kine v0.3.2 h1:2kP48ojBWVoZ6vlzixc9jc9uKRk7Yn1a7kWoOsJi7Sg= github.com/rancher/kine v0.3.2 h1:2kP48ojBWVoZ6vlzixc9jc9uKRk7Yn1a7kWoOsJi7Sg=
github.com/rancher/kine v0.3.2/go.mod h1:xEMl0tLCva9/9me7mXJ3m9Vo6yqHgC4OU3NiK4CPrGQ= github.com/rancher/kine v0.3.2/go.mod h1:xEMl0tLCva9/9me7mXJ3m9Vo6yqHgC4OU3NiK4CPrGQ=
github.com/rancher/kubernetes v1.17.0-k3s.1 h1:g1xvTHOHMJxwWtseblor0gighLRHpL7Bf9MwX8HR3W0= github.com/rancher/kubernetes v1.17.0-k3s.1 h1:g1xvTHOHMJxwWtseblor0gighLRHpL7Bf9MwX8HR3W0=
......
...@@ -18,5 +18,4 @@ limitations under the License. ...@@ -18,5 +18,4 @@ limitations under the License.
// +k8s:deepcopy-gen=package // +k8s:deepcopy-gen=package
// +groupName=helm.cattle.io // +groupName=helm.cattle.io
package v1 package v1
...@@ -23,6 +23,7 @@ type HelmChartSpec struct { ...@@ -23,6 +23,7 @@ type HelmChartSpec struct {
Repo string `json:"repo,omitempty"` Repo string `json:"repo,omitempty"`
Set map[string]intstr.IntOrString `json:"set,omitempty"` Set map[string]intstr.IntOrString `json:"set,omitempty"`
ValuesContent string `json:"valuesContent,omitempty"` ValuesContent string `json:"valuesContent,omitempty"`
HelmVersion string `json:"helmVersion,omitempty"`
} }
type HelmChartStatus struct { type HelmChartStatus struct {
......
...@@ -39,7 +39,7 @@ type Controller struct { ...@@ -39,7 +39,7 @@ type Controller struct {
} }
const ( const (
image = "rancher/klipper-helm:v0.1.5" image = "rancher/klipper-helm:v0.2.0"
label = "helmcharts.helm.cattle.io/chart" label = "helmcharts.helm.cattle.io/chart"
name = "helm-controller" name = "helm-controller"
) )
...@@ -199,6 +199,22 @@ func job(chart *helmv1.HelmChart) (*batch.Job, *core.ConfigMap) { ...@@ -199,6 +199,22 @@ func job(chart *helmv1.HelmChart) (*batch.Job, *core.ConfigMap) {
Name: "VALUES_HASH", Name: "VALUES_HASH",
Value: hex.EncodeToString(valuesHash[:]), Value: hex.EncodeToString(valuesHash[:]),
}, },
{
Name: "HELM_DRIVER",
Value: "secret",
},
{
Name: "CHART_NAMESPACE",
Value: chart.Namespace,
},
{
Name: "CHART",
Value: chart.Spec.Chart,
},
{
Name: "HELM_VERSION",
Value: chart.Spec.HelmVersion,
},
}, },
}, },
}, },
...@@ -298,15 +314,12 @@ func args(chart *helmv1.HelmChart) []string { ...@@ -298,15 +314,12 @@ func args(chart *helmv1.HelmChart) []string {
if chart.DeletionTimestamp != nil { if chart.DeletionTimestamp != nil {
return []string{ return []string{
"delete", "delete",
"--purge", chart.Name,
} }
} }
spec := chart.Spec spec := chart.Spec
args := []string{ args := []string{
"install", "install",
"--name", chart.Name,
spec.Chart,
} }
if spec.TargetNamespace != "" { if spec.TargetNamespace != "" {
args = append(args, "--namespace", spec.TargetNamespace) args = append(args, "--namespace", spec.TargetNamespace)
......
...@@ -711,7 +711,7 @@ github.com/rancher/dynamiclistener/factory ...@@ -711,7 +711,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.3.0 # github.com/rancher/helm-controller v0.4.0
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment