-
Notifications
You must be signed in to change notification settings - Fork 13
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
add support for adopting external cluster #306
base: main
Are you sure you want to change the base?
Changes from 5 commits
43ae169
3c7e658
8eabbb7
756f7b7
28260e7
ecbb432
d80da22
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,11 +54,40 @@ spec: | |
spec: | ||
description: ControlPlaneSpec defines the desired state of ControlPlane | ||
properties: | ||
adoptedTokenExpirationSeconds: | ||
description: expiration time for token of adopted cluster | ||
format: int64 | ||
type: integer | ||
backend: | ||
enum: | ||
- shared | ||
- dedicated | ||
type: string | ||
bootstrapSecretRef: | ||
description: |- | ||
BootstrapSecretRef contains a reference to the kubeconfig used to bootstrap adoption of | ||
an external cluster | ||
properties: | ||
inClusterKey: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please clarify what is Perhaps I missed, but I did not see a documentation of what the bootstrap secret should look like. This is useful if somebody wants/needs to create it without using kflex. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You may see the defaults being used for the bootstrap secret in func GenerateBoostrapSecretName(cpName string) string {
return fmt.Sprintf("%s-bootstrap", cpName)
} namespace is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To further clarify, Since you have a default, can you make it not required? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
No, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (A) Since the golang source re-uses the existing type (B) @pdettori, what do you mean by "You do not have to provide these values in the ControlPlane CR, they are optional"? Which values are optional? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @MikeSpreitzer - re. (B) - what I stated previously was not correct. The bootstrap secret must be provided in the secret reference. Please check "Creating a control plane of type |
||
description: Required | ||
type: string | ||
key: | ||
type: string | ||
name: | ||
description: |- | ||
`name` is the name of the secret. | ||
Required | ||
type: string | ||
namespace: | ||
description: |- | ||
`namespace` is the namespace of the secret. | ||
Required | ||
type: string | ||
required: | ||
- inClusterKey | ||
- name | ||
- namespace | ||
type: object | ||
postCreateHook: | ||
type: string | ||
postCreateHookVars: | ||
|
@@ -71,6 +100,7 @@ spec: | |
- ocm | ||
- vcluster | ||
- host | ||
- external | ||
type: string | ||
type: object | ||
status: | ||
|
@@ -119,7 +149,6 @@ spec: | |
description: Required | ||
type: string | ||
key: | ||
description: Required | ||
type: string | ||
name: | ||
description: |- | ||
|
@@ -133,7 +162,6 @@ spec: | |
type: string | ||
required: | ||
- inClusterKey | ||
- key | ||
- name | ||
- namespace | ||
type: object | ||
|
@@ -253,7 +281,6 @@ spec: | |
description: Required | ||
type: string | ||
key: | ||
description: Required | ||
type: string | ||
name: | ||
description: |- | ||
|
@@ -267,7 +294,6 @@ spec: | |
type: string | ||
required: | ||
- inClusterKey | ||
- key | ||
- name | ||
- namespace | ||
type: object | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an "inline union": some unconditional fields plus a discriminator (
Type
) that determines whether some of the other fields should be present or absent. FYI, these are frowned upon in the Kubernetes API design community. They prefer pure unions: a pure union struct has only a discriminator plus fields whose proper presence is determined by the discriminator.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct, but I am concerned about introducing a non-backward compatible change if we go with the pure union. Just to be clear, is something like the following what you have in mind for the "pure union"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What you showed looks like a pure union.