kubernetes-client / c

Official C client library for Kubernetes
Apache License 2.0
141 stars 45 forks source link

Automated Generate from openapi release-1.24 #126

Closed github-actions[bot] closed 2 years ago

ityuhui commented 2 years ago

The code change looks good to me. But this PR didn't trigger the build and test action.

I will close and reopen this PR to try to trigger the build and test.

Refer to PRs created don't trigger other actions

ityuhui commented 2 years ago

There is a build error in the example:

cd examples/
  make
  shell: /usr/bin/bash -e {0}
cd create_pod; make
make[1]: Entering directory '/home/runner/work/c/c/examples/create_pod'
gcc main.c -g -I../../kubernetes/include -I../../kubernetes/model -I../../kubernetes/api -I../../kubernetes/config -L../../kubernetes/build -lkubernetes -lyaml -lwebsockets -L/usr/local/lib -o create_pod_bin
main.c: In function ‘create_a_pod’:
main.c:26:[3](https://github.com/kubernetes-client/c/runs/6748985393?check_suite_focus=true#step:8:3)0: error: ‘kubernetes_v1_container_IMAGEPULLPOLICY_IfNotPresent’ undeclared (first use in this function)
   26 |     con->image_pull_policy = kubernetes_v1_container_IMAGEPULLPOLICY_IfNotPresent;
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:26:30: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [Makefile:[7](https://github.com/kubernetes-client/c/runs/6748985393?check_suite_focus=true#step:8:8): all] Error 1
make[1]: Leaving directory '/home/runner/work/c/c/examples/create_pod'
make: *** [Makefile:2: all] Error 2
Error: Process completed with exit code 2.

The type of imagePullPolicy changes from enum to string. We can fix this issue by changing the example code from

con->image_pull_policy = kubernetes_v1_container_IMAGEPULLPOLICY_IfNotPresent;

to

con->image_pull_policy = strdup("IfNotPresent");
brendandburns commented 2 years ago

I will add a commit to fix these.

brendandburns commented 2 years ago

@ityuhui commit added, please take another look.

ityuhui commented 2 years ago

/lgtm /approve

k8s-ci-robot commented 2 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: github-actions[bot], ityuhui

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: - ~~[OWNERS](https://github.com/kubernetes-client/c/blob/master/OWNERS)~~ [ityuhui] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment