Skip to content

Commit

Permalink
fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisDenuto committed Jul 26, 2022
1 parent cb85b43 commit 1995b8c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 2 additions & 0 deletions pkg/apis/kappctrl/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,13 @@ type AppStatusDeploy struct {
KappDeployStatus KappDeployStatus `json:"kapp,omitempty"`
}

// KappDeployStatus todo
// +protobuf=false
type KappDeployStatus struct {
AssociatedResources AssociatedResources `json:"associatedResources,omitempty"`
}

// AssociatedResources todo
// +protobuf=false
type AssociatedResources struct {
Label string `json:"label,omitempty"`
Expand Down
18 changes: 10 additions & 8 deletions pkg/app/app_deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ func (a *App) inspect() exec.CmdRunResult {
return result
}

type AppMeta struct {
// Meta todo
type Meta struct {
LabelKey string `yaml:"labelKey"`
LabelValue string `yaml:"labelValue"`
LastChange struct {
Expand All @@ -135,7 +136,8 @@ type AppMeta struct {
} `yaml:"usedGKs"`
}

func (a *App) GetMetadata() (AppMeta, error) {
// GetMetadata todo
func (a *App) GetMetadata() (Meta, error) {

for _, dep := range a.app.Spec.Deploy {
switch {
Expand All @@ -145,28 +147,28 @@ func (a *App) GetMetadata() (AppMeta, error) {

kapp, err := a.newKapp(*dep.Kapp, cancelCh)
if err != nil {
return AppMeta{}, err
return Meta{}, err
}

cm, err := kapp.InternalAppConfigMap()
if err != nil {
return AppMeta{}, err
return Meta{}, err
}

var appMetadata AppMeta
var appMetadata Meta
err = yaml.Unmarshal([]byte(cm.Data["spec"]), &appMetadata)
if err != nil {
return AppMeta{}, err
return Meta{}, err
}

return appMetadata, err
default:
return AppMeta{}, fmt.Errorf("Unsupported way to get config map")
return Meta{}, fmt.Errorf("Unsupported way to get config map")
}

}

return AppMeta{}, fmt.Errorf("Unsupported way to get config map")
return Meta{}, fmt.Errorf("Unsupported way to get config map")
}

func (a *App) newKapp(kapp v1alpha1.AppDeployKapp, cancelCh chan struct{}) (*ctldep.Kapp, error) {
Expand Down
1 change: 1 addition & 0 deletions pkg/deploy/kapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ func (a *Kapp) Inspect() exec.CmdRunResult {
return result
}

// InternalAppConfigMap todo
func (a *Kapp) InternalAppConfigMap() (*corev1.ConfigMap, error) {
var configMap *corev1.ConfigMap

Expand Down

0 comments on commit 1995b8c

Please sign in to comment.