-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Upgrade kubernetes dependencies to 1.15.3 #1808
Conversation
Signed-off-by: Adnan Abdulhussein <[email protected]>
// name needs Type and Format defined for the decorator to identify it: | ||
// https://github.com/kubernetes/kubernetes/blob/v1.15.3/pkg/printers/tableprinter.go#L204 | ||
{Name: "Name", Type: "string", Format: "name"}, | ||
{Name: "Status"}, |
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.
I've decided to omit the type/format/description for all the other columns, I can't seem to find where they are used and we didn't have them before.
backupColumns = []metav1.TableColumnDefinition{ | ||
// name needs Type and Format defined for the decorator to identify it: | ||
// https://github.com/kubernetes/kubernetes/blob/v1.15.3/pkg/printers/tableprinter.go#L204 | ||
{Name: "Name", Type: "string", Format: "name"}, |
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.
FYI I'm using capitalisation for the Name field as this is what upstream is doing for core resources: https://github.com/kubernetes/kubernetes/blob/d2e2337744072553ae7756ba972607ffb6532a85/pkg/printers/internalversion/printers.go#L80
Signed-off-by: Adnan Abdulhussein <[email protected]>
2039a27
to
ad2e162
Compare
Will look into why the code generator in the build container is failing tomorrow, let me know if you have any pointers for that (looks like we might just need to pull some new dependencies, but not sure why they wouldn't just be pulled from vendor?) |
I googled a bit and found this: kubernetes-sigs/kubebuilder#359 - however, I see that we already export |
Looks like the |
We're gonna have to turn on go mod sooner or later? 🤷♂ |
Yeah, we will. I'd personally prefer to wait if we can, as go modules still don't seem fully ready. Especially if you look at surrounding tooling around them, like gopls. |
Yeah, we don't need to migrate to modules for velero just for this. By "turn it on" I meant turning on module support within GOPATH in the builder container for the purposes of installing/running the code generator. |
Adding
Looks like we're running the container as a different user when running I'm also trying to see if we can download the modules in the Dockerfile when building the image, as this will then get cached and we can avoid having to download all the modules everytime we run the code-generator. |
Signed-off-by: Adnan Abdulhussein <[email protected]>
Signed-off-by: Adnan Abdulhussein <[email protected]>
Okay seems like the suggested way to do this is to use |
CI is now green, PTAL :)! |
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.
Mostly looks good - just one question on the printers
return err | ||
} | ||
|
||
if _, err := fmt.Fprint(w, printers.AppendLabels(backup.Labels, options.ColumnLabels)); err != nil { |
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.
I don't see where L110-115 are getting carried over - is this handled for us, or do we need to retain some custom code? Same question for the other printers as well.
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 to support the --show-labels
and --label-columns
flags.
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.
Sorry, should have made that more clear. It's now handled for us in https://github.com/kubernetes/kubernetes/blob/v1.15.3/pkg/printers/tableprinter.go#L190, see the logic around options.ShowLabels
and options.ColumnLabels
which we set when we initialise the printer: https://github.com/heptio/velero/blob/772459a8b40fd3d26e98397e27302d235b4d1584/pkg/cmd/util/output/output.go#L174-L177.
I've also manually tested each command and variations of show-labels/label-columns to ensure it matches the output from before.
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.
OK, awesome! I figured you were on top of this, just didn't see it myself :)
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.
Yeah it took me a while to figure out too, it was pretty hidden there. Overall I think the improvements to the printer package are really great, it's so much simpler to use now :)
@@ -172,15 +172,11 @@ func printTable(cmd *cobra.Command, obj runtime.Object) (bool, error) { | |||
// Velero objects. | |||
func NewPrinter(cmd *cobra.Command) (*printers.HumanReadablePrinter, error) { | |||
options := printers.PrintOptions{ | |||
NoHeaders: flag.GetOptionalBoolFlag(cmd, "no-headers"), |
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.
@skriss FYI I removed this because I couldn't see that flag defined anywhere, let me know if I'm missing something
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.
seems fine, I'm not aware of any support for this
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.
LGTM
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.
👍
* upstream/master: (118 commits) restore: rename PV when remapping a namespace if PV exists in-cluster (vmware-tanzu#1779) when backing up PVCs with restic, explicitly specify --parent (vmware-tanzu#1807) Unit tests for restic restore (vmware-tanzu#1747) Upgrade kubernetes dependencies to 1.15.3 (vmware-tanzu#1808) create backups from schedules using velero create backup (vmware-tanzu#1734) remove calls to restic check before/after prune (vmware-tanzu#1794) Propose adding feature flags to velero restic backup and restore progress proposal (vmware-tanzu#1765) allow custom restic repo prefix to be specified in BSL config error if restic repo identifier can't be determined update nokogiri dep for website update links on website home page for latest release (vmware-tanzu#1789) Velero 1.1 blog post v1.1.0 changelog fix error formatting Revert "allow self signed certs with insecureSkipVerify (vmware-tanzu#1769)" allow self signed certs with insecureSkipVerify (vmware-tanzu#1769) v1.1.0 docs Add the prefix to BSL config map so that object stores can use it when initializing (vmware-tanzu#1767) add stable/velero to helm commands ...
* upstream/master: (118 commits) restore: rename PV when remapping a namespace if PV exists in-cluster (vmware-tanzu#1779) when backing up PVCs with restic, explicitly specify --parent (vmware-tanzu#1807) Unit tests for restic restore (vmware-tanzu#1747) Upgrade kubernetes dependencies to 1.15.3 (vmware-tanzu#1808) create backups from schedules using velero create backup (vmware-tanzu#1734) remove calls to restic check before/after prune (vmware-tanzu#1794) Propose adding feature flags to velero restic backup and restore progress proposal (vmware-tanzu#1765) allow custom restic repo prefix to be specified in BSL config error if restic repo identifier can't be determined update nokogiri dep for website update links on website home page for latest release (vmware-tanzu#1789) Velero 1.1 blog post v1.1.0 changelog fix error formatting Revert "allow self signed certs with insecureSkipVerify (vmware-tanzu#1769)" allow self signed certs with insecureSkipVerify (vmware-tanzu#1769) v1.1.0 docs Add the prefix to BSL config map so that object stores can use it when initializing (vmware-tanzu#1767) add stable/velero to helm commands ...
* upstream/master: (118 commits) restore: rename PV when remapping a namespace if PV exists in-cluster (vmware-tanzu#1779) when backing up PVCs with restic, explicitly specify --parent (vmware-tanzu#1807) Unit tests for restic restore (vmware-tanzu#1747) Upgrade kubernetes dependencies to 1.15.3 (vmware-tanzu#1808) create backups from schedules using velero create backup (vmware-tanzu#1734) remove calls to restic check before/after prune (vmware-tanzu#1794) Propose adding feature flags to velero restic backup and restore progress proposal (vmware-tanzu#1765) allow custom restic repo prefix to be specified in BSL config error if restic repo identifier can't be determined update nokogiri dep for website update links on website home page for latest release (vmware-tanzu#1789) Velero 1.1 blog post v1.1.0 changelog fix error formatting Revert "allow self signed certs with insecureSkipVerify (vmware-tanzu#1769)" allow self signed certs with insecureSkipVerify (vmware-tanzu#1769) v1.1.0 docs Add the prefix to BSL config map so that object stores can use it when initializing (vmware-tanzu#1767) add stable/velero to helm commands ...
* jesse/20190828_merge: (511 commits) fix(ci): Update arm32 target. feat(ci): Auto-build restic-restore-helper image in CI. restore: rename PV when remapping a namespace if PV exists in-cluster (vmware-tanzu#1779) when backing up PVCs with restic, explicitly specify --parent (vmware-tanzu#1807) Unit tests for restic restore (vmware-tanzu#1747) Upgrade kubernetes dependencies to 1.15.3 (vmware-tanzu#1808) create backups from schedules using velero create backup (vmware-tanzu#1734) remove calls to restic check before/after prune (vmware-tanzu#1794) Propose adding feature flags to velero restic backup and restore progress proposal (vmware-tanzu#1765) allow custom restic repo prefix to be specified in BSL config error if restic repo identifier can't be determined update nokogiri dep for website update links on website home page for latest release (vmware-tanzu#1789) Velero 1.1 blog post v1.1.0 changelog fix error formatting Revert "allow self signed certs with insecureSkipVerify (vmware-tanzu#1769)" allow self signed certs with insecureSkipVerify (vmware-tanzu#1769) v1.1.0 docs ...
closes #1795
Split into two commits to make this easier to review. The first updates the dependency versions in Gopkg and the Dockerfile. The second commit updates Velero's printer logic to work with the upstream changes to the printer package.