Skip to content

Commit

Permalink
refactor: Rename project to knest
Browse files Browse the repository at this point in the history
  • Loading branch information
fengye87 committed Jun 23, 2022
1 parent 6904208 commit adca33f
Show file tree
Hide file tree
Showing 8 changed files with 127 additions and 120 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
with:
go-version: 1.17.9

- run: CGO_ENABLED=0 go build -a -o unkink main.go
- run: CGO_ENABLED=0 go build -a -o knest main.go

- uses: softprops/action-gh-release@v1
with:
files: unkink
files: knest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
knest
*.kubeconfig

# Binaries for programs and plugins
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Unkink: Kubernetes-in-Kubernetes Made Simple
# knest: Kubernetes-in-Kubernetes Made Simple

## License

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/smartxworks/unkink
module github.com/smartxworks/knest

go 1.17

Expand Down
16 changes: 8 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

func main() {
rootCmd := &cobra.Command{
Use: "unkink",
Use: "knest",
}

clusterCreateCmd := &cobra.Command{
Expand All @@ -44,29 +44,29 @@ func main() {
crdName: "certificates.cert-manager.io",
manifestName: "cert-manager.yaml",
}, {
crdName: "virtualmachines.kubrid.smartx.com",
crdName: "virtualmachines.virt.virtink.smartx.com",
requiredDeploymentKeys: []types.NamespacedName{{
Name: "cert-manager-webhook",
Namespace: "cert-manager",
}},
manifestName: "kubrid.yaml",
manifestName: "virtink.yaml",
}, {
crdName: "clusters.cluster.x-k8s.io",
manifestName: "cluster-api-components.yaml",
}, {
crdName: "kubridclusters.infrastructure.cluster.x-k8s.io",
crdName: "virtinkclusters.infrastructure.cluster.x-k8s.io",
manifestName: "capch.yaml",
}}

for _, component := range components {
output, err := exec.Command("kubectl", "get", "crd", component.crdName, "--ignore-not-found").CombinedOutput()
output, err := exec.Command("kubectl", "get", "crds", component.crdName, "--ignore-not-found").CombinedOutput()
if err != nil {
return fmt.Errorf("get CRD: %s", err)
}

if len(output) == 0 {
for _, k := range component.requiredDeploymentKeys {
if err := exec.Command("kubectl", "wait", "-n", k.Namespace, "deployment", k.Name, "--for=condition=Available", "--timeout=-1s").Run(); err != nil {
if err := exec.Command("kubectl", "wait", "-n", k.Namespace, "deployments", k.Name, "--for=condition=Available", "--timeout=-1s").Run(); err != nil {
return fmt.Errorf("wait for deployment: %s", err)
}
}
Expand All @@ -91,7 +91,7 @@ func main() {
Namespace: "capch-system",
}}
for _, k := range capiWebhookDeploymentKeys {
if err := exec.Command("kubectl", "wait", "-n", k.Namespace, "deployment", k.Name, "--for=condition=Available", "--timeout=-1s").Run(); err != nil {
if err := exec.Command("kubectl", "wait", "-n", k.Namespace, "deployments", k.Name, "--for=condition=Available", "--timeout=-1s").Run(); err != nil {
return fmt.Errorf("wait for deployment: %s", err)
}
}
Expand All @@ -100,7 +100,7 @@ func main() {
return fmt.Errorf("apply cluster template: %s", err)
}

if err := exec.Command("kubectl", "wait", "cluster", clusterName, "--for=condition=ControlPlaneInitialized", "--timeout=-1s").Run(); err != nil {
if err := exec.Command("kubectl", "wait", "clusters.cluster.x-k8s.io", clusterName, "--for=condition=ControlPlaneInitialized", "--timeout=-1s").Run(); err != nil {
return fmt.Errorf("wait for cluster: %s", err)
}

Expand Down
68 changes: 34 additions & 34 deletions manifests/capch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ metadata:
creationTimestamp: null
labels:
cluster.x-k8s.io/v1beta1: v1beta1
name: kubridclusters.infrastructure.cluster.x-k8s.io
name: virtinkclusters.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
names:
kind: KubridCluster
listKind: KubridClusterList
plural: kubridclusters
singular: kubridcluster
kind: VirTinkCluster
listKind: VirTinkClusterList
plural: virtinkclusters
singular: virtinkcluster
scope: Namespaced
versions:
- additionalPrinterColumns:
Expand All @@ -36,7 +36,7 @@ spec:
name: v1beta1
schema:
openAPIV3Schema:
description: KubridCluster is the Schema for the kubridclusters API
description: VirTinkCluster is the Schema for the virtinkclusters API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand All @@ -51,7 +51,7 @@ spec:
metadata:
type: object
spec:
description: KubridClusterSpec defines the desired state of KubridCluster
description: VirTinkClusterSpec defines the desired state of VirTinkCluster
properties:
controlPlaneEndpoint:
description: APIEndpoint represents a reachable Kubernetes API endpoint.
Expand All @@ -69,7 +69,7 @@ spec:
type: object
type: object
status:
description: KubridClusterStatus defines the observed state of KubridCluster
description: VirTinkClusterStatus defines the observed state of VirTinkCluster
properties:
ready:
type: boolean
Expand All @@ -94,14 +94,14 @@ metadata:
creationTimestamp: null
labels:
cluster.x-k8s.io/v1beta1: v1beta1
name: kubridmachines.infrastructure.cluster.x-k8s.io
name: virtinkmachines.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
names:
kind: KubridMachine
listKind: KubridMachineList
plural: kubridmachines
singular: kubridmachine
kind: VirTinkMachine
listKind: VirTinkMachineList
plural: virtinkmachines
singular: virtinkmachine
scope: Namespaced
versions:
- additionalPrinterColumns:
Expand All @@ -114,7 +114,7 @@ spec:
name: v1beta1
schema:
openAPIV3Schema:
description: KubridMachine is the Schema for the kubridmachines API
description: VirTinkMachine is the Schema for the virtinkmachines API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand All @@ -129,7 +129,7 @@ spec:
metadata:
type: object
spec:
description: KubridMachineSpec defines the desired state of KubridMachine
description: VirTinkMachineSpec defines the desired state of VirTinkMachine
properties:
providerID:
type: string
Expand Down Expand Up @@ -1507,7 +1507,7 @@ spec:
- vmSpec
type: object
status:
description: KubridMachineStatus defines the observed state of KubridMachine
description: VirTinkMachineStatus defines the observed state of VirTinkMachine
properties:
ready:
type: boolean
Expand All @@ -1532,20 +1532,20 @@ metadata:
creationTimestamp: null
labels:
cluster.x-k8s.io/v1beta1: v1beta1
name: kubridmachinetemplates.infrastructure.cluster.x-k8s.io
name: virtinkmachinetemplates.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
names:
kind: KubridMachineTemplate
listKind: KubridMachineTemplateList
plural: kubridmachinetemplates
singular: kubridmachinetemplate
kind: VirTinkMachineTemplate
listKind: VirTinkMachineTemplateList
plural: virtinkmachinetemplates
singular: virtinkmachinetemplate
scope: Namespaced
versions:
- name: v1beta1
schema:
openAPIV3Schema:
description: KubridMachineTemplate is the Schema for the kubridmachinetemplates
description: VirTinkMachineTemplate is the Schema for the virtinkmachinetemplates
API
properties:
apiVersion:
Expand All @@ -1561,15 +1561,15 @@ spec:
metadata:
type: object
spec:
description: KubridMachineTemplateSpec defines the desired state of KubridMachineTemplate
description: VirTinkMachineTemplateSpec defines the desired state of VirTinkMachineTemplate
properties:
template:
properties:
metadata:
type: object
x-kubernetes-preserve-unknown-fields: true
spec:
description: KubridMachineSpec defines the desired state of KubridMachine
description: VirTinkMachineSpec defines the desired state of VirTinkMachine
properties:
providerID:
type: string
Expand Down Expand Up @@ -3061,8 +3061,8 @@ spec:
- template
type: object
status:
description: KubridMachineTemplateStatus defines the observed state of
KubridMachineTemplate
description: VirTinkMachineTemplateStatus defines the observed state of
VirTinkMachineTemplate
type: object
type: object
served: true
Expand Down Expand Up @@ -3177,7 +3177,7 @@ rules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
resources:
- kubridclusters
- virtinkclusters
verbs:
- create
- delete
Expand All @@ -3189,21 +3189,21 @@ rules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
resources:
- kubridclusters/finalizers
- virtinkclusters/finalizers
verbs:
- update
- apiGroups:
- infrastructure.cluster.x-k8s.io
resources:
- kubridclusters/status
- virtinkclusters/status
verbs:
- get
- patch
- update
- apiGroups:
- infrastructure.cluster.x-k8s.io
resources:
- kubridmachines
- virtinkmachines
verbs:
- create
- delete
Expand All @@ -3215,19 +3215,19 @@ rules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
resources:
- kubridmachines/finalizers
- virtinkmachines/finalizers
verbs:
- update
- apiGroups:
- infrastructure.cluster.x-k8s.io
resources:
- kubridmachines/status
- virtinkmachines/status
verbs:
- get
- patch
- update
- apiGroups:
- kubrid.smartx.com
- virt.virtink.smartx.com
resources:
- virtualmachines
verbs:
Expand Down Expand Up @@ -3387,7 +3387,7 @@ spec:
- --zap-time-encoding=iso8601
command:
- /manager
image: harbor.smartx.com/fengye87/capch-controller:17d561a@sha256:7d387e142b80bb9c6bca06726c1d556ec24c332e1a9a1c7455bcbef610cb911a
image: smartxworks/capch-controller:v0.1.0@sha256:1ca2adefe687bf3cbd89dc166d11ec87a6dce65379244dd41e8b5ded3525f2da
livenessProbe:
httpGet:
path: /healthz
Expand Down
Loading

0 comments on commit adca33f

Please sign in to comment.