| 1 |
// Copyright 2021 The Kubernetes Authors. |
| 2 |
// SPDX-License-Identifier: Apache-2.0 |
| 3 |
|
| 4 |
package types |
| 5 |
|
| 6 |
// SortOptions defines the order that kustomize outputs resources. |
| 7 |
type SortOptions struct { |
| 8 |
// Order selects the ordering strategy. |
| 9 |
Order SortOrder `json:"order,omitempty" yaml:"order,omitempty"` |
| 10 |
// LegacySortOptions tweaks the sorting for the "legacy" sort ordering |
| 11 |
// strategy. |
| 12 |
LegacySortOptions *LegacySortOptions `json:"legacySortOptions,omitempty" yaml:"legacySortOptions,omitempty"` |
| 13 |
} |
| 14 |
|
| 15 |
// SortOrder defines different ordering strategies. |
| 16 |
type SortOrder string |
| 17 |
|
| 18 |
const LegacySortOrder SortOrder = "legacy" |
| 19 |
const FIFOSortOrder SortOrder = "fifo" |
| 20 |
|
| 21 |
// LegacySortOptions define various options for tweaking the "legacy" ordering |
| 22 |
// strategy. |
| 23 |
type LegacySortOptions struct { |
| 24 |
// OrderFirst selects the resource kinds to order first. |
| 25 |
OrderFirst []string `json:"orderFirst" yaml:"orderFirst"` |
| 26 |
// OrderLast selects the resource kinds to order last. |
| 27 |
OrderLast []string `json:"orderLast" yaml:"orderLast"` |
| 28 |
} |