Documentation ¶
Index ¶
- func LogAccessOverview(access Access)
- type Access
- type AccessCleaner
- type AccessOverview
- type AppMount
- type Cleaner
- type CodeModule
- type CorrectnessChecker
- type Dynakube
- type FakeFailDB
- func (f *FakeFailDB) CreateAppMount(appMount *AppMount) error
- func (f *FakeFailDB) CreateCodeModule(codeModule *CodeModule) error
- func (f *FakeFailDB) CreateOSMount(osMount *OSMount) error
- func (f *FakeFailDB) CreateTenantConfig(tenantConfig *TenantConfig) error
- func (f *FakeFailDB) DeleteAppMount(appMount *AppMount) error
- func (f *FakeFailDB) DeleteCodeModule(codeModule *CodeModule) error
- func (f *FakeFailDB) DeleteOSMount(osMount *OSMount) error
- func (f *FakeFailDB) DeleteTenantConfig(tenantConfig *TenantConfig, cascade bool) error
- func (f *FakeFailDB) IsCodeModuleOrphaned(codeModule *CodeModule) (bool, error)
- func (f *FakeFailDB) ReadAppMount(appMount AppMount) (*AppMount, error)
- func (f *FakeFailDB) ReadAppMounts() ([]AppMount, error)
- func (f *FakeFailDB) ReadCodeModule(codeModule CodeModule) (*CodeModule, error)
- func (f *FakeFailDB) ReadCodeModules() ([]CodeModule, error)
- func (f *FakeFailDB) ReadOSMount(osMount OSMount) (*OSMount, error)
- func (f *FakeFailDB) ReadOSMounts() ([]OSMount, error)
- func (f *FakeFailDB) ReadTenantConfig(tenantConfig TenantConfig) (*TenantConfig, error)
- func (f *FakeFailDB) ReadTenantConfigs() ([]TenantConfig, error)
- func (f *FakeFailDB) ReadUnscopedOSMount(osMount OSMount) (*OSMount, error)
- func (f *FakeFailDB) ReadVolumeMeta(volumeMeta VolumeMeta) (*VolumeMeta, error)
- func (f *FakeFailDB) ReadVolumeMetas() ([]VolumeMeta, error)
- func (f *FakeFailDB) RestoreOSMount(osMount *OSMount) (*OSMount, error)
- func (f *FakeFailDB) SchemaMigration() error
- func (f *FakeFailDB) UpdateAppMount(appMount *AppMount) error
- func (f *FakeFailDB) UpdateOSMount(osMount *OSMount) error
- func (f *FakeFailDB) UpdateTenantConfig(tenantConfig *TenantConfig) error
- type GormConn
- func (conn *GormConn) CreateAppMount(appMount *AppMount) error
- func (conn *GormConn) CreateCodeModule(codeModule *CodeModule) error
- func (conn *GormConn) CreateOSMount(osMount *OSMount) error
- func (conn *GormConn) CreateTenantConfig(tenantConfig *TenantConfig) error
- func (conn *GormConn) DeleteAppMount(appMount *AppMount) error
- func (conn *GormConn) DeleteCodeModule(codeModule *CodeModule) error
- func (conn *GormConn) DeleteOSMount(osMount *OSMount) error
- func (conn *GormConn) DeleteTenantConfig(tenantConfig *TenantConfig, cascade bool) error
- func (conn *GormConn) InitGormSchema() error
- func (conn *GormConn) IsCodeModuleOrphaned(codeModule *CodeModule) (bool, error)
- func (conn *GormConn) ListDeletedAppMounts() ([]AppMount, error)
- func (conn *GormConn) ListDeletedCodeModules() ([]CodeModule, error)
- func (conn *GormConn) ListDeletedOSMounts() ([]OSMount, error)
- func (conn *GormConn) ListDeletedTenantConfigs() ([]TenantConfig, error)
- func (conn *GormConn) PurgeAppMount(appMount *AppMount) error
- func (conn *GormConn) PurgeCodeModule(codeModule *CodeModule) error
- func (conn *GormConn) PurgeOSMount(osMount *OSMount) error
- func (conn *GormConn) PurgeTenantConfig(tenantConfig *TenantConfig) error
- func (conn *GormConn) ReadAppMount(appMount AppMount) (*AppMount, error)
- func (conn *GormConn) ReadAppMounts() ([]AppMount, error)
- func (conn *GormConn) ReadCodeModule(codeModule CodeModule) (*CodeModule, error)
- func (conn *GormConn) ReadCodeModules() ([]CodeModule, error)
- func (conn *GormConn) ReadOSMount(osMount OSMount) (*OSMount, error)
- func (conn *GormConn) ReadOSMounts() ([]OSMount, error)
- func (conn *GormConn) ReadTenantConfig(tenantConfig TenantConfig) (*TenantConfig, error)
- func (conn *GormConn) ReadTenantConfigs() ([]TenantConfig, error)
- func (conn *GormConn) ReadUnscopedOSMount(osMount OSMount) (*OSMount, error)
- func (conn *GormConn) ReadVolumeMetas() ([]VolumeMeta, error)
- func (conn *GormConn) RestoreOSMount(osMount *OSMount) (*OSMount, error)
- func (conn *GormConn) SchemaMigration() error
- func (conn *GormConn) UpdateAppMount(appMount *AppMount) error
- func (conn *GormConn) UpdateOSMount(osMount *OSMount) error
- func (conn *GormConn) UpdateTenantConfig(tenantConfig *TenantConfig) error
- type OSMount
- type OsAgentVolume
- type PathResolver
- func (pr PathResolver) AgentBinaryDir(tenantUUID string) string
- func (pr PathResolver) AgentBinaryDirForVersion(tenantUUID string, version string) string
- func (pr PathResolver) AgentConfigDir(tenantUUID string, dynakubeName string) string
- func (pr PathResolver) AgentRunDir(tenantUUID string) string
- func (pr PathResolver) AgentRunDirForVolume(tenantUUID string, volumeId string) string
- func (pr PathResolver) AgentSharedBinaryDirBase() string
- func (pr PathResolver) AgentSharedBinaryDirForAgent(versionOrImageURI string) string
- func (pr PathResolver) AgentSharedRuxitAgentProcConf(tenantUUID, dynakubeName string) string
- func (pr PathResolver) AgentTempUnzipDir() string
- func (pr PathResolver) AgentTempUnzipRootDir() string
- func (pr PathResolver) OsAgentDir(tenantUUID string) string
- func (pr PathResolver) OverlayMappedDir(tenantUUID string, volumeId string) string
- func (pr PathResolver) OverlayVarDir(tenantUUID string, volumeId string) string
- func (pr PathResolver) OverlayVarRuxitAgentProcConf(tenantUUID, volumeId string) string
- func (pr PathResolver) OverlayWorkDir(tenantUUID string, volumeId string) string
- func (pr PathResolver) TenantDir(tenantUUID string) string
- type TenantConfig
- type TimeStampedModel
- type Volume
- type VolumeMeta
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogAccessOverview ¶
func LogAccessOverview(access Access)
Types ¶
type Access ¶
type Access interface { SchemaMigration() error ReadTenantConfig(tenantConfig TenantConfig) (*TenantConfig, error) ReadCodeModule(codeModule CodeModule) (*CodeModule, error) ReadOSMount(osMount OSMount) (*OSMount, error) ReadUnscopedOSMount(osMount OSMount) (*OSMount, error) ReadAppMount(appMount AppMount) (*AppMount, error) ReadTenantConfigs() ([]TenantConfig, error) ReadCodeModules() ([]CodeModule, error) ReadOSMounts() ([]OSMount, error) ReadAppMounts() ([]AppMount, error) ReadVolumeMetas() ([]VolumeMeta, error) CreateTenantConfig(tenantConfig *TenantConfig) error CreateCodeModule(codeModule *CodeModule) error CreateOSMount(osMount *OSMount) error CreateAppMount(appMount *AppMount) error UpdateTenantConfig(tenantConfig *TenantConfig) error UpdateOSMount(osMount *OSMount) error UpdateAppMount(appMount *AppMount) error DeleteTenantConfig(tenantConfig *TenantConfig, cascade bool) error DeleteCodeModule(codeModule *CodeModule) error DeleteOSMount(osMount *OSMount) error DeleteAppMount(appMount *AppMount) error IsCodeModuleOrphaned(codeModule *CodeModule) (bool, error) RestoreOSMount(osMount *OSMount) (*OSMount, error) }
type AccessCleaner ¶ added in v1.2.0
TODO: Come up with a less confusing name
type AccessOverview ¶
type AccessOverview struct { VolumeMetas []VolumeMeta `json:"volumeMetas"` AppMounts []AppMount `json:"appMounts"` TenantConfigs []TenantConfig `json:"tenantConfigs"` CodeModules []CodeModule `json:"codeModules"` OSMounts []OSMount `json:"osMounts"` }
func NewAccessOverview ¶
func NewAccessOverview(access Access) (*AccessOverview, error)
type AppMount ¶ added in v1.1.0
type AppMount struct { VolumeMeta VolumeMeta CodeModule CodeModule `gorm:"foreignKey:CodeModuleVersion;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"` TimeStampedModel VolumeMetaID string `gorm:"primaryKey"` CodeModuleVersion string Location string `gorm:"not null"` MountAttempts int64 `gorm:"not null"` }
AppMount keeps track of our mounts to user applications, where we provide the codemodules.
type Cleaner ¶ added in v1.2.0
type Cleaner interface { ListDeletedTenantConfigs() ([]TenantConfig, error) PurgeTenantConfig(tenantConfig *TenantConfig) error ListDeletedCodeModules() ([]CodeModule, error) PurgeCodeModule(codeModule *CodeModule) error ListDeletedAppMounts() ([]AppMount, error) PurgeAppMount(appMount *AppMount) error ListDeletedOSMounts() ([]OSMount, error) PurgeOSMount(osMount *OSMount) error }
type CodeModule ¶ added in v1.1.0
type CodeModule struct { Version string `gorm:"primaryKey"` Location string `gorm:"not null"` TimeStampedModel }
CodeModule holds what codemodules we have downloaded and available.
type CorrectnessChecker ¶
type CorrectnessChecker struct {
// contains filtered or unexported fields
}
func NewCorrectnessChecker ¶
func NewCorrectnessChecker(cl client.Reader, access Access, opts dtcsi.CSIOptions) *CorrectnessChecker
func (*CorrectnessChecker) CorrectCSI ¶
func (checker *CorrectnessChecker) CorrectCSI(ctx context.Context) error
CorrectMetadata checks if the entries in the storage are actually valid Removes not valid entries "Moves" agent bins from deprecated location. (just creates a symlink)
type Dynakube ¶
type Dynakube struct { Name string `json:"name"` TenantUUID string `json:"tenantUUID"` LatestVersion string `json:"latestVersion"` ImageDigest string `json:"imageDigest"` MaxFailedMountAttempts int `json:"maxFailedMountAttempts"` }
Dynakube stores the necessary info from the Dynakube that is needed to be used during volume mount/unmount.
type FakeFailDB ¶
type FakeFailDB struct{}
func (*FakeFailDB) CreateAppMount ¶ added in v1.2.0
func (f *FakeFailDB) CreateAppMount(appMount *AppMount) error
func (*FakeFailDB) CreateCodeModule ¶ added in v1.2.0
func (f *FakeFailDB) CreateCodeModule(codeModule *CodeModule) error
func (*FakeFailDB) CreateOSMount ¶ added in v1.2.0
func (f *FakeFailDB) CreateOSMount(osMount *OSMount) error
func (*FakeFailDB) CreateTenantConfig ¶ added in v1.2.0
func (f *FakeFailDB) CreateTenantConfig(tenantConfig *TenantConfig) error
func (*FakeFailDB) DeleteAppMount ¶ added in v1.2.0
func (f *FakeFailDB) DeleteAppMount(appMount *AppMount) error
func (*FakeFailDB) DeleteCodeModule ¶ added in v1.2.0
func (f *FakeFailDB) DeleteCodeModule(codeModule *CodeModule) error
func (*FakeFailDB) DeleteOSMount ¶ added in v1.2.0
func (f *FakeFailDB) DeleteOSMount(osMount *OSMount) error
func (*FakeFailDB) DeleteTenantConfig ¶ added in v1.2.0
func (f *FakeFailDB) DeleteTenantConfig(tenantConfig *TenantConfig, cascade bool) error
func (*FakeFailDB) IsCodeModuleOrphaned ¶ added in v1.2.0
func (f *FakeFailDB) IsCodeModuleOrphaned(codeModule *CodeModule) (bool, error)
func (*FakeFailDB) ReadAppMount ¶ added in v1.2.0
func (f *FakeFailDB) ReadAppMount(appMount AppMount) (*AppMount, error)
func (*FakeFailDB) ReadAppMounts ¶ added in v1.2.0
func (f *FakeFailDB) ReadAppMounts() ([]AppMount, error)
func (*FakeFailDB) ReadCodeModule ¶ added in v1.2.0
func (f *FakeFailDB) ReadCodeModule(codeModule CodeModule) (*CodeModule, error)
func (*FakeFailDB) ReadCodeModules ¶ added in v1.2.0
func (f *FakeFailDB) ReadCodeModules() ([]CodeModule, error)
func (*FakeFailDB) ReadOSMount ¶ added in v1.2.0
func (f *FakeFailDB) ReadOSMount(osMount OSMount) (*OSMount, error)
func (*FakeFailDB) ReadOSMounts ¶ added in v1.2.0
func (f *FakeFailDB) ReadOSMounts() ([]OSMount, error)
func (*FakeFailDB) ReadTenantConfig ¶ added in v1.2.0
func (f *FakeFailDB) ReadTenantConfig(tenantConfig TenantConfig) (*TenantConfig, error)
func (*FakeFailDB) ReadTenantConfigs ¶ added in v1.2.0
func (f *FakeFailDB) ReadTenantConfigs() ([]TenantConfig, error)
func (*FakeFailDB) ReadUnscopedOSMount ¶ added in v1.2.0
func (f *FakeFailDB) ReadUnscopedOSMount(osMount OSMount) (*OSMount, error)
func (*FakeFailDB) ReadVolumeMeta ¶ added in v1.2.0
func (f *FakeFailDB) ReadVolumeMeta(volumeMeta VolumeMeta) (*VolumeMeta, error)
func (*FakeFailDB) ReadVolumeMetas ¶ added in v1.2.0
func (f *FakeFailDB) ReadVolumeMetas() ([]VolumeMeta, error)
func (*FakeFailDB) RestoreOSMount ¶ added in v1.2.0
func (f *FakeFailDB) RestoreOSMount(osMount *OSMount) (*OSMount, error)
func (*FakeFailDB) SchemaMigration ¶ added in v1.2.0
func (f *FakeFailDB) SchemaMigration() error
func (*FakeFailDB) UpdateAppMount ¶ added in v1.2.0
func (f *FakeFailDB) UpdateAppMount(appMount *AppMount) error
func (*FakeFailDB) UpdateOSMount ¶ added in v1.2.0
func (f *FakeFailDB) UpdateOSMount(osMount *OSMount) error
func (*FakeFailDB) UpdateTenantConfig ¶ added in v1.2.0
func (f *FakeFailDB) UpdateTenantConfig(tenantConfig *TenantConfig) error
type GormConn ¶ added in v1.2.0
type GormConn struct {
// contains filtered or unexported fields
}
func FakeMemoryDB ¶
func FakeMemoryDB() *GormConn
func (*GormConn) CreateAppMount ¶ added in v1.2.0
func (*GormConn) CreateCodeModule ¶ added in v1.2.0
func (conn *GormConn) CreateCodeModule(codeModule *CodeModule) error
func (*GormConn) CreateOSMount ¶ added in v1.2.0
func (*GormConn) CreateTenantConfig ¶ added in v1.2.0
func (conn *GormConn) CreateTenantConfig(tenantConfig *TenantConfig) error
func (*GormConn) DeleteAppMount ¶ added in v1.2.0
func (*GormConn) DeleteCodeModule ¶ added in v1.2.0
func (conn *GormConn) DeleteCodeModule(codeModule *CodeModule) error
func (*GormConn) DeleteOSMount ¶ added in v1.2.0
func (*GormConn) DeleteTenantConfig ¶ added in v1.2.0
func (conn *GormConn) DeleteTenantConfig(tenantConfig *TenantConfig, cascade bool) error
func (*GormConn) InitGormSchema ¶ added in v1.2.0
func (*GormConn) IsCodeModuleOrphaned ¶ added in v1.2.0
func (conn *GormConn) IsCodeModuleOrphaned(codeModule *CodeModule) (bool, error)
func (*GormConn) ListDeletedAppMounts ¶ added in v1.2.0
func (*GormConn) ListDeletedCodeModules ¶ added in v1.2.0
func (conn *GormConn) ListDeletedCodeModules() ([]CodeModule, error)
func (*GormConn) ListDeletedOSMounts ¶ added in v1.2.0
func (*GormConn) ListDeletedTenantConfigs ¶ added in v1.2.0
func (conn *GormConn) ListDeletedTenantConfigs() ([]TenantConfig, error)
func (*GormConn) PurgeAppMount ¶ added in v1.2.0
func (*GormConn) PurgeCodeModule ¶ added in v1.2.0
func (conn *GormConn) PurgeCodeModule(codeModule *CodeModule) error
func (*GormConn) PurgeOSMount ¶ added in v1.2.0
func (*GormConn) PurgeTenantConfig ¶ added in v1.2.0
func (conn *GormConn) PurgeTenantConfig(tenantConfig *TenantConfig) error
func (*GormConn) ReadAppMount ¶ added in v1.2.0
func (*GormConn) ReadAppMounts ¶ added in v1.2.0
func (*GormConn) ReadCodeModule ¶ added in v1.2.0
func (conn *GormConn) ReadCodeModule(codeModule CodeModule) (*CodeModule, error)
func (*GormConn) ReadCodeModules ¶ added in v1.2.0
func (conn *GormConn) ReadCodeModules() ([]CodeModule, error)
func (*GormConn) ReadOSMount ¶ added in v1.2.0
func (*GormConn) ReadOSMounts ¶ added in v1.2.0
func (*GormConn) ReadTenantConfig ¶ added in v1.2.0
func (conn *GormConn) ReadTenantConfig(tenantConfig TenantConfig) (*TenantConfig, error)
func (*GormConn) ReadTenantConfigs ¶ added in v1.2.0
func (conn *GormConn) ReadTenantConfigs() ([]TenantConfig, error)
func (*GormConn) ReadUnscopedOSMount ¶ added in v1.2.0
func (*GormConn) ReadVolumeMetas ¶ added in v1.2.0
func (conn *GormConn) ReadVolumeMetas() ([]VolumeMeta, error)
func (*GormConn) RestoreOSMount ¶ added in v1.2.0
func (*GormConn) SchemaMigration ¶ added in v1.2.0
SchemaMigration runs gormigrate migrations to create tables
func (*GormConn) UpdateAppMount ¶ added in v1.2.0
func (*GormConn) UpdateOSMount ¶ added in v1.2.0
func (*GormConn) UpdateTenantConfig ¶ added in v1.2.0
func (conn *GormConn) UpdateTenantConfig(tenantConfig *TenantConfig) error
type OSMount ¶ added in v1.1.0
type OSMount struct { VolumeMeta VolumeMeta `gorm:"foreignKey:VolumeMetaID"` TimeStampedModel TenantConfigUID string TenantUUID string `gorm:"primaryKey"` VolumeMetaID string `gorm:"not null"` Location string `gorm:"not null"` TenantConfig TenantConfig `gorm:"foreignKey:TenantConfigUID"` MountAttempts int64 `gorm:"not null"` }
OSMount keeps track of our mounts to OS oneAgents, can be "remounted", which causes annoyances.
type OsAgentVolume ¶
type PathResolver ¶
type PathResolver struct {
RootDir string
}
func (PathResolver) AgentBinaryDir ¶
func (pr PathResolver) AgentBinaryDir(tenantUUID string) string
func (PathResolver) AgentBinaryDirForVersion ¶
func (pr PathResolver) AgentBinaryDirForVersion(tenantUUID string, version string) string
Deprecated
func (PathResolver) AgentConfigDir ¶
func (pr PathResolver) AgentConfigDir(tenantUUID string, dynakubeName string) string
func (PathResolver) AgentRunDir ¶
func (pr PathResolver) AgentRunDir(tenantUUID string) string
func (PathResolver) AgentRunDirForVolume ¶
func (pr PathResolver) AgentRunDirForVolume(tenantUUID string, volumeId string) string
func (PathResolver) AgentSharedBinaryDirBase ¶
func (pr PathResolver) AgentSharedBinaryDirBase() string
func (PathResolver) AgentSharedBinaryDirForAgent ¶
func (pr PathResolver) AgentSharedBinaryDirForAgent(versionOrImageURI string) string
func (PathResolver) AgentSharedRuxitAgentProcConf ¶ added in v1.0.0
func (pr PathResolver) AgentSharedRuxitAgentProcConf(tenantUUID, dynakubeName string) string
func (PathResolver) AgentTempUnzipDir ¶
func (pr PathResolver) AgentTempUnzipDir() string
func (PathResolver) AgentTempUnzipRootDir ¶
func (pr PathResolver) AgentTempUnzipRootDir() string
func (PathResolver) OsAgentDir ¶
func (pr PathResolver) OsAgentDir(tenantUUID string) string
func (PathResolver) OverlayMappedDir ¶
func (pr PathResolver) OverlayMappedDir(tenantUUID string, volumeId string) string
func (PathResolver) OverlayVarDir ¶
func (pr PathResolver) OverlayVarDir(tenantUUID string, volumeId string) string
func (PathResolver) OverlayVarRuxitAgentProcConf ¶ added in v1.0.0
func (pr PathResolver) OverlayVarRuxitAgentProcConf(tenantUUID, volumeId string) string
func (PathResolver) OverlayWorkDir ¶
func (pr PathResolver) OverlayWorkDir(tenantUUID string, volumeId string) string
func (PathResolver) TenantDir ¶
func (pr PathResolver) TenantDir(tenantUUID string) string
type TenantConfig ¶ added in v1.1.0
type TenantConfig struct { TimeStampedModel UID string `gorm:"primaryKey"` // auto generated UID Name string `gorm:"not null"` DownloadedCodeModuleVersion string // can't be foreign key because of HostMonitoring edge case ConfigDirPath string `gorm:"not null"` TenantUUID string `gorm:"not null"` MaxFailedMountAttempts int64 `gorm:"default:10"` }
TenantConfig holds info about a given configuration for a tenant.
func (*TenantConfig) BeforeCreate ¶ added in v1.1.0
func (tc *TenantConfig) BeforeCreate(_ *gorm.DB) error
type TimeStampedModel ¶ added in v1.1.0
type VolumeMeta ¶ added in v1.1.0
type VolumeMeta struct { ID string `gorm:"primaryKey"` PodUid string `gorm:"not null"` PodName string `gorm:"not null"` PodNamespace string `gorm:"not null"` PodServiceAccount string `gorm:"not null"` TimeStampedModel }
VolumeMeta keeps metadata we get from kubernetes about the volume.