Skip to content
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

[feature]: Provide an option to skip the kubeops CLI during build #699

Open
robertcoltheart opened this issue Jan 17, 2024 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@robertcoltheart
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Previously you could use the KubeOpsSkipOperator project properties to control if the CLI runs or not

Describe the solution you would like

Ideally a project property that can disable the CLI during build

Additional Context

No response

@robertcoltheart robertcoltheart added the enhancement New feature or request label Jan 17, 2024
@buehler
Copy link
Owner

buehler commented Jan 18, 2024

Hey @robertcoltheart
Thanks for the issue, this was removed in the big refactoring for V8.

However as a workaround, you can just not install the CLI tool, then the cli will not run.
Or you could overwrite the "KubeOpsCli" prop to something that does not exist.

In the build targets file:

<Target Name="GenerateKustomizationConfig" DependsOnTargets="BaseConfig">
        <Message Text="Generating Kustomization Configuration" Importance="high" />
        <Message Text="Configuration path: $(KubeOpsConfigOut)" Importance="normal" />
        <Exec Command="$(KubeOpsCli) generate operator --out $(KubeOpsConfigOut) $(OperatorName) $(MSBuildProjectFullPath)" />
    </Target>

    <Target Name="GenerateOperatorResources"
            AfterTargets="CopyFilesToOutputDirectory"
            DependsOnTargets="BaseConfig"
            Condition="'$(OutputType.ToLowerInvariant())' == 'exe' And ('$(KubeOpsAssemblyTimestampBeforeCompile)' != '$(KubeOpsAssemblyTimestampAfterCompile)' Or '$(Configuration)' == 'Release')">
        <Exec IgnoreExitCode="true" StandardOutputImportance="low" StandardErrorImportance="low"
              Command="$(KubeOpsCli) -h">
            <Output TaskParameter="ExitCode" PropertyName="CliInstalled" />
        </Exec>
        <Message Importance="high" Condition="$(CliInstalled) == 1"
                 Text="KubeOps CLI is not installed as tool, cannot generate stuff for projects. Please install it with 'dotnet tool install KubeOps.Cli' to use automatic build generation." />
        <CallTarget ContinueOnError="true"
                    Targets="GenerateKustomizationConfig"
                    Condition="$(CliInstalled) == 0" />
    </Target>

@robertcoltheart
Copy link
Contributor Author

Yeah, i've removed the tool for now, and that seems to solve the issue. There is a bit of a pause during the build while it tries to find the CLI, but its acceptable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants