-
Notifications
You must be signed in to change notification settings - Fork 545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(catalog): add catalog status block updates #419
Conversation
syncCatalogSources now updates the status block of synced catalogs to include an up-to-date ConfigMapResource and LastSync field.
@@ -129,6 +129,10 @@ func TestCreateInstallPlanManualApproval(t *testing.T) { | |||
}, | |||
} | |||
|
|||
// Attempt to get the catalog source before creating install plan | |||
_, err = fetchCatalogSource(t, crc, ocsConfigMap, testNamespace, catalogSourceSynced) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after these changes, the test installplan didn't have a source
and sourceNamespace
in the spec anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the source
and sourceNamespace
are not in master either.
} | ||
|
||
// Create a new in-mem registry | ||
src, err := registry.NewInMemoryFromConfigMap(o.OpClient, out.GetNamespace(), out.Spec.ConfigMap) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be nice if we only parsed this into memory when it's changed
return builder.String() | ||
} | ||
|
||
func cleanupOLM(t *testing.T, namespace string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the frustrating thing about using this everywhere is that it clears out the state of the test when you defer
a call to it. it sort of defeats the purpose of keeping the test namespace around when the tests fail (there's nothing to inspect).
can we check for when the test has failed and only clear things out if it's succeeded?
It's probably just
func cleanupOLM(t *testing.T, namespace string) {
if t.Failed {
t.Log("skipping cleanup")
return
}
//...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes total sense.
the default is 2Gi which was causing problems in our tests
a169206
to
c10676d
Compare
- adds deferred cleanup of all OLM resources - adds skip cleanup global field to avoid cleanup when any test fails
} | ||
|
||
// Check for config map changes | ||
if catsrc.Status.ConfigMapResource == nil || catsrc.Status.ConfigMapResource.Name != configMap.GetName() || catsrc.Status.ConfigMapResource.ResourceVersion != configMap.GetResourceVersion() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check the opposite condition here and return early?
@@ -4,12 +4,25 @@ import ( | |||
"errors" | |||
"testing" | |||
|
|||
"github.com/ghodss/yaml" | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: space
for _, step := range installPlan.Status.Plan { | ||
if step.Resource.Kind == v1alpha1.ClusterServiceVersionKind { | ||
if err := crc.OperatorsV1alpha1().ClusterServiceVersions(namespace).Delete(step.Resource.Name, &metav1.DeleteOptions{}); err != nil { | ||
if err := crc.OperatorsV1alpha1().ClusterServiceVersions(namespace).Delete(step.Resource.Name, deleteOptions); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
our fetch<..>
functions take a *testing.T
, maybe the build<...>CleanupFunc
functions should too; then you could assert and fail when cleanup fails (which might be helpful since that's been a source of errors).
@@ -28,10 +30,23 @@ import ( | |||
const ( | |||
pollInterval = 1 * time.Second | |||
pollDuration = 5 * time.Minute | |||
|
|||
etcdVersion = "3.2.13" | |||
prometheusVersion = "v1.7.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2.3.2 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM when the CI passes
feat(catalog): add catalog status block updates
feat(catalog): add catalog status block updates
Description
Enables the status subresource for catalog sources.