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

update apiservice registration namespace and spec on initialization #935

Merged
merged 1 commit into from Apr 24, 2018

Conversation

davidvossel
Copy link
Member

related to #932

@davidvossel davidvossel requested a review from rmohr April 20, 2018 17:02
Copy link
Member

@rmohr rmohr left a comment

Choose a reason for hiding this comment

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

In general great, we need that.

On second thought, we may need a check if there is another virt-api server running in the other namespace too and simply fail to start then. I think that otherwise the virt-api servers in different namespaces would just register themselves back and forth ...

@davidvossel what do you think?

@davidvossel
Copy link
Member Author

@rmohr I updated this patch to fail early if a namespace mismatch occurs. This puts the resolution on the operator. The error message clearly states what the issue is and how to resolve it.

apiService.Spec.CABundle = app.signingCertBytes
} else {
if apiService.ObjectMeta.Namespace != namespace {
return fmt.Errorf("apiservuce [%s] is already registered in a different namespace. Existing apiservice registration must be deleted before virt-api can proceed.", subresourceAggregatedApiName)
Copy link
Member

Choose a reason for hiding this comment

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

s/apiservuce/apiservice

Copy link
Member Author

Choose a reason for hiding this comment

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

oops, fixed :)

Copy link
Member

@rmohr rmohr left a comment

Choose a reason for hiding this comment

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

Looks perfect. Can go in as soon as the type is fixed and ci looks fine.

@cynepco3hahue
Copy link

retest this please

@rmohr
Copy link
Member

rmohr commented Apr 24, 2018

@cynepco3hahue I think that something goes wrong during the aggregated apiserver registration.

@cynepco3hahue
Copy link

@rmohr Looks so, I see virt-api pod stuck

++ kubectl get pods -n kube-system '-ocustom-columns=status:status.containerStatuses[*].ready,metadata:metadata.name' --no-headers
++ awk '!/virt-controller/ && /false/'
++ cluster/kubectl.sh get pods -n kube-system '-ocustom-columns=status:status.containerStatuses[*].ready,metadata:metadata.name' --no-headers
+ '[' -n 'false            virt-api-fd96f94b5-tjskr' ']'
+ echo 'Waiting for KubeVirt containers to become ready ...'
Waiting for KubeVirt containers to become ready ...
+ kubectl get pods -n kube-system '-ocustom-columns=status:status.containerStatuses[*].ready,metadata:metadata.name' --no-headers
+ awk '!/virt-controller/ && /false/'
+ cluster/kubectl.sh get pods -n kube-system '-ocustom-columns=status:status.containerStatuses[*].ready,metadata:metadata.name' --no-headers
false            virt-api-fd96f94b5-tjskr

Copy link
Member

@rmohr rmohr left a comment

Choose a reason for hiding this comment

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

Ok, it fails in a virt-api scale-out environment.

// Update apiService if CA bundle doesn't match ours
apiService.Spec.CABundle = app.signingCertBytes
} else {
if apiService.ObjectMeta.Namespace != namespace {
Copy link
Member

Choose a reason for hiding this comment

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

Ha, now I see the issue. That should be:

if apiService.Spec.Service.Namespace  != namespace {

}

Copy link
Member Author

Choose a reason for hiding this comment

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

whoa, hooray for functional tests :)

…spaces exist

Signed-off-by: David Vossel <davidvossel@gmail.com>
@davidvossel davidvossel merged commit 9ab09ca into kubevirt:master Apr 24, 2018
kubevirt-bot pushed a commit to kubevirt-bot/kubevirt that referenced this pull request Nov 6, 2020
Signed-off-by: Alexander Wels <awels@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants