Skip to content

Commit

Permalink
Merge pull request #9759 from johngmyers/remove-tags
Browse files Browse the repository at this point in the history
Remove unused tags functionality
  • Loading branch information
k8s-ci-robot authored Aug 15, 2020
2 parents a243cc1 + 2472e75 commit afd3857
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 267 deletions.
2 changes: 0 additions & 2 deletions upup/pkg/fi/cloudup/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ go_library(
"populate_instancegroup_spec.go",
"spec_builder.go",
"subnets.go",
"tagbuilder.go",
"target.go",
"template_functions.go",
"urls.go",
Expand Down Expand Up @@ -103,7 +102,6 @@ go_test(
"populatecluster_test.go",
"populateinstancegroup_test.go",
"subnets_test.go",
"tagbuilder_test.go",
"template_functions_test.go",
"validation_test.go",
],
Expand Down
6 changes: 0 additions & 6 deletions upup/pkg/fi/cloudup/apply_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,14 +456,8 @@ func (c *ApplyClusterCmd) Run(ctx context.Context) error {
}
}

clusterTags, err := buildCloudupTags(cluster)
if err != nil {
return err
}

tf := &TemplateFunctions{
KopsModelContext: *modelContext,
tags: clusterTags,
}

{
Expand Down
67 changes: 0 additions & 67 deletions upup/pkg/fi/cloudup/tagbuilder.go

This file was deleted.

183 changes: 0 additions & 183 deletions upup/pkg/fi/cloudup/tagbuilder_test.go

This file was deleted.

9 changes: 0 additions & 9 deletions upup/pkg/fi/cloudup/template_functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import (

"github.com/Masterminds/sprig"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/klog"
kopscontrollerconfig "k8s.io/kops/cmd/kops-controller/pkg/config"
"k8s.io/kops/pkg/apis/kops"
Expand All @@ -55,7 +54,6 @@ import (
// TemplateFunctions provides a collection of methods used throughout the templates
type TemplateFunctions struct {
model.KopsModelContext
tags sets.String
}

// AddTo defines the available functions we can use in our YAML models.
Expand All @@ -82,7 +80,6 @@ func (tf *TemplateFunctions) AddTo(dest template.FuncMap, secretStore fi.SecretS
dest["contains"] = sprigTxtFuncMap["contains"]

dest["ClusterName"] = tf.ClusterName
dest["HasTag"] = tf.HasTag
dest["WithDefaultBool"] = func(v *bool, defaultValue bool) bool {
if v != nil {
return *v
Expand Down Expand Up @@ -204,12 +201,6 @@ func (tf *TemplateFunctions) SharedVPC() bool {
return tf.Cluster.SharedVPC()
}

// HasTag returns true if the specified tag is set
func (tf *TemplateFunctions) HasTag(tag string) bool {
_, found := tf.tags[tag]
return found
}

// GetInstanceGroup returns the instance group with the specified name
func (tf *TemplateFunctions) GetInstanceGroup(name string) (*kops.InstanceGroup, error) {
ig := tf.KopsModelContext.FindInstanceGroup(name)
Expand Down

0 comments on commit afd3857

Please sign in to comment.