diff --git a/controllers/spacerequest/spacerequest_controller.go b/controllers/spacerequest/spacerequest_controller.go index 0bd9050a9..aa389e6b0 100644 --- a/controllers/spacerequest/spacerequest_controller.go +++ b/controllers/spacerequest/spacerequest_controller.go @@ -444,7 +444,7 @@ func (r *Reconciler) ensureSecretForProvisionedNamespaces(ctx context.Context, m switch { case len(secretList.Items) == 0: // create the secret for this namespace - clientConfig, err := r.generateKubeConfig(subSpaceTargetCluster, namespace.Name) + clientConfig, err := r.generateKubeConfig(ctx, subSpaceTargetCluster, namespace.Name) if err != nil { return err } @@ -500,9 +500,9 @@ func (r *Reconciler) ensureSecretForProvisionedNamespaces(ctx context.Context, m return nil } -func (r *Reconciler) generateKubeConfig(subSpaceTargetCluster cluster.Cluster, namespace string) (*api.Config, error) { +func (r *Reconciler) generateKubeConfig(ctx context.Context, subSpaceTargetCluster cluster.Cluster, namespace string) (*api.Config, error) { // create a token request for the admin service account - token, err := restclient.CreateTokenRequest(subSpaceTargetCluster.RESTClient, types.NamespacedName{ + token, err := restclient.CreateTokenRequest(ctx, subSpaceTargetCluster.RESTClient, types.NamespacedName{ Namespace: namespace, Name: toolchainv1alpha1.AdminServiceAccountName, }, TokenRequestExpirationSeconds) diff --git a/controllers/toolchainstatus/toolchainstatus_controller.go b/controllers/toolchainstatus/toolchainstatus_controller.go index bb7f78a5d..d6ae402cb 100644 --- a/controllers/toolchainstatus/toolchainstatus_controller.go +++ b/controllers/toolchainstatus/toolchainstatus_controller.go @@ -337,7 +337,7 @@ func (r *Reconciler) hostOperatorHandleStatus(ctx context.Context, toolchainStat } // verify deployment version - versionCondition := r.VersionCheckManager.CheckDeployedVersionIsUpToDate(isProd, toolchainConfig.GitHubSecret().AccessTokenKey(), toolchainStatus.Status.HostOperator.RevisionCheck.Conditions, githubRepo) + versionCondition := r.VersionCheckManager.CheckDeployedVersionIsUpToDate(ctx, isProd, toolchainConfig.GitHubSecret().AccessTokenKey(), toolchainStatus.Status.HostOperator.RevisionCheck.Conditions, githubRepo) errVersionCheck := status.ValidateComponentConditionReady(*versionCondition) if errVersionCheck != nil { // let's set deployment is not up-to-date reason @@ -961,7 +961,7 @@ func (s *regServiceSubstatusHandler) addRegistrationServiceHealthAndRevisionChec Branch: registrationServiceRepoBranchName, DeployedCommitSHA: healthValues.Revision, } - versionCondition := s.versionCheckManager.CheckDeployedVersionIsUpToDate(isProd, toolchainConfig.GitHubSecret().AccessTokenKey(), toolchainStatus.Status.RegistrationService.RevisionCheck.Conditions, githubRepo) + versionCondition := s.versionCheckManager.CheckDeployedVersionIsUpToDate(ctx, isProd, toolchainConfig.GitHubSecret().AccessTokenKey(), toolchainStatus.Status.RegistrationService.RevisionCheck.Conditions, githubRepo) err = status.ValidateComponentConditionReady(*versionCondition) if err != nil { // add version is not up-to-date condition diff --git a/go.mod b/go.mod index e94773fe3..cd1c35644 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/codeready-toolchain/host-operator require ( github.com/codeready-toolchain/api v0.0.0-20231107202930-b028ae440a26 - github.com/codeready-toolchain/toolchain-common v0.0.0-20231113200037-9a9f915098e3 + github.com/codeready-toolchain/toolchain-common v0.0.0-20231117145902-3e7430ae48bb github.com/davecgh/go-spew v1.1.1 // indirect github.com/ghodss/yaml v1.0.0 github.com/go-bindata/go-bindata v3.1.2+incompatible diff --git a/go.sum b/go.sum index 5aade2394..43f42a34a 100644 --- a/go.sum +++ b/go.sum @@ -138,8 +138,8 @@ github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoC github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= github.com/codeready-toolchain/api v0.0.0-20231107202930-b028ae440a26 h1:7l/9jcykzh/Qq93EnPYQYpaejPkWaaHB6BLCwTKngJE= github.com/codeready-toolchain/api v0.0.0-20231107202930-b028ae440a26/go.mod h1:bImSKnxrpNmCmW/YEGiiZnZqJm3kAmfP5hW4YndK0hE= -github.com/codeready-toolchain/toolchain-common v0.0.0-20231113200037-9a9f915098e3 h1:sPXhmaRcT7y5rsuXFp3p0dgl6a7SixFVnZLAPRJYClU= -github.com/codeready-toolchain/toolchain-common v0.0.0-20231113200037-9a9f915098e3/go.mod h1:gyyXkpyEXoJJyHLuHBh/fckZ9XqjeP2AKlKkG/r9wpk= +github.com/codeready-toolchain/toolchain-common v0.0.0-20231117145902-3e7430ae48bb h1:TVgy4tO2oy2YwWTZXXYytY9soshylURDzmdkY6ch1+o= +github.com/codeready-toolchain/toolchain-common v0.0.0-20231117145902-3e7430ae48bb/go.mod h1:fmMAvkwt/OfANx8l/BDbuaHkjInlRJ3uYmIjjVmjd9w= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=