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

Commit

Permalink
fail build on missing application name (#438)
Browse files Browse the repository at this point in the history
* fail build on missing application name

* add application index on missing application error

* update index syntax

Co-authored-by: Tommy Li <[email protected]>

Co-authored-by: Tommy Li <[email protected]>
  • Loading branch information
moficodes and Tomcli authored Nov 13, 2020
1 parent fed86c8 commit 23ae5c1
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 23ae5c1

Please sign in to comment.