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

Bug 1705752: update crd #319

Closed
wants to merge 5 commits into from
Closed

Bug 1705752: update crd #319

wants to merge 5 commits into from

Conversation

dmage
Copy link
Contributor

@dmage dmage commented Jul 12, 2019

No description provided.

@openshift-ci-robot openshift-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jul 12, 2019
@openshift-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 12, 2019
@dmage
Copy link
Contributor Author

dmage commented Jul 12, 2019

/hold

waiting until GCS is landed

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 12, 2019
@dmage
Copy link
Contributor Author

dmage commented Jul 16, 2019

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 16, 2019
Copy link
Contributor

@adambkaplan adambkaplan left a 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?'
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

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!

Copy link
Contributor

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
Copy link
Contributor

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

Copy link
Contributor Author

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.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 17, 2019
Oleg Bulatov added 5 commits July 17, 2019 16:48
This field should contain only packages that are used in the project
without importing them (for example, in shell scripts).
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 17, 2019
@dmage
Copy link
Contributor Author

dmage commented Jul 18, 2019

/assign @adambkaplan

Copy link
Contributor

@adambkaplan adambkaplan left a 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"`
Copy link
Contributor

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".

Suggested change
Proxy ImageRegistryConfigProxy `json:"proxy"`
Proxy *ImageRegistryConfigProxy `json:"proxy,omitempty"`

Copy link
Contributor Author

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?

Copy link
Contributor Author

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"`
Copy link
Contributor

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.

Suggested change
Requests ImageRegistryConfigRequests `json:"requests"`
Requests *ImageRegistryConfigRequests `json:"requests,omitempty"`

HTTP string `json:"http"`
// +optional
HTTPS string `json:"https"`
// +optional
Copy link
Contributor

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"`
Copy link
Contributor

@adambkaplan adambkaplan Jul 19, 2019

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"`
Copy link
Contributor

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"`
Copy link
Contributor

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"`
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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`

See openshift/api#300

Copy link
Contributor Author

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@openshift-ci-robot
Copy link
Contributor

@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.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 20, 2019
@dmage dmage changed the title Update crd Bug 1705752: update crd Jul 22, 2019
@openshift-ci-robot openshift-ci-robot added the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Jul 22, 2019
@openshift-ci-robot
Copy link
Contributor

@dmage: This pull request references an invalid Bugzilla bug:

  • expected dependent Bugzilla bug to be in one of the following states: VERIFIED, RELEASE_PENDING, CLOSED (ERRATA), but it is ASSIGNED instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 1705752: update crd

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
Copy link
Contributor Author

dmage commented Jul 24, 2019

/bugzilla refresh

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Jul 24, 2019
@openshift-ci-robot
Copy link
Contributor

@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:

/bugzilla refresh

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.

@openshift-ci-robot openshift-ci-robot removed the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Jul 24, 2019
@adambkaplan
Copy link
Contributor

/close

Replaced by #331

@openshift-ci-robot
Copy link
Contributor

@adambkaplan: Closed this PR.

In response to this:

/close

Replaced by #331

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants