Skip to content

Commit 30df23b

Browse files
committed
Rebase required changes
Signed-off-by: Brett Tofel <[email protected]>
1 parent 06d2675 commit 30df23b

File tree

5 files changed

+30
-17
lines changed

5 files changed

+30
-17
lines changed

config/rbac/role.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ rules:
4040
- delete
4141
- list
4242
- watch
43+
- apiGroups:
44+
- ""
45+
resources:
46+
- pods/log
47+
verbs:
48+
- get
4349
- apiGroups:
4450
- olm.operatorframework.io
4551
resources:

go.mod

+13
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@ require (
3131
)
3232

3333
require (
34+
dario.cat/mergo v1.0.0 // indirect
35+
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
36+
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
37+
github.com/BurntSushi/toml v1.3.2 // indirect
38+
github.com/MakeNowJust/heredoc v1.0.0 // indirect
39+
github.com/Masterminds/goutils v1.1.1 // indirect
40+
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
41+
github.com/Masterminds/squirrel v1.5.4 // indirect
42+
github.com/Microsoft/go-winio v0.6.1 // indirect
43+
github.com/Microsoft/hcsshim v0.12.0-rc.3 // indirect
44+
github.com/ProtonMail/go-crypto v1.0.0 // indirect
45+
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect
46+
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
3447
github.com/beorn7/perks v1.0.1 // indirect
3548
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
3649
github.com/cespare/xxhash/v2 v2.2.0 // indirect

go.sum

-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
carvel.dev/vendir v0.40.0 h1:JdhCp/EjAPGI8F5zoAVYwZHf1sPEFee19RpgGb3ciT8=
2-
carvel.dev/vendir v0.40.0/go.mod h1:XPdluJu7322RZNx05AA4gYnV52aKywBdh7Ma12GuM2Q=
31
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
42
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
53
dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
@@ -383,7 +381,6 @@ github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J
383381
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
384382
github.com/nlepage/go-tarfs v1.2.1 h1:o37+JPA+ajllGKSPfy5+YpsNHDjZnAoyfvf5GsUa+Ks=
385383
github.com/nlepage/go-tarfs v1.2.1/go.mod h1:rno18mpMy9aEH1IiJVftFsqPyIpwqSUiAOpJYjlV2NA=
386-
github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc=
387384
github.com/onsi/ginkgo/v2 v2.17.2 h1:7eMhcy3GimbsA3hEnVKdw/PQM9XN9krpKVXsZdph0/g=
388385
github.com/onsi/ginkgo/v2 v2.17.2/go.mod h1:nP2DPOQoNsQmsVyv5rDA8JkXQoCs6goXIvr/PRJ1eCc=
389386
github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk=
@@ -500,8 +497,6 @@ github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8=
500497
github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
501498
github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts=
502499
github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk=
503-
github.com/vmware-tanzu/carvel-kapp-controller v0.51.0 h1:lCCHy9n/AzWPtq5gqbINJHgmF32RCUkh9DbVQgx6HAs=
504-
github.com/vmware-tanzu/carvel-kapp-controller v0.51.0/go.mod h1:go1MQz1D2kVgjaE2ZHtuHGECFk8EDLeXMpjmDNDzuJM=
505500
github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM=
506501
github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw=
507502
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=

internal/controllers/clusterextension_controller.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,9 @@ func (r *ClusterExtensionReconciler) reconcile(ctx context.Context, ext *ocv1alp
276276
chrt, values, err := r.Handler.Handle(ctx, bundleFS, ext)
277277
if err != nil {
278278
apimeta.SetStatusCondition(&ext.Status.Conditions, metav1.Condition{
279-
Type: rukpakv1alpha2.TypeInstalled,
279+
Type: ocv1alpha1.TypeInstalled,
280280
Status: metav1.ConditionFalse,
281-
Reason: rukpakv1alpha2.ReasonInstallFailed,
281+
Reason: ocv1alpha1.ReasonInstallationFailed,
282282
Message: err.Error(),
283283
})
284284
return ctrl.Result{}, err
@@ -303,7 +303,7 @@ func (r *ClusterExtensionReconciler) reconcile(ctx context.Context, ext *ocv1alp
303303

304304
rel, state, err := r.getReleaseState(ac, ext, chrt, values, post)
305305
if err != nil {
306-
setInstalledAndHealthyFalse(&ext.Status.Conditions, fmt.Sprintf("%s:%v", ocv1alpha1.ReasonErrorGettingReleaseState, err), ext.Generation)
306+
setInstalledStatusConditionFailed(&ext.Status.Conditions, fmt.Sprintf("%s:%v", ocv1alpha1.ReasonErrorGettingReleaseState, err), ext.Generation)
307307
return ctrl.Result{}, err
308308
}
309309

@@ -318,7 +318,7 @@ func (r *ClusterExtensionReconciler) reconcile(ctx context.Context, ext *ocv1alp
318318
if isResourceNotFoundErr(err) {
319319
err = errRequiredResourceNotFound{err}
320320
}
321-
setInstalledAndHealthyFalse(&ext.Status.Conditions, fmt.Sprintf("%s:%v", ocv1alpha1.ReasonInstallationFailed, err), ext.Generation)
321+
setInstalledStatusConditionFailed(&ext.Status.Conditions, fmt.Sprintf("%s:%v", ocv1alpha1.ReasonInstallationFailed, err), ext.Generation)
322322
return ctrl.Result{}, err
323323
}
324324
case stateNeedsUpgrade:
@@ -327,15 +327,15 @@ func (r *ClusterExtensionReconciler) reconcile(ctx context.Context, ext *ocv1alp
327327
if isResourceNotFoundErr(err) {
328328
err = errRequiredResourceNotFound{err}
329329
}
330-
setInstalledAndHealthyFalse(&ext.Status.Conditions, fmt.Sprintf("%s:%v", ocv1alpha1.ReasonUpgradeFailed, err), ext.Generation)
330+
setInstalledStatusConditionFailed(&ext.Status.Conditions, fmt.Sprintf("%s:%v", ocv1alpha1.ReasonUpgradeFailed, err), ext.Generation)
331331
return ctrl.Result{}, err
332332
}
333333
case stateUnchanged:
334334
if err := ac.Reconcile(rel); err != nil {
335335
if isResourceNotFoundErr(err) {
336336
err = errRequiredResourceNotFound{err}
337337
}
338-
setInstalledAndHealthyFalse(&ext.Status.Conditions, fmt.Sprintf("%s:%v", ocv1alpha1.ReasonResolutionFailed, err), ext.Generation)
338+
setInstalledStatusConditionFailed(&ext.Status.Conditions, fmt.Sprintf("%s:%v", ocv1alpha1.ReasonResolutionFailed, err), ext.Generation)
339339
return ctrl.Result{}, err
340340
}
341341
default:
@@ -344,14 +344,14 @@ func (r *ClusterExtensionReconciler) reconcile(ctx context.Context, ext *ocv1alp
344344

345345
relObjects, err := util.ManifestObjects(strings.NewReader(rel.Manifest), fmt.Sprintf("%s-release-manifest", rel.Name))
346346
if err != nil {
347-
setInstalledAndHealthyFalse(&ext.Status.Conditions, fmt.Sprintf("%s:%v", ocv1alpha1.ReasonCreateDynamicWatchFailed, err), ext.Generation)
347+
setInstalledStatusConditionFailed(&ext.Status.Conditions, fmt.Sprintf("%s:%v", ocv1alpha1.ReasonCreateDynamicWatchFailed, err), ext.Generation)
348348
return ctrl.Result{}, err
349349
}
350350

351351
for _, obj := range relObjects {
352352
uMap, err := runtime.DefaultUnstructuredConverter.ToUnstructured(obj)
353353
if err != nil {
354-
setInstalledAndHealthyFalse(&ext.Status.Conditions, fmt.Sprintf("%s:%v", ocv1alpha1.ReasonCreateDynamicWatchFailed, err), ext.Generation)
354+
setInstalledStatusConditionFailed(&ext.Status.Conditions, fmt.Sprintf("%s:%v", ocv1alpha1.ReasonCreateDynamicWatchFailed, err), ext.Generation)
355355
return ctrl.Result{}, err
356356
}
357357

@@ -373,7 +373,7 @@ func (r *ClusterExtensionReconciler) reconcile(ctx context.Context, ext *ocv1alp
373373
return nil
374374
}(); err != nil {
375375
ext.Status.InstalledBundle = nil
376-
setInstalledAndHealthyFalse(&ext.Status.Conditions, fmt.Sprintf("%s:%v", ocv1alpha1.ReasonCreateDynamicWatchFailed, err), ext.Generation)
376+
setInstalledStatusConditionFailed(&ext.Status.Conditions, fmt.Sprintf("%s:%v", ocv1alpha1.ReasonCreateDynamicWatchFailed, err), ext.Generation)
377377
return ctrl.Result{}, err
378378
}
379379
}
@@ -844,4 +844,4 @@ func bundleMetadataFor(bundle *catalogmetadata.Bundle) *ocv1alpha1.BundleMetadat
844844
Name: bundle.Name,
845845
Version: ver.String(),
846846
}
847-
}
847+
}

internal/controllers/suite_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ var (
6969
func TestMain(m *testing.M) {
7070
testEnv := &envtest.Environment{
7171
CRDDirectoryPaths: []string{
72-
filepath.Join("..", "..", "config", "crd", "bases"),
73-
filepath.Join("..", "..", "testdata", "crds")},
72+
filepath.Join("..", "..", "config", "crd", "bases")},
7473
ErrorIfCRDPathMissing: true,
7574
}
7675

0 commit comments

Comments
 (0)