github.com/verrazzano/verrazzano@v1.7.0/tools/vz/test/helpers/kubectl.go (about) 1 // Copyright (c) 2023, Oracle and/or its affiliates. 2 // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 4 package helpers 5 6 import ( 7 "github.com/google/go-cmp/cmp" 8 v12 "k8s.io/api/core/v1" 9 "k8s.io/apimachinery/pkg/apis/meta/v1" 10 "testing" 11 ) 12 13 func VerifyLastAppliedConfigAnnotation(t *testing.T, object v1.ObjectMeta, expectedLastAppliedConfigAnnotation string) { 14 actual := object.GetAnnotations()[v12.LastAppliedConfigAnnotation] 15 if diff := cmp.Diff(actual, expectedLastAppliedConfigAnnotation); diff != "" { 16 t.Errorf("expected %v\n, got %v instead", expectedLastAppliedConfigAnnotation, actual) 17 t.Logf("Difference: %s", diff) 18 } 19 }