Skip to content

feat: adds nfd #164

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
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
31 changes: 25 additions & 6 deletions api/v1alpha1/clusterconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ type ClusterConfigSpec struct {
ExtraAPIServerCertSANs ExtraAPIServerCertSANs `json:"extraAPIServerCertSANs,omitempty"`

// +optional
CNI *CNI `json:"cni,omitempty"`

// +optional
NFD *NFD `json:"nfd,omitempty"`
Addons *Addons `json:"addons,omitempty"`
}

func (ClusterConfigSpec) VariableSchema() clusterv1.VariableSchema {
Expand All @@ -52,7 +49,7 @@ func (ClusterConfigSpec) VariableSchema() clusterv1.VariableSchema {
Description: "Cluster configuration",
Type: "object",
Properties: map[string]clusterv1.JSONSchemaProps{
"cni": CNI{}.VariableSchema().OpenAPIV3Schema,
"addons": Addons{}.VariableSchema().OpenAPIV3Schema,
"etcd": Etcd{}.VariableSchema().OpenAPIV3Schema,
"extraAPIServerCertSANs": ExtraAPIServerCertSANs{}.VariableSchema().OpenAPIV3Schema,
"proxy": HTTPProxy{}.VariableSchema().OpenAPIV3Schema,
Expand Down Expand Up @@ -189,6 +186,27 @@ func (ExtraAPIServerCertSANs) VariableSchema() clusterv1.VariableSchema {
}
}

type Addons struct {
// +optional
CNI *CNI `json:"cni,omitempty"`

// +optional
NFD *NFD `json:"nfd,omitempty"`
}

func (Addons) VariableSchema() clusterv1.VariableSchema {
return clusterv1.VariableSchema{
OpenAPIV3Schema: clusterv1.JSONSchemaProps{
Description: "Cluster configuration",
Type: "object",
Properties: map[string]clusterv1.JSONSchemaProps{
"cni": CNI{}.VariableSchema().OpenAPIV3Schema,
"nfd": NFD{}.VariableSchema().OpenAPIV3Schema,
},
},
}
}

// CNI required for providing CNI configuration.
type CNI struct {
Provider string `json:"provider,omitempty"`
Expand All @@ -212,6 +230,7 @@ func (CNI) VariableSchema() clusterv1.VariableSchema {
Enum: cniProviderEnumVals,
},
},
Required: []string{"provider"},
},
}
}
Expand All @@ -222,7 +241,7 @@ type NFD struct{}
func (NFD) VariableSchema() clusterv1.VariableSchema {
return clusterv1.VariableSchema{
OpenAPIV3Schema: clusterv1.JSONSchemaProps{
Type: "Object",
Type: "object",
},
}
}
Expand Down
48 changes: 44 additions & 4 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading