Skip to content

Commit

Permalink
fix issue #66 (#67)
Browse files Browse the repository at this point in the history
replace "extensions/v1beta1" with "apps/v1" for Deployment and ReplicaSet
  • Loading branch information
hlihhovac authored Feb 24, 2020
1 parent c3e7c13 commit 438edbf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions cmd/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const (
v1Service = "v1/Service"
v1Pod = "v1/Pod"
deployment = "Deployment"
extensionsV1Beta1ReplicaSet = "extensions/v1beta1/ReplicaSet"
v1ReplicaSet = "v1/ReplicaSet"
)

func init() {
Expand Down Expand Up @@ -103,13 +103,13 @@ func traceService(namespace, name string) {

func traceDeployment(namespace, name string) {
// API server should rewrite this to apps/v1beta2, apps/v1beta2, or apps/v1 as appropriate.
deploymentEvents, err := watch.Forever("extensions/v1beta1", "Deployment",
deploymentEvents, err := watch.Forever("apps/v1", "Deployment",
watch.ThisObject(namespace, name))
if err != nil {
log.Fatal(err)
}

replicaSetEvents, err := watch.Forever("extensions/v1beta1", "ReplicaSet",
replicaSetEvents, err := watch.Forever("apps/v1", "ReplicaSet",
watch.ObjectsOwnedBy(namespace, name))
if err != nil {
log.Fatal(err)
Expand Down Expand Up @@ -150,9 +150,9 @@ func traceDeployment(namespace, name string) {
} else {
repSets[o.GetName()] = e
}
table[extensionsV1Beta1ReplicaSet] = []k8sWatch.Event{}
table[v1ReplicaSet] = []k8sWatch.Event{}
for _, rsEvent := range repSets {
table[extensionsV1Beta1ReplicaSet] = append(table[extensionsV1Beta1ReplicaSet], rsEvent)
table[v1ReplicaSet] = append(table[v1ReplicaSet], rsEvent)
}
case e := <-podEvents:
o := e.Object.(*unstructured.Unstructured)
Expand Down
12 changes: 6 additions & 6 deletions print/print.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import (
)

const (
v1Endpoints = "v1/Endpoints"
v1Service = "v1/Service"
v1Pod = "v1/Pod"
deployment = "Deployment"
extensionsV1Beta1ReplicaSet = "extensions/v1beta1/ReplicaSet"
v1Endpoints = "v1/Endpoints"
v1Service = "v1/Service"
v1Pod = "v1/Pod"
deployment = "Deployment"
v1ReplicaSet = "v1/ReplicaSet"

prefix = "\n - "

Expand Down Expand Up @@ -196,7 +196,7 @@ func DeploymentWatchTable(w *uilive.Writer, table map[string][]k8sWatch.Event) {
}
var prevRepSet *unstructured.Unstructured
var prevRepSetSpec *repSet
if events, hasRs := table[extensionsV1Beta1ReplicaSet]; hasRs {
if events, hasRs := table[v1ReplicaSet]; hasRs {
for _, e := range events {
rs := e.Object.(*unstructured.Unstructured)
repSetRevision, err := parseRevision(rs)
Expand Down

0 comments on commit 438edbf

Please sign in to comment.