Change kubecofnig secret creation time to non pointer (#731)

Signed-off-by: zhujian <jiazhu@redhat.com>
This commit is contained in:
Jian Zhu
2024-12-02 05:26:18 +00:00
committed by GitHub
parent 6e367a2b26
commit 41a01b1da0
5 changed files with 9 additions and 9 deletions
@@ -26,7 +26,7 @@ import (
clusterv1alpha1 "open-cluster-management.io/api/cluster/v1alpha1"
clusterv1beta1 "open-cluster-management.io/api/cluster/v1beta1"
amindex "open-cluster-management.io/ocm/pkg/addon/index"
addonindex "open-cluster-management.io/ocm/pkg/addon/index"
"open-cluster-management.io/ocm/pkg/common/helpers"
)
@@ -1243,7 +1243,7 @@ func TestAddonConfigReconcile(t *testing.T) {
err := addonInformers.Addon().V1alpha1().ManagedClusterAddOns().Informer().AddIndexers(
cache.Indexers{
amindex.ManagedClusterAddonByName: amindex.IndexManagedClusterAddonByName,
addonindex.ManagedClusterAddonByName: addonindex.IndexManagedClusterAddonByName,
})
if err != nil {
t.Fatal(err)
@@ -23,7 +23,7 @@ import (
clusterv1beta1 "open-cluster-management.io/api/cluster/v1beta1"
"open-cluster-management.io/sdk-go/pkg/patcher"
amindex "open-cluster-management.io/ocm/pkg/addon/index"
addonindex "open-cluster-management.io/ocm/pkg/addon/index"
"open-cluster-management.io/ocm/pkg/common/helpers"
)
@@ -687,7 +687,7 @@ func TestMgmtAddonProgressingReconcile(t *testing.T) {
err := addonInformers.Addon().V1alpha1().ManagedClusterAddOns().Informer().AddIndexers(
cache.Indexers{
amindex.ManagedClusterAddonByName: amindex.IndexManagedClusterAddonByName,
addonindex.ManagedClusterAddonByName: addonindex.IndexManagedClusterAddonByName,
})
if err != nil {
t.Fatal(err)
@@ -20,7 +20,7 @@ import (
clusterv1informers "open-cluster-management.io/api/client/cluster/informers/externalversions"
clusterv1beta1 "open-cluster-management.io/api/cluster/v1beta1"
amindex "open-cluster-management.io/ocm/pkg/addon/index"
addonindex "open-cluster-management.io/ocm/pkg/addon/index"
)
func TestAddonInstallReconcile(t *testing.T) {
@@ -230,7 +230,7 @@ func TestAddonInstallReconcile(t *testing.T) {
err := addonInformers.Addon().V1alpha1().ManagedClusterAddOns().Informer().AddIndexers(
cache.Indexers{
amindex.ManagedClusterAddonByName: amindex.IndexManagedClusterAddonByName,
addonindex.ManagedClusterAddonByName: addonindex.IndexManagedClusterAddonByName,
})
if err != nil {
t.Fatal(err)
@@ -36,7 +36,7 @@ type managedClusterClients struct {
// Only used for Hosted mode to generate managed cluster kubeconfig
// with minimum permission for registration and work.
kubeconfig *rest.Config
kubeconfigSecretCreationTime *metav1.Time
kubeconfigSecretCreationTime metav1.Time
}
type managedClusterClientsBuilder struct {
@@ -106,7 +106,7 @@ func (m *managedClusterClientsBuilder) build(ctx context.Context) (*managedClust
clients := &managedClusterClients{
kubeconfig: managedKubeConfig,
kubeconfigSecretCreationTime: &creationTime,
kubeconfigSecretCreationTime: creationTime,
}
if clients.kubeClient, err = kubernetes.NewForConfig(managedKubeConfig); err != nil {
@@ -1561,7 +1561,7 @@ func (f *fakeManagedClusterBuilder) build(_ context.Context) (*managedClusterCli
CAData: []byte("test"),
},
},
kubeconfigSecretCreationTime: &creationTime,
kubeconfigSecretCreationTime: creationTime,
}, nil
}