Documentation ¶
Index ¶
- Constants
- func CopyEmbeddedFiles(src, dest string) error
- func CreateFeature(name string) *featureBuilder
- func GenerateSelfSignedCertificateAsSecret(addr string, objectMeta metav1.ObjectMeta) (*corev1.Secret, error)
- func ReplaceChar(s string, oldChar, newChar string) string
- type Action
- type DefinedFeatures
- type Feature
- type FeaturesInitializer
- type OAuth
- type Spec
Constants ¶
const (
YamlSeparator = "(?m)^---[ \t]*$"
)
Variables ¶
This section is empty.
Functions ¶
func CopyEmbeddedFiles ¶
CopyEmbeddedFiles ensures that files embedded using go:embed are populated to dest directory. In order to process the templates, we need to create a tmp directory to store the files. This is because embedded files are read only.
func CreateFeature ¶
func CreateFeature(name string) *featureBuilder
func ReplaceChar ¶
Types ¶
type Action ¶
Action is a func type which can be used for different purposes while having access to Feature struct
func CreateNamespace ¶
CreateNamespace will create namespace with the given name if it does not exist yet and sets feature as an owner of it. This way we ensure that when the feature is cleaned up, the namespace will be deleted as well.
func EnsureCRDIsInstalled ¶
func WaitForPodsToBeReady ¶
func WaitForResourceToBeCreated ¶
func WaitForResourceToBeCreated(namespace string, gvr schema.GroupVersionResource) Action
type DefinedFeatures ¶
type DefinedFeatures func(s *FeaturesInitializer) error
type Feature ¶
type Feature struct { Name string Spec *Spec Enabled bool Clientset *kubernetes.Clientset DynamicClient dynamic.Interface Client client.Client // contains filtered or unexported fields }
func (*Feature) CreateConfigMap ¶
func (*Feature) OwnerReference ¶
func (f *Feature) OwnerReference() metav1.OwnerReference
type FeaturesInitializer ¶
type FeaturesInitializer struct { *v1.DSCInitializationSpec Features []*Feature // contains filtered or unexported fields }
func NewFeaturesInitializer ¶
func NewFeaturesInitializer(spec *v1.DSCInitializationSpec, def DefinedFeatures) *FeaturesInitializer
func (*FeaturesInitializer) Apply ¶
func (s *FeaturesInitializer) Apply() error
func (*FeaturesInitializer) Delete ¶
func (s *FeaturesInitializer) Delete() error
Delete executes registered clean-up tasks in the opposite order they were initiated (following a stack structure). For instance, this allows for the undoing patches before its deletion. This approach assumes that Features are either instantiated in the correct sequence or are self-contained.
func (*FeaturesInitializer) Prepare ¶
func (s *FeaturesInitializer) Prepare() error
Prepare performs validation of the spec and ensures all resources, such as Features and their templates, are processed and initialized before proceeding with the actual cluster set-up.