Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Rashmi Gottipati <[email protected]>
  • Loading branch information
rashmigottipati committed Aug 21, 2024
1 parent 7249602 commit ac8f6aa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/core/v1alpha1/clustercatalog_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const (
//+kubebuilder:resource:scope=Cluster
//+kubebuilder:subresource:status
//+kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase`
//+kubebuilder:printcolumn:name=LastUnpacked,type=date,JSONPath=`.metadata.LastUnpacked`
//+kubebuilder:printcolumn:name=LastUnpacked,type=date,JSONPath=`.status.LastUnpacked`
//+kubebuilder:printcolumn:name=Age,type=date,JSONPath=`.metadata.creationTimestamp`

// ClusterCatalog is the Schema for the ClusterCatalogs API
Expand Down
10 changes: 9 additions & 1 deletion internal/controllers/core/clustercatalog_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,15 @@ func (r *ClusterCatalogReconciler) reconcile(ctx context.Context, catalog *v1alp
}
contentURL = r.Storage.ContentURL(catalog.Name)

updateStatusUnpacked(&catalog.Status, unpackResult, contentURL, catalog.Generation, unpackResult.ResolvedSource.Image.LastUnpacked)
var lastUnpacked metav1.Time

if unpackResult != nil && unpackResult.ResolvedSource != nil && unpackResult.ResolvedSource.Image != nil {
lastUnpacked = unpackResult.ResolvedSource.Image.LastUnpacked
} else {
lastUnpacked = metav1.Time{}
}

updateStatusUnpacked(&catalog.Status, unpackResult, contentURL, catalog.Generation, lastUnpacked)

var requeueAfter time.Duration
switch catalog.Spec.Source.Type {
Expand Down

0 comments on commit ac8f6aa

Please sign in to comment.