Navigation Menu

Skip to content

Commit

Permalink
clean up help and rename config options
Browse files Browse the repository at this point in the history
Signed-off-by: Swathi Gangisetty <swathi@anchore.com>
  • Loading branch information
Swathi Gangisetty committed May 22, 2019
1 parent 7f18d7e commit ce3f61a
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 35 deletions.
Expand Up @@ -75,8 +75,8 @@ public class AnchoreBuilder extends Builder implements SimpleBuildStep {
private List<AnchoreQuery> inputQueries;
private String policyBundleId = DescriptorImpl.DEFAULT_POLICY_BUNDLE_ID;
private List<Annotation> annotations;
private boolean autoSubscribeTag = DescriptorImpl.DEFAULT_TAG_AUTOSUBSCRIBE;
private boolean force = DescriptorImpl.DEFAULT_USE_FORCE_FLAG;
private boolean autoSubscribeTagUpdates = DescriptorImpl.DEFAULT_AUTOSUBSCRIBE_TAG_UPDATES;
private boolean forceAnalyze = DescriptorImpl.DEFAULT_FORCE_ANALYZE;

// Override global config. Supported for anchore-engine mode config only
private String engineurl = DescriptorImpl.EMPTY_STRING;
Expand Down Expand Up @@ -154,12 +154,12 @@ public List<Annotation> getAnnotations() {
return annotations;
}

public boolean getAutoSubscribeTag() {
return autoSubscribeTag;
public boolean getAutoSubscribeTagUpdates() {
return autoSubscribeTagUpdates;
}

public boolean getForce() {
return force;
public boolean getForceAnalyze() {
return forceAnalyze;
}

public String getEngineurl() {
Expand Down Expand Up @@ -256,13 +256,13 @@ public void setAnnotations(List<Annotation> annotations) {
}

@DataBoundSetter
public void setAutoSubscribeTag(boolean autoSubscribeTag) {
this.autoSubscribeTag = autoSubscribeTag;
public void setAutoSubscribeTagUpdates(boolean autoSubscribeTagUpdates) {
this.autoSubscribeTagUpdates = autoSubscribeTagUpdates;
}

@DataBoundSetter
public void setForce(boolean force) {
this.force = force;
public void setForceAnalyze(boolean forceAnalyze) {
this.forceAnalyze = forceAnalyze;
}

@DataBoundSetter
Expand Down Expand Up @@ -331,7 +331,7 @@ public void perform(@Nonnull Run<?, ?> run, @Nonnull FilePath workspace, @Nonnul
/* Instantiate config and a new build worker */
config = new BuildConfig(name, policyName, globalWhiteList, anchoreioUser, anchoreioPass, userScripts, engineRetries, bailOnFail,
bailOnWarn, bailOnPluginFail, doCleanup, useCachedBundle, policyEvalMethod, bundleFileOverride, inputQueries, policyBundleId,
annotations, autoSubscribeTag, force, globalConfig.getDebug(), globalConfig.getEnginemode(),
annotations, autoSubscribeTagUpdates, forceAnalyze, globalConfig.getDebug(), globalConfig.getEnginemode(),
// messy build time overrides, ugh!
!Strings.isNullOrEmpty(engineurl) ? engineurl : globalConfig.getEngineurl(),
!Strings.isNullOrEmpty(engineuser) ? engineuser : globalConfig.getEngineuser(),
Expand Down Expand Up @@ -439,8 +439,8 @@ public static final class DescriptorImpl extends BuildStepDescriptor<Builder> {
new AnchoreQuery("show-pkg-diffs base"));
public static final String DEFAULT_POLICY_BUNDLE_ID = "";
public static final String EMPTY_STRING = "";
public static final boolean DEFAULT_TAG_AUTOSUBSCRIBE = true;
public static final boolean DEFAULT_USE_FORCE_FLAG = false;
public static final boolean DEFAULT_AUTOSUBSCRIBE_TAG_UPDATES = true;
public static final boolean DEFAULT_FORCE_ANALYZE = false;

// Global configuration
private boolean debug;
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/com/anchore/jenkins/plugins/anchore/BuildConfig.java
Expand Up @@ -28,8 +28,8 @@ public class BuildConfig {
private List<AnchoreQuery> inputQueries;
private String policyBundleId;
private List<Annotation> annotations;
private boolean autoSubscribeTag;
private boolean force;
private boolean autoSubscribeTagUpdates;
private boolean forceAnalyze;

// Global configuration
private boolean debug;
Expand All @@ -47,7 +47,7 @@ public class BuildConfig {
public BuildConfig(String name, String policyName, String globalWhiteList, String anchoreioUser, String anchoreioPass,
String userScripts, String engineRetries, boolean bailOnFail, boolean bailOnWarn, boolean bailOnPluginFail, boolean doCleanup,
boolean useCachedBundle, String policyEvalMethod, String bundleFileOverride, List<AnchoreQuery> inputQueries,
String policyBundleId, List<Annotation> annotations, boolean autoSubscribeTag, boolean force, boolean debug, String enginemode,
String policyBundleId, List<Annotation> annotations, boolean autoSubscribeTagUpdates, boolean forceAnalyze, boolean debug, String enginemode,
String engineurl, String engineuser, String enginepass, boolean engineverify, String containerImageId, String containerId,
String localVol, String modulesVol, boolean useSudo) {
this.name = name;
Expand All @@ -67,8 +67,8 @@ public BuildConfig(String name, String policyName, String globalWhiteList, Strin
this.inputQueries = inputQueries;
this.policyBundleId = policyBundleId;
this.annotations = annotations;
this.autoSubscribeTag = autoSubscribeTag;
this.force = force;
this.autoSubscribeTagUpdates = autoSubscribeTagUpdates;
this.forceAnalyze = forceAnalyze;
this.debug = debug;
this.enginemode = enginemode;
this.engineurl = engineurl;
Expand Down Expand Up @@ -154,12 +154,12 @@ public List<Annotation> getAnnotations() {
return annotations;
}

public boolean getAutoSubscribeTag() {
return autoSubscribeTag;
public boolean getAutoSubscribeTagUpdates() {
return autoSubscribeTagUpdates;
}
public boolean getForce() {
return force;

public boolean getForceAnalyze() {
return forceAnalyze;
}

public boolean getDebug() {
Expand Down
Expand Up @@ -231,12 +231,12 @@ private void runAnalyzerEngine() throws AbortException {
String theurl = config.getEngineurl().replaceAll("/+$", "") + "/images";

// Disable autosubscribe if necessary
if (!config.getAutoSubscribeTag()){
if (!config.getAutoSubscribeTagUpdates()){
queryList.add("autosubscribe=false");
}

// Enable force if necessary
if (config.getForce()) {
if (config.getForceAnalyze()) {
queryList.add("force=true");
}

Expand Down
Expand Up @@ -35,12 +35,12 @@
</f:repeatableProperty>
</f:entry>

<f:entry title="Anchore Engine tag auto subscribe" field="autoSubscribeTag">
<f:checkbox name="autoSubscribeTag" checked="${instance.autoSubscribeTag}" default="${descriptor.DEFAULT_TAG_AUTOSUBSCRIBE}"/>
<f:entry title="Anchore Engine auto-subscribe tag updates" field="autoSubscribeTagUpdates">
<f:checkbox name="autoSubscribeTagUpdates" checked="${instance.autoSubscribeTagUpdates}" default="${descriptor.DEFAULT_AUTOSUBSCRIBE_TAG_UPDATES}"/>
</f:entry>

<f:entry title="Anchore Engine force flag" field="force">
<f:checkbox name="force" checked="${instance.force}" default="${descriptor.DEFAULT_USE_FORCE_FLAG}"/>
<f:entry title="Anchore Engine force image analysis" field="forceAnalyze">
<f:checkbox name="forceAnalyze" checked="${instance.forceAnalyze}" default="${descriptor.DEFAULT_FORCE_ANALYZE}"/>
</f:entry>

<f:section title="Override Global Configuration">
Expand Down

This file was deleted.

@@ -0,0 +1,6 @@
<div>

If selected or set to 'true', the Anchore Container Image Scanner step will instruct Anchore Engine to force analyze the image.
Default value: 'false'

</div>

0 comments on commit ce3f61a

Please sign in to comment.