-
Notifications
You must be signed in to change notification settings - Fork 42.8k
EncryptionConfig: use standard method for parsing config file #61599
Copy link
Copy link
Closed
Labels
kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.sig/authCategorizes an issue or PR as relevant to SIG Auth.Categorizes an issue or PR as relevant to SIG Auth.
Milestone
Description
Is this a BUG REPORT or FEATURE REQUEST?:
/kind feature
/sig auth
What happened:
Currently encryption config parsing uses a non-standard parsing method that pays no attention to the version of the config:
kubernetes/staging/src/k8s.io/apiserver/pkg/server/options/encryptionconfig/config.go
Lines 67 to 79 in dce1b88
| var config EncryptionConfig | |
| err = yaml.Unmarshal(configFileContents, &config) | |
| if err != nil { | |
| return nil, fmt.Errorf("error while parsing file: %v", err) | |
| } | |
| if config.Kind == "" { | |
| return nil, fmt.Errorf("invalid configuration file, missing Kind") | |
| } | |
| if config.Kind != "EncryptionConfig" { | |
| return nil, fmt.Errorf("invalid configuration kind %q provided", config.Kind) | |
| } | |
| // TODO config.APIVersion is unchecked |
What you expected to happen:
- the types must change to use standard methods for including kind/apiVersion (inlining metav1.TypeMeta like all other objects)
- define a versioned config (we can promote straight to v1beta1 if we don't require any structural changes)
- parsing must require well-formed config files
Anything else we need to know?:
Requested by @liggitt and extracted from #61592 (comment)
Steps to be done:
- fix type definition to actually be a runtime object, inline TypeMeta, etc
- define v1beta1 API types, generate conversions/defaults
- define scheme/codecs that have the external (v1beta1) and internal (existing) types registered
- use that scheme/codec to load the config (handles decoding the v1beta1 version, conversion to internal version)
CC @marrrvin
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.sig/authCategorizes an issue or PR as relevant to SIG Auth.Categorizes an issue or PR as relevant to SIG Auth.