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

🐛 clusterworkspaceshard: fix admission and shard creation for multi-shard setups #2360

Merged
merged 1 commit into from
Nov 15, 2022

Conversation

sttts
Copy link
Member

@sttts sttts commented Nov 15, 2022

Admission is not the right place to default the shard.status URLs values as it is run on the server side and the server side is always the root shard. This PR moves it into the server initialization "client-side".

@openshift-ci openshift-ci bot added the kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API label Nov 15, 2022
@sttts sttts force-pushed the sttts-shard-admission branch 2 times, most recently from e1f6ea6 to 03bcc6f Compare November 15, 2022 10:04
@@ -186,6 +183,9 @@ func (s *Server) Run(ctx context.Context) error {

if s.Options.Extra.ShardName == tenancyv1alpha1.RootShard {
logger.Info("bootstrapping root workspace phase 0")

s.RootShardKcpClusterClient = s.KcpClusterClient
Copy link
Contributor

Choose a reason for hiding this comment

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

seems this is not needed as we assign in the config.go

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

shard := &tenancyv1alpha1.ClusterWorkspaceShard{
ObjectMeta: metav1.ObjectMeta{
Name: s.Options.Extra.ShardName,
Annotations: map[string]string{logicalcluster.AnnotationKey: tenancyv1alpha1.RootCluster.String()},
Copy link
Contributor

Choose a reason for hiding this comment

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

not s.Options.Extra.ShardName ?

Copy link
Member Author

Choose a reason for hiding this comment

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

no, this is just for logging

Copy link
Contributor

Choose a reason for hiding this comment

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

in the future we will put a shard name as an annotation

@sttts sttts force-pushed the sttts-shard-admission branch from 03bcc6f to 06620e0 Compare November 15, 2022 11:42
@sttts sttts force-pushed the sttts-shard-admission branch from 06620e0 to 11aaa31 Compare November 15, 2022 11:48
@p0lyn0mial
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 15, 2022
@sttts
Copy link
Member Author

sttts commented Nov 15, 2022

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 15, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sttts

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 Nov 15, 2022
@openshift-merge-robot openshift-merge-robot merged commit 61e61a0 into kcp-dev:main Nov 15, 2022
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. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API 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