Skip to content

Commit

Permalink
removed the unwanted rollbacks
Browse files Browse the repository at this point in the history
Signed-off-by: Shriram Sharma <shriram_sharma@intuit.com>
  • Loading branch information
shriramsharma committed Jun 16, 2022
1 parent ae768d3 commit f246285
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 17 deletions.
2 changes: 1 addition & 1 deletion admiral/pkg/controller/admiral/configmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func init() {

p.LabelSet.WorkloadIdentityKey = "identity"
p.LabelSet.GlobalTrafficDeploymentLabel = "identity"
//p.LabelSet.EnvKey = "admiral.io/env"
p.LabelSet.EnvKey = "admiral.io/env"
common.InitializeConfig(p)
}

Expand Down
8 changes: 4 additions & 4 deletions admiral/pkg/controller/admiral/globaltraffic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,28 +207,28 @@ func TestGlobalTrafficController_Added(t *testing.T) {
}{
{
name: "Gtp should be added to the cache",
gtpKey: "default.id",
gtpKey: "stage.id",
namespace: "namespace1",
gtp: []*v1.GlobalTrafficPolicy{&gtp},
expectedGtps: []*v1.GlobalTrafficPolicy{&gtp},
},
{
name: "Gtp with ignore annotation should not be added to the cache",
gtpKey: "default.id2",
gtpKey: "stage.id2",
namespace: "namespace2",
gtp: []*v1.GlobalTrafficPolicy{&gtpWithIgnoreLabels},
expectedGtps: []*v1.GlobalTrafficPolicy{},
},
{
name: "Should cache multiple gtps in a namespace",
gtpKey: "default.id",
gtpKey: "stage.id",
namespace: "namespace1",
gtp: []*v1.GlobalTrafficPolicy{&gtp, &gtp2},
expectedGtps: []*v1.GlobalTrafficPolicy{&gtp, &gtp2},
},
{
name: "Should cache gtps in from multiple namespaces",
gtpKey: "default.id",
gtpKey: "stage.id",
namespace: "namespace3",
gtp: []*v1.GlobalTrafficPolicy{&gtp, &gtp3},
expectedGtps: []*v1.GlobalTrafficPolicy{&gtp3},
Expand Down
12 changes: 0 additions & 12 deletions admiral/pkg/controller/admiral/rollouts.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,6 @@ func (p *rolloutCache) DeleteFromRolloutToClusterCache(key string, rollout *argo
}

func (d *RolloutController) shouldIgnoreBasedOnLabelsForRollout(rollout *argo.Rollout) bool {
if rollout == nil {
log.Warn("rollout is nil")
return true
}
if rollout.Spec.Template.Labels == nil {
log.Warnf("rollout labels is nil %s", rollout.Namespace)
return true
}
if d.labelSet == nil {
log.Warn("labelset is nil")
return true
}
if rollout.Spec.Template.Labels[d.labelSet.AdmiralIgnoreLabel] == "true" { //if we should ignore, do that and who cares what else is there
return true
}
Expand Down

0 comments on commit f246285

Please sign in to comment.