Skip to content

Commit

Permalink
Merge pull request #1678 from rancher/remove-agent-generation-env-var
Browse files Browse the repository at this point in the history
Do not restart agents when adopting them with a bundle
  • Loading branch information
Mario Manno committed Aug 10, 2023
2 parents 8e3674c + 62c5f1c commit 9d0ee7f
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 6 deletions.
2 changes: 0 additions & 2 deletions internal/cmd/controller/agent/manifest.go
Expand Up @@ -33,7 +33,6 @@ type ManifestOptions struct {
AgentImagePullPolicy string
AgentTolerations []corev1.Toleration
CheckinInterval string
Generation string
PrivateRepoURL string // PrivateRepoURL = registry.yourdomain.com:5000
SystemDefaultRegistry string
AgentAffinity *corev1.Affinity
Expand Down Expand Up @@ -173,7 +172,6 @@ func agentDeployment(namespace string, agentScope string, opts ManifestOptions,
},
{Name: "AGENT_SCOPE", Value: agentScope},
{Name: "CHECKIN_INTERVAL", Value: opts.CheckinInterval},
{Name: "GENERATION", Value: opts.Generation},
},
},
},
Expand Down
1 change: 0 additions & 1 deletion internal/cmd/controller/agent/manifest_test.go
Expand Up @@ -52,7 +52,6 @@ func TestManifestAgentTolerations(t *testing.T) {
AgentImagePullPolicy: "Always",
AgentTolerations: []corev1.Toleration{},
CheckinInterval: "1s",
Generation: "100",
PrivateRepoURL: "private.rancher.com:5000",
SystemDefaultRegistry: "default.rancher.com",
}
Expand Down
2 changes: 0 additions & 2 deletions internal/cmd/controller/controllers/cluster/import.go
Expand Up @@ -7,7 +7,6 @@ import (
"fmt"
"net/http"
"os"
"strconv"

"github.com/sirupsen/logrus"

Expand Down Expand Up @@ -328,7 +327,6 @@ func (i *importHandler) importCluster(cluster *fleet.Cluster, status fleet.Clust
AgentEnvVars: cluster.Spec.AgentEnvVars,
AgentTolerations: cluster.Spec.AgentTolerations,
CheckinInterval: cfg.AgentCheckinInterval.Duration.String(),
Generation: string(cluster.UID) + "-" + strconv.FormatInt(cluster.Generation, 10), // initial value for the agent deployment
PrivateRepoURL: cluster.Spec.PrivateRepoURL,
AgentAffinity: cluster.Spec.AgentAffinity,
AgentResources: cluster.Spec.AgentResources,
Expand Down
Expand Up @@ -258,7 +258,6 @@ func (h *handler) newAgentBundle(ns string, cluster *fleet.Cluster) (runtime.Obj
AgentImagePullPolicy: cfg.AgentImagePullPolicy,
AgentTolerations: cluster.Spec.AgentTolerations,
CheckinInterval: cfg.AgentCheckinInterval.Duration.String(),
Generation: "bundle", // adopted by bundle
PrivateRepoURL: cluster.Spec.PrivateRepoURL,
SystemDefaultRegistry: cfg.SystemDefaultRegistry,
AgentAffinity: cluster.Spec.AgentAffinity,
Expand Down

0 comments on commit 9d0ee7f

Please sign in to comment.