Skip to content

Commit

Permalink
add lint warning for cf stack cflinuxfs3
Browse files Browse the repository at this point in the history
  • Loading branch information
robwhitby committed Feb 6, 2025
1 parent d813f10 commit 75ba7e2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions linters/cf_manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ func LintCfManifest(task manifest.DeployCF, readCfManifest cf.ManifestReader) (e
errs = append(errs, ErrCFMissingName.WithFile(task.Manifest))
}

if app.Stack == "cflinuxfs3" {
errs = append(errs, ErrCFStack.WithFile(task.Manifest))
}

errs = append(errs, lintRoutes(task, app)...)
errs = append(errs, lintCandidateAppRoute(task, cfManifest)...)
errs = append(errs, lintDockerPush(task, app)...)
Expand Down
9 changes: 9 additions & 0 deletions linters/cf_manifest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,4 +312,13 @@ applications:
assertNotContainsError(t, errs, ErrCFLabelProductIsMissing)
assertNotContainsError(t, errs, ErrCFLabelEnvironmentIsMissing)
})

t.Run("Warning for stack cflinuxfs3", func(t *testing.T) {
cfManifest := `
applications:
- stack: cflinuxfs3
`
errs := LintCfManifest(manifest.DeployCF{Space: "Yo"}, cfManifestReader(cfManifest, nil))
assertContainsError(t, errs, ErrCFStack)
})
}
1 change: 1 addition & 0 deletions linters/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ var (

ErrCFLabelTeamWillBeOverwritten = newError("deployment will overwrite metadata.labels.team that was set in the CF manifest").AsWarning()
ErrCFLabelProductIsMissing = newError("CF manifest is missing 'product' label. If 'product' is set on the CF space you can safely ignore this warning.").AsWarning()
ErrCFStack = newError("CF stack 'cflinuxfs3' is deprecated. Please upgrade to 'cflinuxfs4'.").AsWarning()
ErrCFLabelEnvironmentIsMissing = newError("CF manifest is missing 'environment' label. If 'environment' is set on the CF space you can safely ignore this warning.").AsWarning()

ErrUnsupportedRegistry = newError("image must be from halfpipe registry. Please see <https://ee.public.springernature.app/rel-eng/docker-registry/>")
Expand Down

0 comments on commit 75ba7e2

Please sign in to comment.