Remove tags from NodeupConfig

This commit is contained in:
John Gardiner Myers 2020-07-29 16:26:55 -07:00
parent 28caf07afa
commit c2cb6646af
5 changed files with 0 additions and 89 deletions

View File

@ -28,8 +28,6 @@ import (
// Config is the configuration for the nodeup binary
type Config struct {
// Tags enable/disable chunks of the model
Tags []string `json:",omitempty"`
// Assets are locations where we can find files to be installed
// TODO: Remove once everything is in containers?
Assets map[architectures.Architecture][]string `json:",omitempty"`

View File

@ -1172,7 +1172,6 @@ type nodeUpConfigBuilder struct {
cluster *kops.Cluster
etcdManifests map[kops.InstanceGroupRole][]string
images map[kops.InstanceGroupRole]map[architectures.Architecture][]*nodeup.Image
nodeUpTags []string
protokubeImage map[kops.InstanceGroupRole]*nodeup.Image
}
@ -1184,12 +1183,6 @@ func (c *ApplyClusterCmd) newNodeUpConfigBuilder(assetBuilder *assets.AssetBuild
return nil, fmt.Errorf("error parsing config base %q: %v", cluster.Spec.ConfigBase, err)
}
// TODO: Remove
clusterTags, err := buildCloudupTags(cluster)
if err != nil {
return nil, err
}
channels := []string{
configBase.Join("addons", "bootstrap-channel.yaml").Path(),
}
@ -1198,11 +1191,6 @@ func (c *ApplyClusterCmd) newNodeUpConfigBuilder(assetBuilder *assets.AssetBuild
channels = append(channels, cluster.Spec.Addons[i].Manifest)
}
nodeUpTags, err := buildNodeupTags(cluster, clusterTags)
if err != nil {
return nil, err
}
useGossip := dns.IsGossipHostname(cluster.Spec.MasterInternalName)
etcdManifests := map[kops.InstanceGroupRole][]string{}
@ -1307,7 +1295,6 @@ func (c *ApplyClusterCmd) newNodeUpConfigBuilder(assetBuilder *assets.AssetBuild
cluster: cluster,
etcdManifests: etcdManifests,
images: images,
nodeUpTags: nodeUpTags.List(),
protokubeImage: protokubeImage,
}
return &configBuilder, nil
@ -1327,8 +1314,6 @@ func (n *nodeUpConfigBuilder) BuildConfig(ig *kops.InstanceGroup, apiserverAddit
}
config := nodeup.NewConfig(cluster, ig)
config.Tags = append(config.Tags, n.nodeUpTags...)
config.Assets = make(map[architectures.Architecture][]string)
for _, arch := range architectures.GetSupported() {
config.Assets[arch] = []string{}

View File

@ -65,19 +65,3 @@ func buildCloudupTags(cluster *api.Cluster) (sets.String, error) {
return tags, nil
}
func buildNodeupTags(cluster *api.Cluster, clusterTags sets.String) (sets.String, error) {
tags := sets.NewString()
if clusterTags.Has("_gce") {
tags.Insert("_gce")
}
if clusterTags.Has("_aws") {
tags.Insert("_aws")
}
if clusterTags.Has("_do") {
tags.Insert("_do")
}
return tags, nil
}

View File

@ -78,15 +78,6 @@ func TestBuildTags_CloudProvider_AWS_Weave(t *testing.T) {
if !tags.Has("_aws") {
t.Fatal("tag _aws not found")
}
nodeUpTags, err := buildNodeupTags(c, tags)
if err != nil {
t.Fatalf("buildNodeupTags error: %v", err)
}
if !nodeUpTags.Has("_aws") {
t.Fatal("nodeUpTag _aws not found")
}
}
func TestBuildTags_CloudProvider_AWS_Flannel(t *testing.T) {
@ -104,15 +95,6 @@ func TestBuildTags_CloudProvider_AWS_Flannel(t *testing.T) {
if !tags.Has("_aws") {
t.Fatal("tag _aws not found")
}
nodeUpTags, err := buildNodeupTags(c, tags)
if err != nil {
t.Fatalf("buildNodeupTags error: %v", err)
}
if !nodeUpTags.Has("_aws") {
t.Fatal("nodeUpTag _aws not found")
}
}
func TestBuildTags_CloudProvider_AWS_Calico(t *testing.T) {
@ -130,15 +112,6 @@ func TestBuildTags_CloudProvider_AWS_Calico(t *testing.T) {
if !tags.Has("_aws") {
t.Fatal("tag _aws not found")
}
nodeUpTags, err := buildNodeupTags(c, tags)
if err != nil {
t.Fatalf("buildNodeupTags error: %v", err)
}
if !nodeUpTags.Has("_aws") {
t.Fatal("nodeUpTag _aws not found")
}
}
func TestBuildTags_CloudProvider_AWS_Canal(t *testing.T) {
@ -156,15 +129,6 @@ func TestBuildTags_CloudProvider_AWS_Canal(t *testing.T) {
if !tags.Has("_aws") {
t.Fatal("tag _aws not found")
}
nodeUpTags, err := buildNodeupTags(c, tags)
if err != nil {
t.Fatalf("buildNodeupTags error: %v", err)
}
if !nodeUpTags.Has("_aws") {
t.Fatal("nodeUpTag _aws not found")
}
}
func TestBuildTags_CloudProvider_AWS(t *testing.T) {
@ -179,15 +143,6 @@ func TestBuildTags_CloudProvider_AWS(t *testing.T) {
if !tags.Has("_aws") {
t.Fatal("tag _aws not found")
}
nodeUpTags, err := buildNodeupTags(c, tags)
if err != nil {
t.Fatalf("buildNodeupTags error: %v", err)
}
if !nodeUpTags.Has("_aws") {
t.Fatal("nodeUpTag _aws not found")
}
}
func TestBuildTags_KubernetesVersions(t *testing.T) {
@ -225,13 +180,4 @@ func TestBuildTags_CloudProvider_AWS_Cilium(t *testing.T) {
if !tags.Has("_aws") {
t.Fatal("tag _aws not found")
}
nodeUpTags, err := buildNodeupTags(c, tags)
if err != nil {
t.Fatalf("buildNodeupTags error: %v", err)
}
if !nodeUpTags.Has("_aws") {
t.Fatal("nodeUpTag _aws not found")
}
}

View File

@ -173,11 +173,9 @@ func (c *NodeUpCommand) Run(out io.Writer) error {
distroTags := distribution.BuildTags()
nodeTags := sets.NewString()
nodeTags.Insert(c.config.Tags...)
nodeTags.Insert(archTags...)
nodeTags.Insert(distroTags...)
klog.Infof("Config tags: %v", c.config.Tags)
klog.Infof("Arch tags: %v", archTags)
klog.Infof("Distro tags: %v", distroTags)