Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use assisted installer admin kubeconfig if exists #81

Conversation

jhernand
Copy link
Collaborator

@jhernand jhernand commented Apr 9, 2024

Currently the deployment manager service uses the admin kubeconfig that was used to register the cluster with ACM. But this will not exist if the cluster was created with assisted installer. To avoid that problem this patch changes the service so that it first check if the secret used by the assisted installer exists. If it does exist then it will use it.

@openshift-ci openshift-ci bot requested review from danielerez and irinamihai April 9, 2024 15:28
Copy link
Collaborator

@danielerez danielerez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a minor comment.

return
}
if assistedInstallerAdminKubeconfig != nil {
result, err = h.makeProfile(assistedInstallerAdminKubeconfig)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe worth having some log here?
I.e. a debug/info log that indicates which kubeconfig is used.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, will do it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added an info message for this, and also for the case where we use the registration kubeconfig.

@jhernand jhernand force-pushed the use_assisted_installer_admin_kubeconfig_if_exists branch from e7e82e7 to b9dd377 Compare April 9, 2024 18:19
@danielerez
Copy link
Collaborator

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 9, 2024

// Make the profile data from the cluster admin kubeconfig:
result, err = h.makeProfile(clusterAdminKubeconfig)
return
}

// fetchAssistedInstallerAdminKubeconfig uses the given Kubernetes API client to fetch the admin
// kubeconfig that is created by the assisted installer when cluster installation finishes. It
// returns the serialized kubeconfig, or nil if there it doesn't exist, for example if the cluster
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: extra "there".

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Irina :-) , fixing it ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Currently the deployment manager service uses the admin kubeconfig that
was used to register the cluster with ACM. But this will not exist if
the cluster was created with assisted installer. To avoid that problem
this patch changes the service so that it first check if the secret used
by the assisted installer exists. If it does exist then it will use it.

Signed-off-by: Juan Hernandez <[email protected]>
@jhernand jhernand force-pushed the use_assisted_installer_admin_kubeconfig_if_exists branch from b9dd377 to 7d63419 Compare April 9, 2024 18:54
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 9, 2024
@irinamihai
Copy link
Collaborator

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 9, 2024
@irinamihai
Copy link
Collaborator

/approve

Copy link

openshift-ci bot commented Apr 9, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: irinamihai

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 9, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 3b907ce into openshift-kni:main Apr 9, 2024
8 checks passed
@jhernand jhernand deleted the use_assisted_installer_admin_kubeconfig_if_exists branch April 9, 2024 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants