-
Notifications
You must be signed in to change notification settings - Fork 123
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
Bug 1705752: update crd #319
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dmage 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:
Approvers can indicate their approval by writing |
/hold waiting until GCS is landed |
/hold cancel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like with our current form, the CRD is so restrictive that I doubt any sample config will work.
type: string | ||
name: | ||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | ||
TODO: Add other useful fields. apiVersion, kind, uid?' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to clean up our doc comments - this will show up in oc explain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a part of k8s.io/api/core/v1
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something that we can do upstream!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(obviously won't address in this PR)
- baseURL | ||
- duration | ||
- keypairID | ||
- privateKey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like our CRD generator is interpreting everything as required. API needs to be updated to have // +optional
in the doc comment and omitempty
in the json tag.
Refer to upstream api doc, types may also need to be switched to pointers - https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#optional-vs-required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// +optional
is enough. I added this comment tag to the optional fields.
This field should contain only packages that are used in the project without importing them (for example, in shell scripts).
/assign @adambkaplan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few nits so we play nicer with the crd-gen. Also raised a few questions that need to be addressed by api-review
// Proxy defines the proxy to be used when calling master api, upstream registries, etc | ||
// Proxy defines the proxy to be used when calling master api, upstream | ||
// registries, etc. | ||
// +optional | ||
Proxy ImageRegistryConfigProxy `json:"proxy"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a pointer here so we can distinguish between "no proxy was set" vs. "don't use a proxy for the registry".
Proxy ImageRegistryConfigProxy `json:"proxy"` | |
Proxy *ImageRegistryConfigProxy `json:"proxy,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want this PR to change the logic for proxies? Or should this PR depend on your PR about a generic Proxy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Requests controls how many parallel requests a given registry instance will handle before queuing additional requests | ||
// Requests controls how many parallel requests a given registry instance | ||
// will handle before queuing additional requests. | ||
// +optional | ||
Requests ImageRegistryConfigRequests `json:"requests"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pointer+omitempty - otherwise you'll see requests: {}
in the YAML output.
Requests ImageRegistryConfigRequests `json:"requests"` | |
Requests *ImageRegistryConfigRequests `json:"requests,omitempty"` |
HTTP string `json:"http"` | ||
// +optional | ||
HTTPS string `json:"https"` | ||
// +optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we make Proxy
a pointer in spec
, then we can can keep these as "required".
I will also be adding a PR soon to have a generic Proxy with these fields (and appropriate doc for oc explain)
@@ -176,7 +184,8 @@ type ImageRegistryConfigStorageS3CloudFront struct { | |||
PrivateKey corev1.SecretKeySelector `json:"privateKey"` | |||
// KeypairID is key pair ID provided by AWS. | |||
KeypairID string `json:"keypairID"` | |||
// Duration is the duration of the Cloudfront session (optional). | |||
// Duration is the duration of the Cloudfront session. | |||
// +optional | |||
Duration metav1.Duration `json:"duration"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want omitempty
- otherwise we'll get duration: 0s
in the YAML output?
// Bucket is the bucket name in which you want to store the registry's | ||
// data. | ||
// Optional, will be generated if not provided. | ||
// +optional | ||
Bucket string `json:"bucket"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Convert to pointer + omitempty?
// Optional, will be set based on the installed AWS Region | ||
// Region is the AWS region in which your bucket exists. | ||
// Optional, will be set based on the installed AWS Region. | ||
// +optional | ||
Region string `json:"region"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@openshift/api-reviewers does it make sense to have an optional field that is not omitempty
?
// +optional | ||
TenantID string `json:"tenantID"` | ||
// +optional | ||
RegionName string `json:"regionName"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs doc for oc explain
} | ||
|
||
type ImageRegistryConfigStoragePVC struct { | ||
// +optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs doc for oc explain
@@ -255,47 +289,54 @@ type ImageRegistryConfigStorage struct { | |||
// for production use. When the pod is removed from a node for any reason, | |||
// the data in the emptyDir is deleted forever. | |||
// This configuration is EXPERIMENTAL and is subject to change without notice. | |||
// +optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to add a discriminator field and type, i.e.
type ImageRegistryConfigStorageType string
const (
AzureImageRegistryStorageType ImageRegistryConfigStorageType = "azure"
GCSImageRegistryStorageType ImageRegistryConfigStorageType = "gcs"
S3ImageRegistryStorageType ImageRegistryConfigStorageType = "s3"
...
)
And in the storage struct:
Type ImageRegistryConfigStorageType `json:type`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently we also need to change our logic to use this field. And we should do it backward compatible. Should it be a separate PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dmage: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@dmage: This pull request references an invalid Bugzilla bug:
Comment In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/bugzilla refresh |
@dmage: This pull request references a valid Bugzilla bug. The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/close Replaced by #331 |
@adambkaplan: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
No description provided.