mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-08-23 22:26:49 +00:00
Change kubecofnig secret creation time to non pointer (#731)
Signed-off-by: zhujian <jiazhu@redhat.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
+2
-2
@@ -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 {
|
||||
|
||||
+1
-1
@@ -1561,7 +1561,7 @@ func (f *fakeManagedClusterBuilder) build(_ context.Context) (*managedClusterCli
|
||||
CAData: []byte("test"),
|
||||
},
|
||||
},
|
||||
kubeconfigSecretCreationTime: &creationTime,
|
||||
kubeconfigSecretCreationTime: creationTime,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user