Skip to content
This repository has been archived by the owner on Aug 17, 2023. It is now read-only.

Commit

Permalink
Automated cherry pick of #438: fail build on missing application name (
Browse files Browse the repository at this point in the history
…#446)

* fail build on missing application name

* add application index on missing application error

* update index syntax
  • Loading branch information
Jeffwan authored Nov 15, 2020
1 parent 22cef22 commit cc8fea5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion pkg/kfconfig/loaders/v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ func (v V1) LoadKfConfig(def interface{}) (*kfconfig.KfConfig, error) {
config.Annotations = kfdef.Annotations
config.ClusterName = kfdef.ClusterName
config.Spec.Version = kfdef.Spec.Version
for _, app := range kfdef.Spec.Applications {
for i, app := range kfdef.Spec.Applications {
if app.Name == "" {
return nil, &kfapis.KfError{
Code: int(kfapis.INVALID_ARGUMENT),
Message: fmt.Sprintf("must have name for application. missing application name on application[%d] in kfdef", i),
}
}
application := kfconfig.Application{
Name: app.Name,
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/kfconfig/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ func (c *KfConfig) SetApplicationParameter(appName string, paramName string, val
"profiles": KfAppsStackName,
"dex": "dex",
// Spartakus is its own application because we want kfctl to be able to remove it.
"spartakus": "spartakus",
"spartakus": "spartakus",
// AWS Specific
"aws-alb-ingress-controller": KfAppsStackName,
"istio-ingress": "istio-ingress",
Expand Down

0 comments on commit cc8fea5

Please sign in to comment.