Skip to content

Commit

Permalink
Deprecate release tag in manifests
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoriano committed Jan 14, 2022
1 parent 68ee453 commit bc49663
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 26 deletions.
11 changes: 0 additions & 11 deletions cmd/create_package.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ type newPackageAnswers struct {
Title string
Description string
Categories []string
Release string
KibanaVersion string `survey:"kibana_version"`
GithubOwner string `survey:"github_owner"`
}
Expand Down Expand Up @@ -78,15 +77,6 @@ func createPackageCommandAction(cmd *cobra.Command, args []string) error {
},
Validate: survey.Required,
},
{
Name: "release",
Prompt: &survey.Select{
Message: "Release:",
Options: []string{"experimental", "beta", "ga"},
Default: "experimental",
},
Validate: survey.Required,
},
{
Name: "kibana_version",
Prompt: &survey.Input{
Expand Down Expand Up @@ -136,7 +126,6 @@ func createPackageDescriptorFromAnswers(answers newPackageAnswers) archetype.Pac
Owner: packages.Owner{
Github: answers.GithubOwner,
},
Release: answers.Release,
Description: answers.Description,
License: "basic",
Categories: answers.Categories,
Expand Down
4 changes: 2 additions & 2 deletions cmd/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func print(p *status.PackageStatus, w io.Writer) error {

bold.Fprintln(w, "Package Versions:")
table := tablewriter.NewWriter(os.Stdout)
table.SetHeader([]string{"Environment", "Version", "Release", "Title", "Description"})
table.SetHeader([]string{"Environment", "Version", "Title", "Description"})
table.SetHeaderColor(
twColor(tablewriter.Colors{tablewriter.Bold}),
twColor(tablewriter.Colors{tablewriter.Bold}),
Expand Down Expand Up @@ -182,7 +182,7 @@ func formatManifest(environment string, manifest packages.PackageManifest, extra
if len(extraVersions) > 0 {
version = fmt.Sprintf("%s (%s)", version, strings.Join(extraVersions, ", "))
}
return []string{environment, version, manifest.Release, manifest.Title, manifest.Description}
return []string{environment, version, manifest.Title, manifest.Description}
}

// twColor no-ops the color setting if we don't want to colorize the output
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,5 @@ require (
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
)

replace github.com/elastic/package-spec v1.3.0 => github.com/jsoriano/package-spec v0.0.0-20220112095620-98e0d531845d
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,6 @@ github.com/elastic/go-licenser v0.4.0 h1:jLq6A5SilDS/Iz1ABRkO6BHy91B9jBora8FwGRs
github.com/elastic/go-licenser v0.4.0/go.mod h1:V56wHMpmdURfibNBggaSBfqgPxyT1Tldns1i87iTEvU=
github.com/elastic/go-ucfg v0.8.4 h1:OAHTnubzXKsYYYWVzl8psLcS5mCbNKjXxtMY41itthk=
github.com/elastic/go-ucfg v0.8.4/go.mod h1:4E8mPOLSUV9hQ7sgLEJ4bvt0KhMuDJa8joDT2QGAEKA=
github.com/elastic/package-spec v1.3.0 h1:ntd8EfZ0heZqaZdZpyHJPBFUml9LMlSSZTp04dLZyAg=
github.com/elastic/package-spec v1.3.0/go.mod h1:KzGTSDqCkdhmL1IFpOH2ZQNSSE9JEhNtndxU3ZrQilA=
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153 h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc=
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
Expand Down Expand Up @@ -701,6 +699,8 @@ github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/jsoriano/package-spec v0.0.0-20220112095620-98e0d531845d h1:9ff/wZIp2jRzwVjCDWtIxOpFaG5A4GD11A6AQCDr8LU=
github.com/jsoriano/package-spec v0.0.0-20220112095620-98e0d531845d/go.mod h1:KzGTSDqCkdhmL1IFpOH2ZQNSSE9JEhNtndxU3ZrQilA=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
Expand Down
1 change: 0 additions & 1 deletion internal/packages/archetype/package_manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ type: {{.Manifest.Type}}
categories:{{range $category := .Manifest.Categories}}
- {{$category}}
{{- end}}
release: {{.Manifest.Release}}
conditions:
kibana.version: "{{.Manifest.Conditions.Kibana.Version}}"
screenshots:
Expand Down
8 changes: 0 additions & 8 deletions internal/packages/archetype/package_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ func TestPackage(t *testing.T) {
pd := createPackageDescriptorForTest()
pd.Manifest.Version = ""

err := createAndCheckPackage(t, pd)
require.Error(t, err)
})
t.Run("missing-release", func(t *testing.T) {
pd := createPackageDescriptorForTest()
pd.Manifest.Release = ""

err := createAndCheckPackage(t, pd)
require.Error(t, err)
})
Expand Down Expand Up @@ -74,7 +67,6 @@ func createPackageDescriptorForTest() PackageDescriptor {
Owner: packages.Owner{
Github: "mtojek",
},
Release: "experimental",
Description: "This package has been generated by a Go unit test.",
License: "basic",
Categories: []string{"aws", "custom"},
Expand Down
2 changes: 0 additions & 2 deletions internal/packages/packages.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ type PackageManifest struct {
PolicyTemplates []PolicyTemplate `config:"policy_templates" json:"policy_templates" yaml:"policy_templates"`
Vars []Variable `config:"vars" json:"vars" yaml:"vars"`
Owner Owner `config:"owner" json:"owner" yaml:"owner"`
Release string `config:"release" json:"release" yaml:"release"`
Description string `config:"description" json:"description" yaml:"description"`
License string `config:"license" json:"license" yaml:"license"`
Categories []string `config:"categories" json:"categories" yaml:"categories"`
Expand All @@ -115,7 +114,6 @@ type DataStreamManifest struct {
Title string `config:"title" json:"title" yaml:"title"`
Type string `config:"type" json:"type" yaml:"type"`
Dataset string `config:"dataset" json:"dataset" yaml:"dataset"`
Release string `config:"release" json:"release" yaml:"release"`
Elasticsearch *struct {
IngestPipeline *struct {
Name string `config:"name" json:"name" yaml:"name"`
Expand Down

0 comments on commit bc49663

Please sign in to comment.