Skip to content

Commit

Permalink
Update main.go
Browse files Browse the repository at this point in the history
  • Loading branch information
jenting authored Dec 8, 2024
1 parent 0415c40 commit 4747665
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,12 @@ func main() {
// Remove the metadata.managedFields field
unstructured.RemoveNestedField(obj.Object, "metadata", "managedFields")

fmt.Printf("Kind: %s, Name: %s/%s\n", obj.GetKind(), obj.GetName(), obj.GetNamespace())

// Print spec.project
specProject, _, err := unstructured.NestedString(obj.Object, "spec", "project")
if err != nil {
fmt.Printf("Error getting spec.project: %v\n", err)
return
}
fmt.Printf("spec.project: %s\n", specProject)

// Set and Get a key-value pair
key := fmt.Sprintf("%s|%s", specProject, obj.GetName())
Expand All @@ -135,9 +132,6 @@ func main() {
case watch.Deleted:
fmt.Println("Application deleted:", event.Object)

fmt.Printf("Kind: %s, Name: %s/%s\n", obj.GetKind(), obj.GetName(), obj.GetNamespace())

// Print spec.project
specProject, _, err := unstructured.NestedString(obj.Object, "spec", "project")
if err != nil {
fmt.Printf("Error getting spec.project: %v\n", err)
Expand Down

0 comments on commit 4747665

Please sign in to comment.