Skip to content

Implement fs writer #57

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

Merged
merged 5 commits into from
Jun 27, 2018
Merged

Conversation

mengqiy
Copy link
Member

@mengqiy mengqiy commented Jun 22, 2018

As in the commit message, the 1st commit is porting an util pkg from k/k.

@mengqiy mengqiy requested review from droot and pwittrock June 22, 2018 18:53
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jun 22, 2018
Copy link
Contributor

@droot droot left a comment

Choose a reason for hiding this comment

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

Took a quick looks, good overall, a few comments.

limitations under the License.
*/

package atomic
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this pkg copied from somewhere ? Was wondering if I can skip reviewing this ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it's from k8s.io/kubernetes/pkg/volume/util.
I wrote that in the 1st commit message.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, sorry I missed that.

Mode: 0666,
},
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't see test for this ?

return map[string]atomic.FileProjection{
CACertName: {
Data: cert.CACert,
Mode: 0666,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious about this mode. Does it really need to be open to everyone?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a TODO.
Let's figure it out later :)

return f.doWrite(webhookName)
}

func (f *fsCertWriter) overwrite(webhookName string) (*certgenerator.Artifacts, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

overwrite is the same as write. Can we remove it?

Copy link
Member Author

Choose a reason for hiding this comment

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

@mengqiy
Copy link
Member Author

mengqiy commented Jun 25, 2018

PTAL

test.sh Outdated
@@ -137,7 +137,23 @@ gometalinter.v2 --disable-all \
--enable=lll \
--dupl-threshold=400 \
--enable=dupl \
./pkg/...
./pkg/admission/ \
Copy link
Contributor

@Liujingfang1 Liujingfang1 Jun 26, 2018

Choose a reason for hiding this comment

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

Is there any -exclude flag so that you don't need to list all other directories?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, found the skip flag.
Updated.

vwc = &admissionregistration.ValidatingWebhookConfiguration{
TypeMeta: metav1.TypeMeta{
APIVersion: "admissionregistration.k8s.io/v1beta1",
Kind: "MutatingWebhookConfiguration",
Copy link
Contributor

Choose a reason for hiding this comment

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

vwc is declared to be validating web hook configuration, but the Kind filed is mutating webhook configuration.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch!

Copy link
Contributor

@droot droot left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 26, 2018
Copy link
Contributor

@Liujingfang1 Liujingfang1 left a comment

Choose a reason for hiding this comment

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

LGTM

@mengqiy mengqiy added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 27, 2018
@k8s-ci-robot k8s-ci-robot merged commit f63e6b3 into kubernetes-sigs:master Jun 27, 2018
@mengqiy mengqiy deleted the fs_writer branch June 28, 2018 16:34
justinsb pushed a commit to justinsb/controller-runtime that referenced this pull request Dec 7, 2018
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

4 participants