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

Removed hidden code outputs #129

Merged
merged 2 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ The SDK iterates over each YAML file in the "converted-yamls" directory. If a YA
### Runtime-Object and Unstruct-Object
The SDK currently employs the "runtime-object method" to handle Kubernetes resources whose structure is recognized by Kubernetes by default. Examples of such resources include Deployment, Service, and ConfigMap. Conversely, resources that are not inherently known to Kubernetes and require explicit installation or definition, such as Third-Party Custom Resource Definitions (CRDs) like NetworkAttachmentDefinition or PrometheusRule, are processed using the "unstructured-object" method. Such examples are given below:

<details>
<summary>Example</summary>
Example

```
// Runtime-Object Example
Expand Down Expand Up @@ -68,7 +67,6 @@ networkAttachmentDefinition1 := &unstructured.Unstructured{
},
}
```
</details>

### Flow-3.1: KRM to Runtime-Object
The conversion process relies on the "k8s.io/apimachinery/pkg/runtime" package. Currently, only the API version "v1" is supported. The supported kinds for the Runtime Object method include:
Expand Down Expand Up @@ -109,8 +107,7 @@ We have assumed in the DFS function, that every path (structure) will end at the
2. []byte/[]uint8: []byte is generally used in kind: Secret. It is seen that we provide 64base encoded secret-value in yaml, but on converting the yaml to runtime-obj, the secret-val automatically get decoded to actual value, Since, It is not good to show decoded/actual secret value in the code, therefore, we encode it again and store this base64-encoded-value as secret-value in json.


<details>
<summary>JSON Conversion Example</summary>
JSON Conversion Example

```
// For A KRM Resource
Expand Down Expand Up @@ -157,7 +154,6 @@ spec:
}
// It shows the hierarchical structure along with the specific data types and corresponding values for each attribute
```
</details>

### Flow-3.3: JSON to String (Go-Code)
The SDK reads the JSON file containing the information about the Kubernetes resource and then translates this information into a string of Go code. This process involves parsing the JSON structure and generating corresponding Go code strings based on the structure, data types, and values extracted from the JSON representation. Ultimately, this results in a string that represents the Kubernetes resource in a format compatible with Go code.
Expand Down Expand Up @@ -198,8 +194,7 @@ B) Composite Cases:



<details>
<summary>GoCode Conversion Example</summary>
GoCode Conversion Example

```
// For a JSON structure Like the following:
Expand Down Expand Up @@ -255,7 +250,6 @@ B) Composite Cases:
},
}
```
</details>

### Significance of Config-Jsons: (Struct_Module_mapping.json & Enum_module_mapping.json)
Based on the data type, Values are formatted accordingly,
Expand Down
30 changes: 9 additions & 21 deletions content/en/docs/guides/install-guides/explore-sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ You can examine the contents of any rendered kpt packager by examining the conte
└── resource-backend

```
<details>
<summary>You can check the status of an applied kpt package using a "kpt live status package_dir" command.</summary>
You can check the status of an applied kpt package using a "kpt live status package_dir" command.

```bash
kpt live status /tmp/kpt-pkg/nephio-controllers/
Expand Down Expand Up @@ -98,7 +97,6 @@ inventory-38069595/customresourcedefinition.apiextensions.k8s.io//smfdeployments
inventory-38069595/customresourcedefinition.apiextensions.k8s.io//upfdeployments.workload.nephio.org is Current: CRD is established
inventory-38069595/namespace//nephio-system is Current: Resource is current
```
</details>

## Base Components

Expand Down Expand Up @@ -131,8 +129,7 @@ interacts closely with.

# Some Useful Commands

<details>
<summary>Easily get the kubeconfig for a CAPI KinD cluster:</summary>
Easily get the kubeconfig for a CAPI KinD cluster:

```bash
get_capi_kubeconfig regional
Expand All @@ -141,11 +138,8 @@ get_capi_kubeconfig regional
will create a file `regional-kubeconfig` used to connect to that
cluster.

</details>

<details>
<summary>You can query docker to see the docker images running KinD
clusters:</summary>
You can query docker to see the docker images running KinD
clusters:

```bash
docker ps
Expand All @@ -157,10 +151,7 @@ The output is similar to:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
350b4a7e29f8 kindest/node:v1.27.1 "/usr/local/bin/entr…" 4 days ago Up 4 days 127.0.0.1:44695->6443/tcp kind-control-plane
```
</details>

<details>
<summary>Querying running KinD clusters after the install produces output similar to:</summary>
Querying running KinD clusters after the install produces output similar to:

```bash
kind get clusters
Expand All @@ -171,10 +162,8 @@ The output is similar to:
```console
kind
```
</details>

<details>
<summary>Querying the k8s pods running after the install produces output similar to:</summary>
Querying the k8s pods running after the install produces output similar to:

```bash
kubectl get pods -A --field-selector=metadata.namespace!=kube-system
Expand Down Expand Up @@ -211,10 +200,9 @@ porch-system porch-controllers-646dfb5f6-lxthk
porch-system porch-server-69445b4d58-mkqqt 1/1 Running 28 (41m ago) 41h
resource-group-system resource-group-controller-manager-6c9d56d88-njjr6 3/3 Running 6 (105m ago) 41h
```
</details>

<details>
<summary>Querying the repositories that exist after the install produces output similar to:</summary>

Querying the repositories that exist after the install produces output similar to:

```bash
kubectl get repositories
Expand All @@ -229,4 +217,4 @@ mgmt git Package true True http://172.18.0.
mgmt-staging git Package false True http://172.18.0.200:3000/nephio/mgmt-staging.git
nephio-example-packages git Package false True https://github.com/nephio-project/nephio-example-packages.git
```
</details>

Loading