Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisDenuto committed Jul 26, 2022
1 parent 274bcbb commit cb85b43
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion pkg/app/app_reconcile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ func Test_NoInspectReconcile_IfNoDeployAttempted(t *testing.T) {
}

func Test_NoInspectReconcile_IfInspectNotEnabled(t *testing.T) {
t.Skipf("")
log := logf.Log.WithName("kc")
var appMetrics = metrics.NewAppMetrics()

Expand Down
2 changes: 1 addition & 1 deletion pkg/deploy/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (f Factory) NewKapp(opts v1alpha1.AppDeployKapp, saName string,
}

return NewKapp(suffix, opts, processedGenericOpts,
f.globalKappDeployRawOpts(), cancelCh, f.cmdRunner, f.coreClient.CoreV1().ConfigMaps("kappctrl-test")), nil
f.globalKappDeployRawOpts(), cancelCh, f.cmdRunner, f.coreClient.CoreV1().ConfigMaps(genericOpts.Namespace)), nil
}

// NewKappPrivileged is used for package repositories where users aren't required to provide
Expand Down
7 changes: 5 additions & 2 deletions pkg/deploy/kapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,19 @@ func (a *Kapp) InternalAppConfigMap() (*corev1.ConfigMap, error) {
var configMap *corev1.ConfigMap

metadataFile, err := ioutil.ReadFile(fmt.Sprintf("/etc/kappctrl-mem-tmp/metadata-%s", a.genericOpts.Name))
if os.IsNotExist(err) {
switch {
case os.IsNotExist(err) && a.maps != nil:
configMap, err = a.maps.Get(context.TODO(), a.genericOpts.Name+a.appSuffix, metav1.GetOptions{})
if err != nil {
return nil, err
}
} else {
case err == nil:
configMap = &corev1.ConfigMap{Data: map[string]string{"spec": string(metadataFile)}}
if err != nil {
return nil, err
}
default:
return nil, err
}

return configMap, nil
Expand Down

0 comments on commit cb85b43

Please sign in to comment.