Skip to content

Commit

Permalink
Merge pull request #404 from hpidcock/v8-allow-series-k8s-bundle
Browse files Browse the repository at this point in the history
Allow series in kubernetes bundles.
  • Loading branch information
hpidcock authored Sep 8, 2022
2 parents 40dad97 + 9907f70 commit bd9cd46
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
13 changes: 2 additions & 11 deletions bundledata.go
Original file line number Diff line number Diff line change
Expand Up @@ -544,9 +544,6 @@ func (bd *BundleData) verifyBundle(
verifier.addErrorf("bundle has an invalid type %q", bd.Type)
}
if bd.Type == kubernetes {
if bd.Series != "" {
verifier.addErrorf("bundle series not valid for Kubernetes bundles")
}
if len(bd.Machines) > 0 {
verifier.addErrorf("bundle machines not valid for Kubernetes bundles")
}
Expand Down Expand Up @@ -679,14 +676,8 @@ func (verifier *bundleDataVerifier) verifyApplications() {
if curl != nil && curl.Series != "" && app.Series != "" && curl.Series != app.Series {
verifier.addErrorf("the charm URL for application %q has a series which does not match, please remove the series from the URL", name)
}
if verifier.bd.Type == kubernetes {
if app.Series != "" && app.Series != kubernetes {
verifier.addErrorf("series for application %q not valid for Kubernetes bundles", name)
}
} else {
if app.Series != "" && !IsValidSeries(app.Series) {
verifier.addErrorf("application %q declares an invalid series %q", name, app.Series)
}
if app.Series != "" && !IsValidSeries(app.Series) {
verifier.addErrorf("application %q declares an invalid series %q", name, app.Series)
}
// Check the Constraints.
if err := verifier.verifyConstraints(app.Constraints); err != nil {
Expand Down
2 changes: 0 additions & 2 deletions bundledata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -920,10 +920,8 @@ applications:
to: ["foo"]
`
errors := []string{
"bundle series not valid for Kubernetes bundles",
`expected "key=value", got "foo" for application "hadoop"`,
`bundle machines not valid for Kubernetes bundles`,
`series for application "mariadb" not valid for Kubernetes bundles`,
`too many placement directives for application "casandra"`,
}

Expand Down

0 comments on commit bd9cd46

Please sign in to comment.