Skip to content

Commit

Permalink
fix: Modify the ip in the kubeconfig used by the host cluster to clus…
Browse files Browse the repository at this point in the history
…ter ip

Signed-off-by: qiuwei <[email protected]>
  • Loading branch information
ONE7live authored and qiuwei68 committed May 10, 2024
1 parent 241b578 commit 44020c5
Show file tree
Hide file tree
Showing 4 changed files with 2,852 additions and 10 deletions.
2 changes: 1 addition & 1 deletion deploy/crds/kosmos.io_clusterpodconvertpolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
shortNames:
- pc
singular: clusterpodconvertpolicy
scope: Namespaced
scope: Cluster
versions:
- name: v1alpha1
schema:
Expand Down
24 changes: 24 additions & 0 deletions pkg/kosmosctl/join/join.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,30 @@ func (o *CommandJoinOptions) runCluster() error {
return err
}

clusterPodConvert, err := util.GenerateCustomResourceDefinition(manifest.ClusterPodConvert, nil)
if err != nil {
return err
}
_, err = o.K8sExtensionsClient.ApiextensionsV1().CustomResourceDefinitions().Create(context.Background(), clusterPodConvert, metav1.CreateOptions{})
if err != nil {
if !apierrors.IsAlreadyExists(err) {
return fmt.Errorf("kosmosctl join run error, crd options failed: %v", err)
}
}
klog.Info("Create CRD " + clusterPodConvert.Name + " successful.")

podConvert, err := util.GenerateCustomResourceDefinition(manifest.PodConvert, nil)
if err != nil {
return err
}
_, err = o.K8sExtensionsClient.ApiextensionsV1().CustomResourceDefinitions().Create(context.Background(), podConvert, metav1.CreateOptions{})
if err != nil {
if !apierrors.IsAlreadyExists(err) {
return fmt.Errorf("kosmosctl join run error, crd options failed: %v", err)
}
}
klog.Info("Create CRD " + podConvert.Name + " successful.")

if len(o.LeafModel) > 0 {
switch o.LeafModel {
case "one-to-one":
Expand Down
Loading

0 comments on commit 44020c5

Please sign in to comment.