Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove version from addons #11867

Merged
merged 2 commits into from
Jun 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions channels/pkg/api/BUILD.bazel

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 0 additions & 15 deletions channels/pkg/api/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package api
import (
"fmt"

"github.com/blang/semver/v4"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kops/pkg/values"
)
Expand All @@ -44,9 +43,6 @@ type AddonSpec struct {
// Selector is a label query over pods that should match the Replicas count.
Selector map[string]string `json:"selector"`

// Version is a semver version
Version *string `json:"version,omitempty"`

// Manifest is the URL to the manifest that should be applied
Manifest *string `json:"manifest,omitempty"`

Expand Down Expand Up @@ -78,17 +74,6 @@ func (a *Addons) Verify() error {
if addon == nil {
continue
}
if addon.Version != nil && *addon.Version != "" {
name := a.ObjectMeta.Name
if addon.Name != nil {
name = *addon.Name
}

_, err := semver.ParseTolerant(*addon.Version)
if err != nil {
return fmt.Errorf("addon %q has unparseable version %q: %v", name, *addon.Version, err)
}
}
if addon.KubernetesVersion != "" {
hakman marked this conversation as resolved.
Show resolved Hide resolved
return fmt.Errorf("bootstrap addon %q has a KubernetesVersion", values.StringValue(addon.Name))
}
Expand Down
50 changes: 0 additions & 50 deletions channels/pkg/api/channel_test.go

This file was deleted.

3 changes: 0 additions & 3 deletions channels/pkg/channels/BUILD.bazel

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion channels/pkg/channels/addon.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ func (m *AddonMenu) MergeAddons(o *AddonMenu) {
func (a *Addon) ChannelVersion() *ChannelVersion {
return &ChannelVersion{
Channel: &a.ChannelName,
Version: a.Spec.Version,
Id: a.Spec.Id,
ManifestHash: a.Spec.ManifestHash,
}
Expand Down
14 changes: 0 additions & 14 deletions channels/pkg/channels/addons.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,6 @@ func ParseAddons(name string, location *url.URL, data []byte) (*Addons, error) {
}
}

for _, addon := range apiObject.Spec.Addons {
if addon != nil && addon.Version != nil && *addon.Version != "" {
name := apiObject.ObjectMeta.Name
if addon.Name != nil {
name = *addon.Name
}

_, err := semver.ParseTolerant(*addon.Version)
if err != nil {
return nil, fmt.Errorf("addon %q has unparseable version %q: %v", name, *addon.Version, err)
}
}
}

return &Addons{ChannelName: name, ChannelLocation: *location, APIObject: apiObject}, nil
}

Expand Down
Loading