Skip to content

Commit

Permalink
Merge pull request kubernetes#69118 from seans3/apply-small-fix
Browse files Browse the repository at this point in the history
Replace internal dependency on last-applied-configuration with extern…
  • Loading branch information
k8s-ci-robot authored Sep 27, 2018
2 parents 2588ad5 + 947034e commit 53fe9e2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pkg/kubectl/cmd/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/jonboulle/clockwork"
"github.com/spf13/cobra"

"k8s.io/api/core/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -44,7 +44,6 @@ import (
"k8s.io/cli-runtime/pkg/genericclioptions/resource"
"k8s.io/client-go/dynamic"
oapi "k8s.io/kube-openapi/pkg/util/proto"
api "k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/kubectl"
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
Expand Down Expand Up @@ -399,7 +398,7 @@ func (o *ApplyOptions) Run() error {
}

annotationMap := metadata.GetAnnotations()
if _, ok := annotationMap[api.LastAppliedConfigAnnotation]; !ok {
if _, ok := annotationMap[corev1.LastAppliedConfigAnnotation]; !ok {
fmt.Fprintf(o.ErrOut, warningNoLastAppliedConfigAnnotation, o.cmdBaseName)
}

Expand Down Expand Up @@ -467,7 +466,7 @@ func (o *ApplyOptions) Run() error {

objToPrint := objs[0]
if len(objs) > 1 {
list := &v1.List{
list := &corev1.List{
TypeMeta: metav1.TypeMeta{
Kind: "List",
APIVersion: "v1",
Expand Down Expand Up @@ -619,7 +618,7 @@ func (p *pruner) prune(namespace string, mapping *meta.RESTMapping, includeUnini
return err
}
annots := metadata.GetAnnotations()
if _, ok := annots[api.LastAppliedConfigAnnotation]; !ok {
if _, ok := annots[corev1.LastAppliedConfigAnnotation]; !ok {
// don't prune resources not created with apply
continue
}
Expand Down

0 comments on commit 53fe9e2

Please sign in to comment.