Skip to content

Commit

Permalink
Regenerate bundles from git if git targets change.
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuildthecloud committed Sep 4, 2020
1 parent a583814 commit 66e61a2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/controllers/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

fleet "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/v1alpha1"
"github.com/rancher/fleet/pkg/config"
"github.com/rancher/fleet/pkg/controllers/clusterregistration"
fleetcontrollers "github.com/rancher/fleet/pkg/generated/controllers/fleet.cattle.io/v1alpha1"
"github.com/rancher/fleet/pkg/summary"
gitjob "github.com/rancher/gitjob/pkg/apis/gitjob.cattle.io/v1"
Expand Down Expand Up @@ -101,9 +102,10 @@ func (h *handler) getConfig(repo *fleet.GitRepo) (*corev1.ConfigMap, error) {
return nil, err
}

hash := clusterregistration.KeyHash(string(data))
return &corev1.ConfigMap{
ObjectMeta: metav1.ObjectMeta{
Name: name.SafeConcatName(repo.Name, "config"),
Name: name.SafeConcatName(repo.Name, "config", hash),
Namespace: repo.Namespace,
},
BinaryData: map[string][]byte{
Expand Down

0 comments on commit 66e61a2

Please sign in to comment.