diff --git a/apis/project.cattle.io/v3/schema/schema.go b/apis/project.cattle.io/v3/schema/schema.go index e36eec7d..e1b3c8df 100644 --- a/apis/project.cattle.io/v3/schema/schema.go +++ b/apis/project.cattle.io/v3/schema/schema.go @@ -68,7 +68,7 @@ func NamespaceTypes(version *types.APIVersion, schemas *types.Schemas) *types.Sc ). MustImport(version, v1.Namespace{}, struct { Description string `json:"description"` - ProjectID string `norman:"type=reference[/v3/schemas/project]"` + ProjectID string `norman:"type=reference[/v3/schemas/project],required"` Templates map[string]string `json:"templates"` Answers map[string]interface{} `json:"answers"` Prune bool `json:"prune"` diff --git a/apis/project.cattle.io/v3/schema/schema_secrets.go b/apis/project.cattle.io/v3/schema/schema_secrets.go index f92fbbc7..ee5089c7 100644 --- a/apis/project.cattle.io/v3/schema/schema_secrets.go +++ b/apis/project.cattle.io/v3/schema/schema_secrets.go @@ -246,6 +246,7 @@ func addSecretSubtypes(schemas *types.Schemas, objs ...interface{}) *types.Schem for _, name := range namespaced { baseSchema := schemas.Schema(&Version, name) + // Make non-namespaced have namespaceId not required newFields := map[string]types.Field{} for name, field := range baseSchema.ResourceFields { if name == "namespaceId" { @@ -259,6 +260,7 @@ func addSecretSubtypes(schemas *types.Schemas, objs ...interface{}) *types.Schem schema.PluralName = "namespaced" + convert.Capitalize(schema.PluralName) schema.CodeName = "Namespaced" + schema.CodeName schema.CodeNamePlural = "Namespaced" + schema.CodeNamePlural + schema.BaseType = "namespacedSecret" schemas.AddSchema(schema) baseSchema.ResourceFields = newFields