Skip to content

Commit

Permalink
Make use of rev label in some files (#41485)
Browse files Browse the repository at this point in the history
* refactor rev const to rev label

* lint
  • Loading branch information
hanxiaop authored Oct 18, 2022
1 parent 07447f6 commit 836483a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/integration/helm/upgrade/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"istio.io/api/label"
"istio.io/istio/pkg/test/framework"
"istio.io/istio/pkg/test/framework/components/cluster"
kubecluster "istio.io/istio/pkg/test/framework/components/cluster/kube"
Expand All @@ -50,7 +51,6 @@ revision: "%s"
`
tarGzSuffix = ".tar.gz"

istioRevLabel = "istio.io/rev"
prodTag = "prod"
canaryTag = "canary"
latestRevisionTag = "latest"
Expand Down Expand Up @@ -354,7 +354,7 @@ func performRevisionTagsUpgradeFunc(previousVersion, previousValidatingWebhookNa

// change the old namespace that was pointing to the old prod (1-10-0) to point to the
// 'latest' revision by setting the `istio.io/rev=prod` label on the namespace
err := oldNs.SetLabel(istioRevLabel, prodTag)
err := oldNs.SetLabel(label.IoIstioRev.Name, prodTag)
if err != nil {
t.Fatal("could not remove istio.io/rev from old namespace")
}
Expand Down
4 changes: 2 additions & 2 deletions tools/bug-report/pkg/bugreport/bugreport.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/kr/pretty"
"github.com/spf13/cobra"

label2 "istio.io/api/label"
"istio.io/istio/operator/pkg/util"
"istio.io/istio/pkg/kube"
"istio.io/istio/pkg/kube/inject"
Expand All @@ -49,7 +50,6 @@ import (

const (
bugReportDefaultTimeout = 30 * time.Minute
istioRevisionLabel = "istio.io/rev"
)

var (
Expand Down Expand Up @@ -215,7 +215,7 @@ func getIstioRevisions(resources *cluster2.Resources) []string {
revMap := sets.New[string]()
for _, podLabels := range resources.Labels {
for label, value := range podLabels {
if label == istioRevisionLabel {
if label == label2.IoIstioRev.Name {
revMap.Insert(value)
}
}
Expand Down

0 comments on commit 836483a

Please sign in to comment.