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

Remove kubeapiwarning message via crds #2601

Merged
merged 2 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions charts/fleet-crd/templates/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1652,15 +1652,19 @@ spec:
properties:
content:
description: The content of the resource, can be compressed.
nullable: true
type: string
encoding:
description: Encoding is either empty or "base64+gz".
nullable: true
type: string
name:
description: Name of the resource, can include the bundle's
internal path.
nullable: true
type: string
type: object
nullable: true
type: array
rolloutStrategy:
description: 'RolloutStrategy controls the rollout of bundles, by
Expand Down Expand Up @@ -1730,6 +1734,7 @@ spec:
clusterGroupSelector:
description: Selector matching cluster group labels to
include in this partition
nullable: true
properties:
matchExpressions:
description: matchExpressions is a list of label selector
Expand Down Expand Up @@ -1865,6 +1870,7 @@ spec:
name:
description: A user-friendly name given to the partition
used for Display (optional).
nullable: true
type: string
type: object
nullable: true
Expand Down Expand Up @@ -2743,6 +2749,7 @@ spec:
nullable: true
type: string
type: object
nullable: true
type: array
name:
description: Name is the name of the resource.
Expand Down Expand Up @@ -2793,8 +2800,10 @@ spec:
nullable: true
type: string
type: object
nullable: true
type: array
type: object
nullable: true
type: array
notReady:
description: 'NotReady is the number of bundle deployments
Expand Down Expand Up @@ -2866,6 +2875,7 @@ spec:
nullable: true
type: string
type: object
nullable: true
type: array
resourcesSha256Sum:
description: ResourcesSHA256Sum corresponds to the JSON serialization
Expand Down Expand Up @@ -2955,6 +2965,7 @@ spec:
nullable: true
type: string
type: object
nullable: true
type: array
name:
description: Name is the name of the resource.
Expand Down Expand Up @@ -3004,8 +3015,10 @@ spec:
nullable: true
type: string
type: object
nullable: true
type: array
type: object
nullable: true
type: array
notReady:
description: 'NotReady is the number of bundle deployments that
Expand Down Expand Up @@ -3384,6 +3397,7 @@ spec:
nullable: true
type: string
type: object
nullable: true
type: array
name:
description: Name is the name of the resource.
Expand Down Expand Up @@ -3433,8 +3447,10 @@ spec:
nullable: true
type: string
type: object
nullable: true
type: array
type: object
nullable: true
type: array
notReady:
description: 'NotReady is the number of bundle deployments that
Expand Down Expand Up @@ -5282,6 +5298,7 @@ spec:
required:
- name
type: object
nullable: true
type: array
agentNamespace:
description: AgentNamespace defaults to the system namespace, e.g.
Expand Down Expand Up @@ -5414,6 +5431,7 @@ spec:
just a regular string.'
type: string
type: object
nullable: true
type: array
clientID:
description: 'ClientID is a unique string that will identify the
Expand Down Expand Up @@ -5456,7 +5474,9 @@ spec:
templateValues:
description: TemplateValues defines a cluster specific mapping of
values to be sent to fleet.yaml values templating.
nullable: true
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
status:
properties:
Expand Down Expand Up @@ -5621,6 +5641,7 @@ spec:
state:
description: State of the cluster, either one of the bundle
states, or "WaitCheckIn".
nullable: true
type: string
type: object
namespace:
Expand Down Expand Up @@ -5754,6 +5775,7 @@ spec:
nullable: true
type: string
type: object
nullable: true
type: array
name:
description: Name is the name of the resource.
Expand Down Expand Up @@ -5803,8 +5825,10 @@ spec:
nullable: true
type: string
type: object
nullable: true
type: array
type: object
nullable: true
type: array
notReady:
description: 'NotReady is the number of bundle deployments that
Expand Down Expand Up @@ -6536,6 +6560,7 @@ spec:
properties:
apiVersion:
description: APIVersion is the API version of the resource.
nullable: true
type: string
error:
description: Error is true if any Error in the PerClusterState
Expand All @@ -6544,6 +6569,7 @@ spec:
id:
description: ID is the name of the resource, e.g. "namespace1/my-config"
or "backingimagemanagers.storage.io".
nullable: true
type: string
incompleteState:
description: 'IncompleteState is true if a bundle summary
Expand All @@ -6556,15 +6582,19 @@ spec:
type: boolean
kind:
description: Kind is the k8s kind of the resource.
nullable: true
type: string
message:
description: Message is the first message from the PerClusterStates.
nullable: true
type: string
name:
description: Name of the resource.
nullable: true
type: string
namespace:
description: Namespace of the resource.
nullable: true
type: string
perClusterState:
description: PerClusterState is a list of states for each
Expand All @@ -6575,6 +6605,7 @@ spec:
properties:
clusterId:
description: ClusterID is the id of the cluster.
nullable: true
type: string
error:
description: Error is true if the resource is in an
Expand All @@ -6585,12 +6616,16 @@ spec:
description: Message combines the messages from the
bundle's summary. Messages are joined with the delimiter
';'.
nullable: true
type: string
patch:
description: Patch for modified resources.
nullable: true
type: object
x-kubernetes-preserve-unknown-fields: true
state:
description: State is the state of the resource.
nullable: true
type: string
transitioning:
description: 'Transitioning is true if the resource
Expand All @@ -6599,6 +6634,7 @@ spec:
copied from the bundle''s summary for non-ready resources.'
type: boolean
type: object
nullable: true
type: array
state:
description: State is the state of the resource, e.g. "Unknown",
Expand Down Expand Up @@ -6696,6 +6732,7 @@ spec:
nullable: true
type: string
type: object
nullable: true
type: array
name:
description: Name is the name of the resource.
Expand Down Expand Up @@ -6745,8 +6782,10 @@ spec:
nullable: true
type: string
type: object
nullable: true
type: array
type: object
nullable: true
type: array
notReady:
description: 'NotReady is the number of bundle deployments that
Expand Down
1 change: 0 additions & 1 deletion dev/update-agent-k3d
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export GOARCH="${GOARCH:-amd64}"
export CGO_ENABLED=0

# fleet agent
go build -gcflags='all=-N -l' -o "bin/fleet-linux-$GOARCH" ./cmd/fleetcli
go build -gcflags='all=-N -l' -o "bin/fleetagent-linux-$GOARCH" ./cmd/fleetagent
docker build -f package/Dockerfile.agent -t rancher/fleet-agent:dev --build-arg="ARCH=$GOARCH" .

Expand Down
1 change: 1 addition & 0 deletions dev/update-controller-k3d
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export CGO_ENABLED=0

# fleetcontroller
go build -gcflags='all=-N -l' -o bin/fleetcontroller-linux-"$GOARCH" ./cmd/fleetcontroller
go build -gcflags='all=-N -l' -o "bin/fleet-linux-$GOARCH" ./cmd/fleetcli
docker build -f package/Dockerfile -t rancher/fleet:dev --build-arg="ARCH=$GOARCH" .

fleet_ctx=$(kubectl config current-context)
Expand Down
10 changes: 10 additions & 0 deletions pkg/apis/fleet.cattle.io/v1alpha1/bundle_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ type BundleSpec struct {

// Resources contains the resources that were read from the bundle's
// path. This includes the content of downloaded helm charts.
// +nullable
Resources []BundleResource `json:"resources,omitempty"`

// Targets refer to the clusters which will be deployed to.
Expand Down Expand Up @@ -128,10 +129,13 @@ type BundleRef struct {
// BundleResource represents the content of a single resource from the bundle, like a YAML manifest.
type BundleResource struct {
// Name of the resource, can include the bundle's internal path.
// +nullable
Name string `json:"name,omitempty"`
// The content of the resource, can be compressed.
// +nullable
Content string `json:"content,omitempty"`
// Encoding is either empty or "base64+gz".
// +nullable
Encoding string `json:"encoding,omitempty"`
}

Expand Down Expand Up @@ -164,6 +168,7 @@ type RolloutStrategy struct {
// Partition defines a separate rollout strategy for a set of clusters.
type Partition struct {
// A user-friendly name given to the partition used for Display (optional).
// +nullable
Name string `json:"name,omitempty"`
// A number or percentage of clusters that can be unavailable in this
// partition before this partition is treated as done.
Expand All @@ -176,6 +181,7 @@ type Partition struct {
// A cluster group name to include in this partition
ClusterGroup string `json:"clusterGroup,omitempty"`
// Selector matching cluster group labels to include in this partition
// +nullable
ClusterGroupSelector *metav1.LabelSelector `json:"clusterGroupSelector,omitempty"`
}

Expand Down Expand Up @@ -258,6 +264,7 @@ type BundleSummary struct {
DesiredReady int `json:"desiredReady"`
// NonReadyClusters is a list of states, which is filled for a bundle
// that is not ready.
// +nullable
NonReadyResources []NonReadyResource `json:"nonReadyResources,omitempty"`
}

Expand All @@ -275,8 +282,10 @@ type NonReadyResource struct {
// +nullable
Message string `json:"message,omitempty"`
// ModifiedStatus lists the state for each modified resource.
// +nullable
ModifiedStatus []ModifiedStatus `json:"modifiedStatus,omitempty"`
// NonReadyStatus lists the state for each non-ready resource.
// +nullable
NonReadyStatus []NonReadyStatus `json:"nonReadyStatus,omitempty"`
}

Expand Down Expand Up @@ -338,6 +347,7 @@ type BundleStatus struct {
// ResourceKey lists resources, which will likely be deployed. The
// actual list of resources on a cluster might differ, depending on the
// helm chart, value templating, etc..
// +nullable
ResourceKey []ResourceKey `json:"resourceKey,omitempty"`
// OCIReference is the OCI reference used to store contents, this is
// only for informational purposes.
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/fleet.cattle.io/v1alpha1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ type ClusterSpec struct {
RedeployAgentGeneration int64 `json:"redeployAgentGeneration,omitempty"`

// AgentEnvVars are extra environment variables to be added to the agent deployment.
// +nullable
AgentEnvVars []corev1.EnvVar `json:"agentEnvVars,omitempty"`

// AgentNamespace defaults to the system namespace, e.g. cattle-fleet-system.
Expand All @@ -108,9 +109,12 @@ type ClusterSpec struct {
PrivateRepoURL string `json:"privateRepoURL,omitempty"`

// TemplateValues defines a cluster specific mapping of values to be sent to fleet.yaml values templating.
// +nullable
// +kubebuilder:validation:XPreserveUnknownFields
TemplateValues *GenericMap `json:"templateValues,omitempty"`

// AgentTolerations defines an extra set of Tolerations to be added to the Agent deployment.
// +nullable
AgentTolerations []corev1.Toleration `json:"agentTolerations,omitempty"`

// AgentAffinity overrides the default affinity for the cluster's agent
Expand Down Expand Up @@ -209,6 +213,7 @@ type ClusterDisplay struct {
// to be ready.
ReadyBundles string `json:"readyBundles,omitempty"`
// State of the cluster, either one of the bundle states, or "WaitCheckIn".
// +nullable
State string `json:"state,omitempty"`
}

Expand Down
Loading
Loading