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

Fix "kubectl explain" output for Agones CRDs #2423

Merged

Conversation

jiwonaid
Copy link
Contributor

@jiwonaid jiwonaid commented Jan 9, 2022

What type of PR is this?

Uncomment only one /kind <> line, press enter to put that in a new line, and remove leading whitespace from that line:

/kind breaking
/kind bug
/kind cleanup
/kind documentation

/kind feature

/kind hotfix

What this PR does / Why we need it:

To support "kubectl explain" command for Agones CRDs, some yaml values are added.

(kubernetes-admin-dev@dev) ☁  ~  kubectl explain pod
KIND:     Pod
VERSION:  v1

DESCRIPTION:
     Pod is a collection of containers that can run on a host. This resource is
     created by clients and scheduled onto hosts.

This is the result for the Fleet after applying this PR.

(kubernetes-admin-dev@dev) ☁  ~  kubectl version --short
Client Version: v1.22.3
Server Version: v1.19.6

(kubernetes-admin-dev@dev) ☁  ~  kubectl explain fleet
KIND:     Fleet
VERSION:  agones.dev/v1

DESCRIPTION:
     Fleet is the data structure for a Fleet resource

FIELDS:
   apiVersion	<string>
     APIVersion defines the versioned schema of this representation of an
     object. Servers should convert recognized schemas to the latest internal
     value, and may reject unrecognized values. More info:
     https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources

   kind	<string>
     Kind is a string value representing the REST resource this object
     represents. Servers may infer this from the endpoint the client submits
     requests to. Cannot be updated. In CamelCase. More info:
     https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds

   metadata	<Object>
     Standard object's metadata. More info:
     https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata

   spec	<Object>
     FleetSpec is the spec for a Fleet. More info:
     https://agones.dev/site/docs/reference/agones_crd_api_reference/#agones.dev/v1.Fleet

   status	<Object>
     FleetStatus is the status of a Fleet. More info:
     https://agones.dev/site/docs/reference/agones_crd_api_reference/#agones.dev/v1.Fleet

Which issue(s) this PR fixes:

Closes #1194

Special notes for your reviewer:

Hello.
For your information, I turned off my editor's auto-formatting features for the 'install/yaml/install.yaml', because I was not sure about that.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: da0433da-bad7-4107-aff1-d0bd201d079b

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@roberthbailey roberthbailey added the feature-freeze-do-not-merge Only eligible to be merged once we are out of feature freeze (next full release) label Jan 9, 2022
@roberthbailey
Copy link
Member

Thanks for your contribution!

The automated tests failed because install.yaml is a generated file and sometimes when you try to hand-edit it you don't exactly match what gets generated (in your case it looks like whitespace differences):

diff /tmp/agones-install/install.yaml.sorted /tmp/agones-install/install.current.yaml.sorted
11751c11751
<                               type: string 
---
>                               type: string
11981c11981
<                              type: string 
---
>                              type: string
12452a12453
>                         https://agones.dev/site/docs/reference/agones_crd_api_reference/#agones.dev/v1.GameServer'
12520a12522
>                        https://agones.dev/site/docs/reference/agones_crd_api_reference/#agones.dev/v1.GameServer'
12586a12589
>                       description: 'GameServerSpec is the spec for a GameServer resource. More info:
12634a12638
>                      description: 'GameServerSpec is the spec for a GameServer resource. More info:
12688c12692
<                      type: string 
---
>                      type: string
12744a12749
>                   description: 'GameServer is the data structure for a GameServer resource.'
12810a12816
>                  description: 'GameServer is the data structure for a GameServer resource.'

Rather than editing it by hand, if you edit the helm files and then run make gen-install that should clear up the test failures.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 46381256-5c11-4d76-8d3b-3ffe8aac7c0f

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/2423/head:pr_2423 && git checkout pr_2423
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.20.0-0dbaa06

@jiwonaid
Copy link
Contributor Author

jiwonaid commented Jan 10, 2022

Thanks for your code review! @roberthbailey

The generated install.yaml file was pushed and the build is just succeeded.

Thank you.

@markmandel
Copy link
Member

Oh that's neat!

@SaitejaTamma SaitejaTamma removed the feature-freeze-do-not-merge Only eligible to be merged once we are out of feature freeze (next full release) label Jan 18, 2022
Copy link
Member

@markmandel markmandel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just took this for a spin - looks good to me!

@google-oss-prow google-oss-prow bot added approved and removed lgtm labels Jan 20, 2022
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 548a7678-699e-478a-ac6c-d360b23f2783

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/2423/head:pr_2423 && git checkout pr_2423
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.21.0-f96a6e9

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jiwonaid, markmandel, roberthbailey

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 [markmandel,roberthbailey]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@roberthbailey roberthbailey merged commit cd89bb9 into googleforgames:main Jan 20, 2022
@SaitejaTamma SaitejaTamma added this to the 1.21.0 milestone Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix "kubectl explain" output for Agones CRDs
5 participants